go_away

Author Topic: very quickly what is wrong with this program (small)  (Read 1539 times)

0 Members and 1 Guest are viewing this topic.

Offline santiagoTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
very quickly what is wrong with this program (small)
« 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

« Last Edit: October 21, 2010, 09:42:03 PM by santiago »

Offline Webbot

  • Expert Roboticist
  • Supreme Robot
  • *****
  • Posts: 2,150
  • Helpful? 110
Re: very quickly what is wrong with this program (small)
« Reply #1 on: October 21, 2010, 05:44:12 PM »
You've got to write the DELAY routine !
Webbot Home: http://webbot.org.uk/
WebbotLib online docs: http://webbot.org.uk/WebbotLibDocs
If your in the neighbourhood: http://www.hovinghamspa.co.uk

Offline santiagoTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: very quickly what is wrong with this program (small)
« Reply #2 on: October 21, 2010, 09:44:31 PM »
Thanks for responding Webbot.

Does anybody have an example of the delay routine?

Thanks.

Offline garrettg84

  • Robot Overlord
  • ****
  • Posts: 187
  • Helpful? 8
  • Armchair Roboticist Extraordinaire
Re: very quickly what is wrong with this program (small)
« Reply #3 on: October 22, 2010, 05:42:18 AM »
nop
-garrett

Offline santiagoTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: very quickly what is wrong with this program (small)
« Reply #4 on: October 22, 2010, 09:51:44 AM »
Nop--that is no help. However, I found the answer.

Offline waltr

  • Supreme Robot
  • *****
  • Posts: 1,944
  • Helpful? 98
Re: very quickly what is wrong with this program (small)
« Reply #5 on: October 22, 2010, 11:38:23 AM »
nop => 'No opereration' instruction used for the minimum delay time.

Offline santiagoTopic starter

  • Jr. Member
  • **
  • Posts: 32
  • Helpful? 0
Re: very quickly what is wrong with this program (small)
« Reply #6 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!

 


Get Your Ad Here

data_list