another thought, on the non long version
if you load up another 30 or so cells in buffer with 00 or ff do problems recur
[surely its not just 01 or 0x69 that causes issue]
another thought, on the non long version
if you load up another 30 or so cells in buffer with 00 or ff do problems recur
[surely its not just 01 or 0x69 that causes issue]
Warning I'm not a teacher
The plot thickens...
Long stort short, flashed the device with the PICKit3, could not reproduce the error. Reflashed the bootloader into it and now I can no longer reproduce the error at will - even my ACTUAL code now works without that magic PAUSE 5 in there.
Before doing that I had reduced the test code to this:As soon as the code for BTN2 was executed it crashed while the code for BTN1 worked fine. Enabling the PAUSE 5 made it work. And the value being written made no difference.Code:Main: IF INTCON.2 = 1 THEN ' TMR0 interrupt flag? LD2 = ~LD2 ' Toggle LED so we know we're alive and kickin' INTCON.2 = 0 ENDIF If BTN1 = 0 THEN ' Buffer[107] = $00 ' Testcase with LONGs Buffer[117] = $00 ' Testcase without LONGs WHILE BTN1 = 0 : WEND ENDIF IF BTN2 = 0 THEN ' Pause 5 ' Buffer[108] = $00 ' Testcase with LONGs Buffer[118] = $00 ' Testcase without LONGs WHILE BTN2 = 0 :WEND ENDIF Goto Main
As for the question if bootloaders are worth it I'd say maby. In this particular case I'm juggling two boards but I only have one PICKit so swapping between boards would be less than ideal. The USB bootloader is super fast but makes up for that by forcing you to manually reset the device and press connect in the PC application before the bootloader times out.
Strange one this.
how about contact bounce on button switches ?
the only thing i can think of it to verify the flash as written by the bootloader is set the way it was intended to be.
Warning I'm not a teacher
Can you test the program on different kind of PIC?
Also, without bootloader, it works OK without the magic PAUSE 5 line?
It does seem a RAM problem related to LONGs but Charles may help more.
Ioannis
Bookmarks