ArtemisGoldfish
Member
I'm just full of problems, aren't I?
Now, I've started programming in Assembly and WOW, it's a whole lot easier than I thought. As a test to make sure my PIC is functioning correctly, I wrote (stole most of the) code for writing to EEPROM. Since it's short, here it be:
#include <P16F876A.inc>
BSF STATUS,RP1
BSF STATUS,RP0
BTFSC EECON1,WR
GOTO $-1
BCF STATUS,RP0
MOVF 0x0000,W
MOVWF EEADR
MOVF 0x3F,W
MOVWF EEDATA
BSF STATUS,RP0
BCF EECON1,EEPGD
BSF EECON1,WREN
MOVLW 0x55
MOVWF EECON2
MOVLW 0xAA
MOVWF EECON2
BSF EECON1,WR
BCF EECON1,WREN
loop NOP
GOTO loop
end
Now, when I write it to my PIC (JDM programmer, IC-Prog 1.05D), hook it up, etc, and I plug it back into my programmer and read from it, the EEPROM location 0x0002 was written to instead of 0x0000, as I had copied to the EEADR register. Well, errr, What up with that?
Thanks again, community, for putting up with me.
Now, I've started programming in Assembly and WOW, it's a whole lot easier than I thought. As a test to make sure my PIC is functioning correctly, I wrote (stole most of the) code for writing to EEPROM. Since it's short, here it be:
#include <P16F876A.inc>
BSF STATUS,RP1
BSF STATUS,RP0
BTFSC EECON1,WR
GOTO $-1
BCF STATUS,RP0
MOVF 0x0000,W
MOVWF EEADR
MOVF 0x3F,W
MOVWF EEDATA
BSF STATUS,RP0
BCF EECON1,EEPGD
BSF EECON1,WREN
MOVLW 0x55
MOVWF EECON2
MOVLW 0xAA
MOVWF EECON2
BSF EECON1,WR
BCF EECON1,WREN
loop NOP
GOTO loop
end
Now, when I write it to my PIC (JDM programmer, IC-Prog 1.05D), hook it up, etc, and I plug it back into my programmer and read from it, the EEPROM location 0x0002 was written to instead of 0x0000, as I had copied to the EEADR register. Well, errr, What up with that?
Thanks again, community, for putting up with me.