LPC17xx Serial enabling RTS

ChibiOS public support forum for topics related to the NXP LPC family of Cortex-M micro-controllers.
rschoele
Posts: 3
Joined: Tue Aug 08, 2017 8:31 pm

LPC17xx Serial enabling RTS

Postby rschoele » Tue Aug 08, 2017 8:41 pm

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

rschoele
Posts: 3
Joined: Tue Aug 08, 2017 8:31 pm

Re: LPC17xx Serial enabling RTS

Postby rschoele » Tue Aug 08, 2017 9:42 pm

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

rschoele
Posts: 3
Joined: Tue Aug 08, 2017 8:31 pm

Re: LPC17xx Serial enabling RTS

Postby rschoele » Tue Aug 08, 2017 10:32 pm

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

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: LPC17xx Serial enabling RTS

Postby Giovanni » Wed Aug 09, 2017 12:23 pm

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


Return to “LPC Support”

Who is online

Users browsing this forum: No registered users and 5 guests