Skip to main content
dongnguyen39
Associate II
June 7, 2007
Question

LEARN ST7

  • June 7, 2007
  • 2 replies
  • 787 views
Posted on June 07, 2007 at 06:02

LEARN ST7

This topic has been closed for replies.

2 replies

dongnguyen39
Associate II
May 24, 2007
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
June 7, 2007
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 ]