PA3040
Advanced Member level 3
- Joined
- Aug 1, 2011
- Messages
- 883
- Helped
- 43
- Reputation
- 88
- Reaction score
- 43
- Trophy points
- 1,308
- Activity points
- 6,936
Dear All,
This is my first AVR Program
This program is build succeeded. then I debug it is using AVR studio-6
1. First it pointed start
2. then jump to main ( call sys_init)
3.Then jumped to sys_init subroutine
4.finally it met ret command
5 then it returned to start instead of call blink_led
Please advice
Thanks in advance
This is my first AVR Program
Code:
.include <m32def.inc>
Start: jmp main
main: call sys_init
call blink_led
blink_led: ldi R16,0b11111111
out PORTB,R16
ldi R16,0b00000000
out PORTB,R16
jmp blink_led
sys_init: ldi R16,0b11111111
out DDRB,R16
ret
This program is build succeeded. then I debug it is using AVR studio-6
1. First it pointed start
2. then jump to main ( call sys_init)
3.Then jumped to sys_init subroutine
4.finally it met ret command
5 then it returned to start instead of call blink_led
Please advice
Thanks in advance