[QUOTE=Bruce]Assuming you're actually setting bit 1 in CONTROL, this will work;
IF CONTROL.0[X] THEN ' IF CONTROL.BIT.X = 1 THEN do something.
X is the bit index pointer 0 to 7. The .0 just tells PBP it's a bit.
Yes, the '.0' at the end of CONTROL.0 is how I have pointed to bit0 of register 'CONTROL' .
But the good news is that by declaring the Restore variables of system registers , WSAVE,PSAVE and SSAVE, in lower-case as wsave,ssave and psave the problem is gone............
Looked at pbppic14.lib and can see that the interupt handler in there uses the lower case version. My target chip ,16F690 has4K memory and uses the lib procedures.
So I'm happy now that that code works but now I have another problem......
In the interupt I increment a register once every 20mS
Later in the basic code I try making PORTC = TICKS (ticks is the incremented register). LED's attached to portC show the value of ticks but then it's as if the port is cleared because all led's quickly go blank, until the next time TICKS changes (I presume)
Weird...I see that PORTH is mapped to PORTC, so do I have to call PORTC with PORTH, or run the risk of the PORTH value over-riding the value I set it to ?
Learning curves are here for a reason I suppose !
Bookmarks