Forgot to mention: 18F25K20 and PBP 3.0.4.4
Should've editied the post well....you know....
Forgot to mention: 18F25K20 and PBP 3.0.4.4
Should've editied the post well....you know....
Hi,
OK, it LOOKS like a dummy read of SSPBUF before writing the variable to it fixes the problem. The datasheet is fairly clear on this dummyread when expecting valid data - which I don't. And I still don't understand why it makes a difference where the actual value written to SSPBUF is comming from, ie. constant or variable.
/Henrik.
Totally off the top of my head; maybe the dummy read clears a buffer?
And this buffer doesn't handle a constant and variable the same way (allocation of space, bit VS byte, etc).
Robert
EDIT: Looking over your code again and I just thought of something after seeing the PAUSE. Does the time it takes PBP to access the value stored in a variable interfere with the MSSP module?
Bear in mind that I have absolutely no clue what a MSSP module eats in wintertime.
EDIT SOME MORE: Forgot to ask, how are these variables defined?
SST_Status
SSPBUF (looks like a BYTE in MSSP section of 18f25k20 datasheet)
Last edited by Demon; - 5th January 2012 at 02:53.
Bookmarks