Using the eTPU for RS422 should be straight forward. You just need to use the right driver IC on the output. What are you using just now?
Is your interfacing requirement HALF DUPLEX or FULL DUPLEX communications? This will dicate how you switch from TX to RX if you are using half duplex. Full duplex won't be an ussue with RS422 as you normally have separate TX and RX drivers.
I am currently working on some code for Modbus that runs over a half duplex RS485 link on 2-wires. I need to detect when transmission is completed and I think the following code I posted before might work.
while (ETPU.CHAN[TX_CHANNEL].SCR.B.CIS == 0)
{
/* wait for data to transmit */
}
This is currently untested as I am still in the process of writing the Modbus drivers at this stage and won't be ready to test the eTPU for about another week or 2.
I have though use the eTPU UARTS to talk to a Vinculum VNC1L USB host controller and it works just fine. I have another 2 UART's on the eTPU talk to other devices over RS232 and the also work fine.
I'd agree w/ Dave that the eTPU will work for RS232/422/485 depending on the driver IC you choose. I currently use the eTPU for all three serial protocls, although I use full duplex mode for all of them. I do have one half duplex 485 channel that runs a modbus protocol, but I run it from one the standard Com ports (U0 in my case) becuase these UARTS have actual hardware support for switching Rx/Tx by using the RTS lines while the eTPU uarts do not this support. Dave, I'd be interested in knowing if your code is successful in supporting hallf duplex for future reference. if so, let us also know how fast it goes too. When possible, I try to configure the eTPU Uarts to work at lower baud rates.
For driver chips, look at the Maxim or Sipex parts. In my case, end users configure the com ports w/ various sensors that can be any of th eRS3232/422/485 protocols, so I use a MAX3160E driver IC that be jumpered to support all protocols including full or half duplex modes. Although this is convenient, the chips are much more expensive than a single-protocol device. I think the MAX3079E is a 422/485 only device that supports both full and half duplex. Some chips will support more than one com port, sometimes in various individual protocols...
I'll let you know how it goes. I have been using another eTPU UART at 115200 to talk to a Vinculum VNC1L USB host controller and this works very well.
I use a GPIO pin to control the RS485 drive IC's. I am hoping that the code I posted works for the turn around detection. I can't use an OSTimeDly as even with the minimum of 1, this is far too long a wait so I am looking at using one of the timers to setup a delay for the switch over to RX and TX. This timer needs to vary depending on the baud rate used. It is also used for the same Modbus protocol to detect end of reception.
I have a total of 4 UART's on the eTPU all running at different baud rates. Generally they work at 9600 for the Modbus protocol (1 slave Modbus port and 1 master Modbus port) but can be set to a maximum of 57600. This is primarily for the slave port as I never know what speed the client is going to talk to it at. The 3rd port is the USB at 115200 and the 4th is a lowly 1200 bps (yes, that speed is still used these days). So far this is working fine but the next couple of weeks testing of the full setup with proper Modbus running and not just test software will be the crunch time.
I also have another development from a client where I need 9 UART's running at 9600 bps. Not sure yet if the eTPU has enough grunt to do this or if I will have to use an external UART but I am going to wire up the dev board to try this out.
The cable length will be up to max (3000 feet) while the transmission rate should be around 57k-115k. I should also be able to use all eTPU ports (8). Can this work reliably?