Page 1 of 1

WinCE, USART to RS485

Posted: Thu Jan 17, 2013 11:11 am
by sebeksd

We are using WinCE and AT91SAM9260EK BSP sources as a base.

Our board is a custom design with RS485 on USART3 (conected through SP3485E).

If I'm right RS485 can be managed directly by AT uP after setting usart in RS485 mode (AT91C_US_USMODE_RS485).
In this mode processor will automatically use RTS to change Read/Write mode of SP3485E.

Problem is that after I changed this mode in HWOpen (Serial_SAM926X_HW.cpp file) nothing realy changes ...
Port still work only in one way :(

To check if port can be managed manually I've added ClearRTS/SetRTS to COM_Write function in driver and it works but:
- this is propably not the right way to do it
- port work grate for most of the time but when I use CERHost, probably because processor is in stress, port start to behave strange (it work slow, sometimes there are random data on it and so on)

To be sure it is a driver issue a I started same application on virtual RS485 (MOXA USB<->RS485) and it work ok (no delays, no strange data on it).

Can anyone help me with this problem, what I'm doing wrong ?
Maybe I should change something else, not only USART mode ?

If I misunderstood something, please correct me :)