Sign in

username:

password:



Not a member?

Search avrclub



Search tips

Subscribe to avrclub



avrclub by Keywords

AT90S2313 | AT90S8515 | ATMega | ATmega128 | ECL | FETS | IAR | Keyboard | LCD | STK50 | TMOS | UART

Ads

Discussion Groups

Discussion Groups | AVRclub | [AVR club] LED chaser problem

Atmel AVR Microcontroller discussion group.

[AVR club] LED chaser problem - Brian - Jan 30 19:42:21 2007

First, once I make changes to a file in studio 4 I save it and then
build it. After building do I have to save it again before
programming or exiting?

Right now all leds are on except one that runs across. I want all
off and one on to run across. I have tried everything I know with no
good results. The leds on the STK500 are connected to Vcc. I dont
get any errors or warnings on building. It works on debug but not on
my mega16. I've tried to invert all the bits thinking that may do it
but no change.

Timer:
(This is my delay timer so I can see it work)

; set time has passed, rotates LEDs

mov Counter, Speed ; resets counter
in temp, PortB ; reads in current state
rol temp ; rotates to the left
out PortB, temp ; outputs to PortB

brcs PC+2 ; checks Carry Flag, skip if
set
ldi temp, 0b11111110 ; resets to PB0 on, others
off

rjmp Start ;loops back to Start

Thanks,
Brian


(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )


[AVR club] Re: LED chaser problem - Brian - Feb 4 9:12:40 2007

Whoo Hoo, I figured it out. I had to set the carry flag before I
rotated my leds and I also forgot to sent temp to PortB. Duh! This
also required a PC+3 for my branch.

--- In a...@yahoogroups.com, "Brian" wrote:
>
> First, once I make changes to a file in studio 4 I save it and
then
> build it. After building do I have to save it again before
> programming or exiting?
>
> Right now all leds are on except one that runs across. I want all
> off and one on to run across. I have tried everything I know with
no
> good results. The leds on the STK500 are connected to Vcc. I dont
> get any errors or warnings on building. It works on debug but not
on
> my mega16. I've tried to invert all the bits thinking that may do
it
> but no change.
>
> Timer:
> (This is my delay timer so I can see it work)
>
> ; set time has passed, rotates LEDs
>
> mov Counter, Speed ; resets counter
> in temp, PortB ; reads in current state
> rol temp ; rotates to the left
> out PortB, temp ; outputs to PortB
>
> brcs PC+2 ; checks Carry Flag, skip if
> set
> ldi temp, 0b11111110 ; resets to PB0 on, others
> off
>
> rjmp Start ;loops back to Start
>
> Thanks,
> Brian
>



(You need to be a member of avrclub -- send a blank email to avrclub-subscribe@yahoogroups.com )