PDA

View Full Version : How many serial ports can 1 PIC handle?



Tom Gonser
- 2nd March 2005, 03:40
I am using a 16876A for prototyping. It reads in from the PC, and then reads out to an LCD, the PC, and I want it to read out to a GPS also..

I have used ports as follows:

Cpinin var PortC.7 ' for PC in
Cpinout var PortC.6 ' for PC out 9600b - works

Apinout var PortA.0 ' out to LCD serial 9600b - works

AGPSout var PortA.1 ' out to GPS - serial 4800b - not working!

PORTA = %00000 'Initialize PortA to all zeros - all output
TRISA = %00000 'All port A output

PORTB = %00000000 'Initialize PortB to all zeros
TRISB = %00000000 'All port B output(not using B for serial)

PORTC = %01000000 'Initialize PortC to all zero except 7
TRISC = %01000000 'All port C pins are output except pin 7 which is input (RX)

I can't seem to find a way to get any more than 2 ports to work.. Hooking up to PortA.1, 2,3,4,5 never seem to get any data out...

Am using SEROUT2 - but get no data on this last port:
serout AGPSout, 188,[,10,13,"$GPWPL,",#Dec_lat1,".", #Dec_lat2]

Is it that the PIC only can do 2 serial ports?

Thanks

Tom

mister_e
- 2nd March 2005, 03:44
never tested many serial outputs but what about if you disable the A/D converter on PORTA??

ADCON1=7

Tom Gonser
- 2nd March 2005, 04:26
It was a dumb mistake -- as usual..

I had configured the output via SEROUT2 driven true none - 84 like the one going through the RS232 chip.. this does not... Needed to be driven inverted none 16468.. fix that and presto.. not a problem...

Sorry for taking up the bits on such a simple problem..

TG

mister_e
- 2nd March 2005, 04:34
It was a dumb mistake -- as usual..
TG

of course not the last to be done ;) That's happen to everybody playing with those toys !!!