-
HSERIN and SEROUT2
I have an application where I want to use HSERIN and SEROUT2 on a 16F88. For this application TX needs to be inverted and HSEROUT won't do that without some type of inverter circuitry. I've set up the following I am able to RX but not TX. NOTE: Serout2 is not inverted for testing. Also I'm connected via a max232 TX functions noramlly if I swap Serout2 with Hserout.
Is using Serout2 for TX even possible? If so where am I going wrong?
DEFINE HSER_BAUD 9600
DEFINE HSER_RCSTA 90h
DEFINE HSER_TXSTA 04h ; Disable USART TX
DEFINE HSER_CLROERR 1
SerOut2 PORTB.5,84,["AT",CR] ; No data to PC via hyperterm
-
Hi Ben,
The SPEN bit in the RCSTA reg, sets control of both the RX and TX pins to the USART. There's no way to use the TX pin as general I/O at the same time.
You could put the SerOut2 on a different pin if you have a spare, but if Murphy's involved here, there probably aren't any.
<br>
-