Society of Robots - Robot Forum

Software => Software => Topic started by: santiago on October 20, 2010, 04:59:45 PM

Title: very quickly what is wrong with this program (small)
Post by: santiago on October 20, 2010, 04:59:45 PM
This Program is  in assembly language.
8 leds are connected from PD0-PD7. Therefore, the purpose is to write a program to turn on each LED from pin D0 to pin D7. In addition, I want to call a delay subroutine before turning on the next LED.

Yas help is greatly appreciated,

Santiago


.INCLUDE "M32DEF.INC"
LDI    R20, HIGH(RAMEND)
OUT    SPH, R20
LDI    R20, LOW(RAMEND)
OUT  SPL, R20
LDI    R20, 0xFF  ;initrialize stack pointer
OUT  PORTD, R20 ;make PORTD an output port
SBI  PORTD, 0   ;set bit PD)
CALL DELAY     ;delay before next one
SBI  PORTD,1    ;turn on PD1
CALL DELAY     ;delay before next one
SBI  PORTD,2
CALL DELAY
SBI  PORTD,3
CALL DELAY
SBI  PORTD,4
CALL DELAY
SBI  PORTD,5
CALL DELAY
SBI  PORTD,6
CALL DELAY
SBI  PORTD,7
CALL DELAY




This is what AVR Studio 4 tells me:
C:\Assembler\ledtest\ledtest.asm(17): error: Undefined symbol: DELAY
C:\Assembler\ledtest\ledtest.asm(19): error: Undefined symbol: DELAY
C:\Assembler\ledtest\ledtest.asm(21): error: Undefined symbol: DELAY
C:\Assembler\ledtest\ledtest.asm(23): error: Undefined symbol: DELAY
C:\Assembler\ledtest\ledtest.asm(25): error: Undefined symbol: DELAY
C:\Assembler\ledtest\ledtest.asm(26): No EEPROM data, deleting C:\Assembler\ledtest\ledtest.eep

Title: Re: very quickly what is wrong with this program (small)
Post by: Webbot on October 21, 2010, 05:44:12 PM
You've got to write the DELAY routine !
Title: Re: very quickly what is wrong with this program (small)
Post by: santiago on October 21, 2010, 09:44:31 PM
Thanks for responding Webbot.

Does anybody have an example of the delay routine?

Thanks.
Title: Re: very quickly what is wrong with this program (small)
Post by: garrettg84 on October 22, 2010, 05:42:18 AM
nop
Title: Re: very quickly what is wrong with this program (small)
Post by: santiago on October 22, 2010, 09:51:44 AM
Nop--that is no help. However, I found the answer.
Title: Re: very quickly what is wrong with this program (small)
Post by: waltr on October 22, 2010, 11:38:23 AM
nop => 'No opereration' instruction used for the minimum delay time.
Title: Re: very quickly what is wrong with this program (small)
Post by: santiago on October 23, 2010, 09:28:22 AM
Thanks: Webbot,garrettg8, and waltr.

Its gets a little frustrating when you have to learn 3 or 4 programming languages.

Thank God I can always count on you guys to help out!

Thank you!