Skip to main content
This topic has been closed for replies.

2 replies

dongnguyen39
Associate II
May 24, 2007 3:08 AM UTC
Posted on May 24, 2007 at 05:08

Dear

:) I want to make toggle led with st7flite. please help me.

thank you

p239955_stm1_stmicro_com
Visitor II
Jun 7, 2007 4:02 AM UTC
Posted on June 07, 2007 at 06:02

There are various ways to toggle a LED via an I/O. The most simple and basic is to toggle an I/O:

Ex. with LED connected on pin PB0, code in assembler language:

.loop_toggle

ld A, PBDR

xor A, #$01

ld PBDR, A ; PB0 state changes, PB0 toggles.

jra loop_toggle ; jump back to loop_toggle label

Depending on your needs (dedicated frequency, LED to toggle on specific events), another solution is to use a timer and its alternate functions.

Hope it answers your question.

[ This message was edited by: Pedro on 07-06-2007 09:33 ]