Quote Originally Posted by mackrackit View Post
Here is a simple hardware sample to receive and send serially.
It will echo from a terminal program.
If I remember correctly mister E posted this a long time ago.
Works well for testing a setup.
Code:
DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive
DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 0
DEFINE HSER_SPBRG 129 ' 2400 Baud @ 20MHz, 0.17%
DEFINE HSER_CLROERR 1 ' Clear overflow automatically
DEFINE HSER_EVEN    1
DEFINE HSER_BITS    7

RCIF   VAR PIR1.5
SERIALDATA  VAR BYTE

PAUSE 100

MAIN:
IF RCIF THEN
    HSERIN  [SERIALDATA]
    HSEROUT [SERIALDATA]
    ENDIF
GOTO MAIN
Hello mackrackit,

With this code can test the operation of a port rs232 with a pic?, I can say that pic would be used and the configuration of the pins is very interesting!.

Thank you