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
"I am trying to write code for the second serial port on the C167." What's a 'C167' then? "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." Did you try looking in the datasheet? Stefan
The data sheet shows both pairs, thats why I wondered if anyone had the same problem and resolved it. Neither work in the simulator. Do I need to direct the printf command to serial window or will it go to serial window #2?
I use a C167CR. On my C167 the Tx pin is P3.10 and the Rx pin is P3.11. I'm very interested by using a second asynchronous UART. Can you tell me if you fin something. Thanks. Gremlins
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.