invalid number?
2006-12-29 by Thomas Keller
Inthe following code, I am getting a fata "Invalid Number" error on the
line with the out instruction. I have tried this with bot h the register
name as defined in the def file (TCNT0) as well as with the literal
register address (0x2f), which is the value defined in 1n15def.inc
file. Why is it telling me "invalid number? (note, I have also tried
moving the value from r31 ro r0 and outputting it from there. same
error) I am flummoxed.
; begin
.include "tn15def.inc"
; set interrupt vectors, if any
;
reset:
rjmp start
reti ; Addr $01
reti ; Addr $02
reti ; Addr $03
reti ; Addr $04
reti ; Addr $05
reti ; Addr $06 Use 'rjmp myVector'
reti ; Addr $07 to define a interrupt vector
reti ; Addr $08
reti ; Addr $09
reti ; Addr $0A
reti ; Addr $0B This is just an example
reti ; Addr $0C Not all MCUs have the same
reti ; Addr $0D number of interrupt vectors
reti ; Addr $0E
reti ; Addr $0F
reti ; Addr $10
; Program starts here after Reset
;
start:
nop ; Initialize here ports, stack pointer,
nop ; cleanup RAM, etc.
nop ;
nop ;
;
; this table povides the data for the intesnity curve needed for
; the beacon simlation. the data represent the value sin^3 * 255 for
; each angle from 0 through 90 at .9 degree increments
TABLE:.db 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 3, 3, 4, 5, 6, 6
.db 8, 9, 10, 11, 13, 14, 16, 18, 20, 22, 24, 26, 29, 31, 34, 36
.db 39, 44, 48, 52, 55, 59, 62, 66, 70, 74, 78, 82, 86, 90, 94, 99
.db 103, 108, 112, 117, 121, 126, 130, 135, 140, 144, 149, 153
.db 158, 163, 167, 172, 176, 180, 185, 189, 193, 197, 201, 205
.db 209, 212, 216, 219, 223, 226, 229, 232, 234, 237, 239, 242
.db 344, 346, 247, 249, 250, 252, 253, 254, 255, 255, 255, 0
;
DELAY:
ldi r31, 0xff ; load 255 into temp register
out r31, 0x2f ; store in timer/counter 1
ldi r16, 0xff ; store 255 into primary counter
ldi r17, 0x49 ; store 73 into secondary
counter
tom