eskimohunter
New Member
Hi I'm new to PICs so this is probably a stupid mistake but I can't seem to change the GPIO register.
The program compiles fine (no warnings or errors) and all the other registers update fine (status TRISO and W) in the watch window. However whenever I try bsf or bcf instructions they do nothing and movwf instructions are just messed up (trying to write 8 results in a 0 being written, writing a 24 results in a 16 being written etc etc) :s. I know theres registers like ANSEL but the data sheet says they only affect input. I'm also aware of the 'Read-Modify-Write problem' but that shouldn't affect the MPLAB SIM. I'm not sure if the problems even in code as previously working code now doesn't want to function.
I can post code if people want to but I suspect it's either MPLABs got messed up somehow or I'm not setting up the GPIO properly. As far as I was aware though you only need to set the TRISIO bits to 0.
Any help much appreciated
Rob
The program compiles fine (no warnings or errors) and all the other registers update fine (status TRISO and W) in the watch window. However whenever I try bsf or bcf instructions they do nothing and movwf instructions are just messed up (trying to write 8 results in a 0 being written, writing a 24 results in a 16 being written etc etc) :s. I know theres registers like ANSEL but the data sheet says they only affect input. I'm also aware of the 'Read-Modify-Write problem' but that shouldn't affect the MPLAB SIM. I'm not sure if the problems even in code as previously working code now doesn't want to function.
I can post code if people want to but I suspect it's either MPLABs got messed up somehow or I'm not setting up the GPIO properly. As far as I was aware though you only need to set the TRISIO bits to 0.
Any help much appreciated
Rob