Hi all,
I need to configure my UART(2) to use RTS flow control on the MCF52259. I can use the UART normally with IO_SERIAL_RAW_IO no problem, but cant get RTS working. I checked PUCPAR and it is set to one indicating primary function of RTS on pin 82 (PUC3).
I tried many experiments, settings, configurations yesterday and this morning. I have posted some simple test code below that hopefully someone can look at and quickly tell me what I have done wrong, or why its not working. I have no experience with hardware flow control really, Ive used it on other projects and it "just worked" so I didnt have to look into it.
//Auto start task
void SDI_Task(void)
{
uint_32 temp = 0;
pointer Comm3_IO;
uint_8 SDI_TX_BUFF[512] = {0};
//Needs to have 9 bit data, always set low, so I tried this >>
Comm3_IO = (pointer)fopen("ittyc:", (pointer)(IO_SERIAL_RAW_IO));
//PUCPAR bit 3 becomes set ifi printf PUCPAR or stop debugger and check it...
//9 bit data always low for this application
temp = IO_SERIAL_PARITY_SPACE;
ioctl(Comm3_IO, IO_IOCTL_SERIAL_SET_PARITY, &temp);
//For a simple test to see if I could just get RTS to change state I tried this >> (this does nothing)
temp = IO_SERIAL_RTS;
(void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_SET_HW_SIGNAL, &temp);
_time_delay(100);
(void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_CLEAR_HW_SIGNAL, &temp);
_time_delay(100);
(void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_SET_HW_SIGNAL, &temp);
_time_delay(100);
(void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_CLEAR_HW_SIGNAL, &temp);
_time_delay(100);
(void)ioctl(Comm3_IO, IO_IOCTL_SERIAL_SET_HW_SIGNAL, &temp);
sprintf(SDI_TX_BUFF, "123456789");
for(;;)
{
_time_delay(1000);
//CTS is manually tied high with a 10K resistor, tried high and low with no change
//I tried first setting and/or clearing the RTS as above, but still nothing
fprintf(Comm3_IO, "%s", SDI_TX_BUFF);
}
}