5234 - eTPU & RS422

Discussion to talk about hardware related topics only.
zealott
Posts: 40
Joined: Thu Oct 30, 2008 1:15 am

5234 - eTPU & RS422

Post by zealott »

Do I need any special hardware to use the eTPU in RS422 mode? (drivers?)
Any hints on this or software snippets of any kind?

Thanks :)
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: 5234 - eTPU & RS422

Post by v8dave »

Hi zealot,

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.

Regards
Dave...
zealott
Posts: 40
Joined: Thu Oct 30, 2008 1:15 am

Re: 5234 - eTPU & RS422

Post by zealott »

Hi Dave,

Thanks for the reply.

I have not chosen an driver IC yet, anything you recommend?

I think it will be half duplex as it most likely will be a 2-wire connection, but I am not 100% sure yet.

Thanks
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: 5234 - eTPU & RS422

Post by v8dave »

Hi,

Without knowing your drive requirements is hard to suggest a device. I would suggest you check out the Maxim website for some information.

What's the maximum cable length to intend to drive over and how many devices on the same network? These will impact the driver you need.

Good luck
Dave...
Ridgeglider
Posts: 513
Joined: Sat Apr 26, 2008 7:14 am

Re: 5234 - eTPU & RS422

Post by Ridgeglider »

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...
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: 5234 - eTPU & RS422

Post by v8dave »

Hi RG,

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.

Dave...
zealott
Posts: 40
Joined: Thu Oct 30, 2008 1:15 am

Re: 5234 - eTPU & RS422

Post by zealott »

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?
zealott
Posts: 40
Joined: Thu Oct 30, 2008 1:15 am

Re: 5234 - eTPU & RS422

Post by zealott »

Humm, seems like 115k for all 8 ports might be a tad to much for the eTPU perhaps?
v8dave
Posts: 333
Joined: Thu Dec 31, 2009 8:31 pm

Re: 5234 - eTPU & RS422

Post by v8dave »

Is this from testing you are doing or from calculations?

You might need to use an external UART to do this. Not that difficult if you have not yet designed your PCB.

Dave...
zealott
Posts: 40
Joined: Thu Oct 30, 2008 1:15 am

Re: 5234 - eTPU & RS422

Post by zealott »

Hi Dave,

I have not calculated it yet no, trying to find some references...

You mean an external UART instead of eTPU's? Wouldn't those also pose performance problems with 8 full duplex lines?

Cheers
Post Reply