Hi,
I'm interfacing a GPS skynav SKM53 which uses UART with MCB 1700 board( onboard LPC1768 microcontroller). I have the transmitter pin of GPS connected to P2.1 (configured as UART1 Rx). Though, i can see the data in the RBR (Receive Buffer) register but I don't see the UART_IRQ handler being invoked neither are any flags being set(like LSR,RLS or RDA)
I have tested the IRQ handler by interfacing with PC (COM Port connected using RS232 cable) and it works perfectly. I use the same function for interfacing on peripheral pins of UART, it doesn't get invoked. Is there any other configuration, I need to do so as to invoke IRQ handler when data is seen on the peripheral??? Please advise.
Have you enabled the interrupt in NVIC?
NVIC_EnableIRQ(UART0_IRQn);
Yes...I have enabled the interrupt in the UART initialization function..and I have tested the UART IRQ handler, dey work perfectly when I use the Serial port UART..I'm facing the problem only when I use the peripheral pins On the board..
"I'm facing the problem only when I use the peripheral pins On the board.."
Maybe you did not configure to roll of the pins to be UART RX/TX ?
Have you read the datasheets and usermanuals properly?
The skynav SKM53 datasheet clearly mentions... "The serial connections are at 2.85V LVTTL logic levels, if need different voltage levels, use appropriate level shifters."
Have you connected Level shifter ICs (eg: Max232) properly?
MAX232 is not a suitable level shifter.
It is designed for 5V logic levels on one side, and RS-232 levels on the other side.
The MAX3232 is designed for 3.3V logic levels on one side and RS-232 levels on the other side.
Neither of MAX232 nor MAX3232 is intended for board-level interfacing of two logic-level components. They are intended to handle the RS-232 signalling standard for serial cables.
In this case, a logic level shifter may be needed that can work with 2.85V on one side and whatever logic levels the processor uses for the other side. Depending on what processor is used, it might be possible to get it to function without a logic level shifter. But there may be a need of a series resistor from processor to GPS to limit the current, if the processor operates at a higher logic level. The datasheet should tell what is the maximum input voltage the GPS can handle. Or a voltage divider might be used to step down the high logic level from the processor.
In the other direction, lots of processors will accept 2.85V as logic high, because the inputs are often designed to work with both CMOS and TTL logic levels.
Hi Tamir,
I have the transmitter pin of GPS connected to P2.1 (configured as UART1 Rx).
Its configured as below
LPC_PINCON->PINSEL4 &= ~0x0000000F; LPC_PINCON->PINSEL4 |= 0x0000000A; /* Enable RxD1 P2.1, TxD1 P2.0 */
Thanks.
The ST3232C is a RS-232 driver and receiver, supporting 3-5.5V on the logic-level side.
So good when your LPC17xx is connected to a PC.
But if that GPS have logic-level signalling, then you either need two ST3232C to step down to logic levels again. Or remove your current ST3232C.
One side of a ST3232C can not be connected to logic-level devices. It outputs too high voltages and can destroy logic-level devices connected on the RS-232 side.
Thank you Westermark for the reply.
I don't think I have an option to remove ST3232C chip from the board. I can only add peripherals.
I tested the output voltage from the GPS, its 2.85 v as per the datasheet and the pin which I'm connecting on the board has a description like this
“5v Tolerant pad providing digital I/O functions with TTL levels and hysteresis. This pin is pulled up to a voltage level of 2.3V to 2.6V”
So, I believe 2.85 v shouldn't cause a problem as its 5v tolerant and shouldn't it be able to pull up with 2.85v.
Do you think I need a level shifter to bring down the voltage to fall with in the range of 2.3v to 2.6 v or I can go ahead with direct interfacing?
If the controller GPIO line can detect 2.3V or above that voltage as logic level high, then following connection should work:
Controller GPS Module TxD RxD RxD TxD Gnd Gnd
Alternatively, you can also pull-up the RxD-TxD lines connecting Max232/3232 and GPS module to +5V (or +3.3V only if Max3232 is used) using 10K pull-up resistor.