Hi,
I am using the #use rs232 function with the hardware uart on a PIC18F series. However I can't then use output_low(PIN_C7) to drive pin c7 low. I only need to use the rs232 a certain parts of the program. I seem to remember a way to switch the #use directive on/off as required? Can't find it in the manual. Any ideas?
TTelmah Guest
Posted: Fri Dec 02, 2005 11:24 am
I think the easiest for what you describe, would be just to turn the peripheral off. So:
Code:
#bit SPEN=0xFAB.7
//Then to use the RS232:
SPEN=TRUE;
printf("TEST");
//Then to set C7 low
SPEN=FALSE;
output_low(PIN_C7);
The problem is that the peripheral enable, overrides the pin's output drive, so though the output is still 'commanded', the peripheal override prevents the pin from being driven.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum