Mmm, interesting point, i've never think about it.
A simple experimentation here reveal that it doesn't cause ANY problem as long as you did a HSEROUT before writing to PORTC. Once you did it, those RX and TX I/Os are dedicated to HSERIN/HSEROUT only.
i tried...
If you use it, you'll discover that nothing happen to PORTC.6 and PORTC.7... well they stay at their usual levels... High.Code:' ' Pic Configuration ' ================= @ __CONFIG _XT_OSC & _WDT_ON & _PWRTE_ON & _BODEN_ON & _LVP_OFF ' XT (4Mhz) oscillator ' Enable watch dog timer ' Enable power up timer ' Enable brown out detect ' Disable low voltage programming ' ' Hardware configuration ' ====================== TRISC=%10000000 ' PORTC.7 as input => USART RX, ' Others as output ' ' Serial Communication definition ' =============================== DEFINE HSER_RCSTA 90h ' Enable serial port & continuous receive DEFINE HSER_TXSTA 24h ' Enable transmit, BRGH = 1 DEFINE HSER_SPBRG 25 ' 9600 Baud @4MHz, 0.16% DEFINE HSER_CLROERR 1 ' Clear overflow automatically ' ' Variables definition ' =================== CounterA var byte ' ' Main program ' ============ HSEROUT [0] Start: PORTC=%11111111 PAUSE 500 PORTC=0 PAUSE 500 GOTO START
Now a slight better test...
Use MicroCode Serial Communicator to do you Tests... it still workCode:Start: HSEROUT ["Send me data...",13,10] hserin [DEC Countera] PORTC=countera GOTO START




Bookmarks