As you know we have to control EN signal for transmiting data through RS485 line. There is simple way to control this signal. We enable TX line on RS485 bus, when we send data and wait while all data will be transmitted and finally we disabe TX line. The code would be like this:
#define TX485EN(i) BitWrPortI( PDDR, &PDDRShadow, i,6 )
while (BitRdPortI(STSER_REG,3) || BitRdPortI(STSER_REG,2));
But the problem is waiting all time while data will be transmitted!!!. Imagine if you send 300bytes in 9600kbit/s. You have to wait about 313ms !!! at this time you can't do anythink just wait.
Question: Did anybody try to modify DC library that a serial interrupt self disable TX signal when all data will be transmitted from a serial loop buffer?
I would like that the serial interrupt controls EN line. :confused:
I'm using DC9.62 and RCM3100.
Thanks for your ideas