bsodmike
New Member
Hi,
I've been working on some code in PICC and have been looking at CCS, which I must say is quite tempting. Tbh, I've spent the past few days attempting to satisfy the PICC compiler which complains about the most tedious things. For example, I had maxed out bank0 RAM space and rather than just shifting vars to bank1, 2 (etc)...it generates a greek like error (some thing _psect _rdata bank 0). Of course I found the problem, after a bit of reading up/wasting a ton of time.
The list goes on, but here's something that's really annoying. Basically I'm controlling two lines (open collector) so to pull it low, you set the output to 0, and TRIS = 0. To release, TRIS=1 (making it a high impedance input) and both lines are pulled high to Vcc via two 10K resistors.
I have defined something like this:
Is there anyway to directly control these pins in asm (via #asm/#endasm) without doing things like bcf _PORTA,3 etc etc. More like bcf IN_X_DATA_PIN?
Another strange issue is that bcf _PORTA,3 isn't working even....very odd. Back to tinkering with this pesky compiler. CCS eats stuff like this for breakfast...it's shocking.
I've been working on some code in PICC and have been looking at CCS, which I must say is quite tempting. Tbh, I've spent the past few days attempting to satisfy the PICC compiler which complains about the most tedious things. For example, I had maxed out bank0 RAM space and rather than just shifting vars to bank1, 2 (etc)...it generates a greek like error (some thing _psect _rdata bank 0). Of course I found the problem, after a bit of reading up/wasting a ton of time.
The list goes on, but here's something that's really annoying. Basically I'm controlling two lines (open collector) so to pull it low, you set the output to 0, and TRIS = 0. To release, TRIS=1 (making it a high impedance input) and both lines are pulled high to Vcc via two 10K resistors.
I have defined something like this:
Code:
// Bit Address Defining command
#define BITNUM(adr, bit) ((unsigned)(&adr)*8+(bit)) // Used for port defs
// Mouse Port Pins
static bit IN_X_DATA_PIN @ BITNUM(PORTA,3); // RA3
static bit IN_X_DATA_TRIS @ BITNUM(TRISA,3); //
static bit IN_X_CLOCK_PIN @ BITNUM(PORTA,2);// RA2
static bit IN_X_CLOCK_TRIS @ BITNUM(TRISA,2);//
Is there anyway to directly control these pins in asm (via #asm/#endasm) without doing things like bcf _PORTA,3 etc etc. More like bcf IN_X_DATA_PIN?
Another strange issue is that bcf _PORTA,3 isn't working even....very odd. Back to tinkering with this pesky compiler. CCS eats stuff like this for breakfast...it's shocking.