I am trying to write code for the second serial port on the C167. I seem to be having major trouble. I have read that port pins 3.0 and 3.1 are Tx and Rx respectively and then from other sources that 3.8 and 3.9 are tx and rx respectively. Can anyone help? P3 |= 0x0001; /* SET PORT 3.0 OUTPUT LATCH (TXD) */ DP3 |= 0x0001; /* SET PORT 3.0 DIRECTION CONTROL (TXD OUTPUT) */ DP3 &= 0xFFFD; /* RESET PORT 3.1 DIRECTION CONTROL (RXD INPUT) */ ASC1_TIC = 0x80; /* SET TRANSMIT INTERRUPT FLAG */ ASC1_RIC = 0x00; /* DELETE RECEIVE INTERRUPT FLAG */ ASC1_BG = 0x40; /* SET BAUDRATE TO 9600 BAUD @ 20MHz */ ASC1_CON = 0x8011; /* SET SERIAL MODE */ ALTSEL0P3 |= 0x0003; /* Configure port pins for serial interface 1 */ #endif
Hey there. I tried several different ways. The second serial port will not work in an asynch fashion without the aid of an external transceiver. You can do this by taking the signal of on the correct pins but be careful as this can be fidgety. It was a while since I did this so any probs ill try and help. all the best
What's a 'C167' then? Math coprocessor for the C166?
Are you really using the C167 or are you using the XC167? The XC167 has two serial UARTs.