I'm developing an application with MQX3.7 compiled with IAR compiler (v. 6.1) using the TWRK60 toolkit as a protoype board .
In order to us the RS422 / RS485 transceiver ( U5 on the TWR-SER ) as a RS485 driver, i've to set the following jumpers : J17, J18 and J19 in pos 2-3
and i've installed three jumpers on the J13 header on pos 1-2 , 3-4 and 5-6.
I tried to use the IO_SERIAL_HW_485_FLOW_CONTROL option in opening my serial port as follows :
/* HW 485 flow control on chip*/
rs485_dev = fopen( RS485_CHANNEL, (char const *)(IO_SERIAL_HW_485_FLOW_CONTROL ) );
When i try to send a message on the rs485 device i see the RTS signal being driven sincronous with the char ( just before the fisrt character and just after the last char ) but the problem is in the polarity of the signal : instead of being driven HIGH during data transmission, it is driven LOW ( wich means enabling only the receiver of the transceiver ).
Is this a bug of MQX or there is a logical reason for MQX to drives this pin LOW instead of HIGH ..??
I've solved the problem simply opening the RS485 channel without the IO_SERIAL_HW_485_FLOW_CONTROL option and adding the hanshake of the RTS pin directly by the lwgpio driver .
However i think that this behaviour it would be corrected in MQX if there is any valid reason ....