Break it down, make it simple, build it back up.
Erase the chip, Blank check it, make sure both program and eeprom space reads back as $ff, then try this:
Code:
@ DEVICE PIC12F683, INTRC_OSC_NOCLKOUT
@ DEVICE PIC12F683, WDT_ON
@ DEVICE PIC12F683, PWRT_ON
@ DEVICE PIC12F683, MCLR_OFF
@ DEVICE PIC12F683, BOD_ON
@ DEVICE PIC12F683, CPD_OFF
@ DEVICE PIC12F683, PROTECT_OFF
temp var byte
temp2 var byte
ledpin var gpio.(pick a pin)
output ledpin
main:
'show a heartbeat for the program on an LED to make sure something is happening
temp2 = temp2 + 1 : ledpin = temp2.0
for temp = 0 to 255 : write temp, temp : next temp : goto main
end
Hook an LED to a pin, let it blink a few times, then do a readback on the PIC. That should tell you if your eeprom statement is working in the first place. Then build it back up...
Bookmarks