Hi,
I'm trying to learn the assembler to program PICs. I'm doing alright, largely learning off of Nigel's tutorials.
I wrote a some-what complicated bit of code and it didn't work. So I keep trouble shooting it until I get down to really basic stuff ... and that won't even work.
Someone, please tell me why even this insanely simple bit of code won't work.
tone equ 0x31
sLoop
movlw 0xff
movwf tone
movlw tone ; <<<<<<
movwf PORTA
goto sLoop
I'm just trying to put 0xff into the register tone and then have tone put into PORTA.
If I replace tone with 0xff on the line with the arrows, it works fine. For some reason it won't let me load a value into tone and then use it later.
What am I doing wrong ?
Thanks.
I'm trying to learn the assembler to program PICs. I'm doing alright, largely learning off of Nigel's tutorials.
I wrote a some-what complicated bit of code and it didn't work. So I keep trouble shooting it until I get down to really basic stuff ... and that won't even work.
Someone, please tell me why even this insanely simple bit of code won't work.
tone equ 0x31
sLoop
movlw 0xff
movwf tone
movlw tone ; <<<<<<
movwf PORTA
goto sLoop
I'm just trying to put 0xff into the register tone and then have tone put into PORTA.
If I replace tone with 0xff on the line with the arrows, it works fine. For some reason it won't let me load a value into tone and then use it later.
What am I doing wrong ?
Thanks.