Page 1 of 1

LPC17xx Serial enabling RTS

Posted: Tue Aug 08, 2017 8:41 pm
by rschoele
Hello,

I have the serial driver implemented for uart1 on an LPC1778 and the device I'm trying to communicate with has an API with RTS flowcontrol enabled by default.

My pin configs are set for RTS and CTS and using a scope I can see my data when I transmit, but I get no response from the other device.
Using TRACE32 (lauterback) if I manually enable RTSEN in the MCR register then everything works. I transmit and the other device responds.

I can't find where to configure the MCR register via the serial drivers. Is this possible?

thanks,
Ryan

Re: LPC17xx Serial enabling RTS

Posted: Tue Aug 08, 2017 9:42 pm
by rschoele
I was noticing that in LPC17xx.h MCR is defined in the structure definition for UART0
uart0_structdef.GIF


But MCR is not defined in UART structure definition and has RESERVED0 between LCR and LSR. Can I add MCR here so I can configure it then?
uart_structdef.GIF

Re: LPC17xx Serial enabling RTS

Posted: Tue Aug 08, 2017 10:32 pm
by rschoele
Got it working.
I added the highlighted line in serial_lld.c and it enables the RTSEN bit.

#if LPC17xx_SERIAL_USE_UART1
if (&SD2 == sdp) {
div = LPC17xx_SERIAL_UART1_PCLK / (config->sc_speed << 4);
LPC_UART1->MCR |= 0x40;
}
#endif

Re: LPC17xx Serial enabling RTS

Posted: Wed Aug 09, 2017 12:23 pm
by Giovanni
Hi,

Thanks for the code, sadly the LPC ports are currently not maintained, the person handling it left the team. Support has been discontinued after 2.6.x.

Giovanni