PDA

View Full Version : HSERIN and SEROUT2



DynamoBen
- 1st July 2006, 16:39
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

Darrel Taylor
- 1st July 2006, 20:06
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>

DynamoBen
- 3rd July 2006, 00:06
Hardware it is I guess