I now tried a different USART peripheral (P3_21) and also removed the external HART module, and I'm still seeing that the USART communication is not at 0-3.3V. I believe the way I'm initializing the USART peripheral may not be accurate.Can you please confirm if I am initializing my Flexomm4 peripheral properly?
I'm starting with the "lpc5018iotmodule_usart_interrupt_transfer" example from the SDK and making modifications to it.
1. Initialized Flexcomm4 as USART in pinmux.c : I inserted these two lines in "BOARD_InitPins():
const uint32_t port3_pin26_config = (
IOCON_PIO_FUNC3 | /* Pin is configured as FC4_RXD_SDA_MOSI */
IOCON_PIO_MODE_INACT | /* No addition pin function */
IOCON_PIO_INV_DI | /* Input function is not inverted */
IOCON_PIO_DIGITAL_EN | /* Enables digital function */
IOCON_PIO_INPFILT_OFF | /* Input filter disabled */
IOCON_PIO_SLEW_STANDARD | /* Standard mode, output slew rate control is enabled */
IOCON_PIO_OPENDRAIN_DI /* Open drain is disabled */
);
IOCON_PinMuxSet(IOCON, PORT3_IDX, PIN26_IDX, port3_pin26_config); /* PORT3 PIN26 */
const uint32_t port3_pin27_config = (
IOCON_PIO_FUNC3 | /* Pin is configured as FC4_TXD_SCL_MISO */
IOCON_PIO_MODE_INACT | /* No addition pin function */
IOCON_PIO_INV_DI | /* Input function is not inverted */
IOCON_PIO_DIGITAL_EN | /* Enables digital function */
IOCON_PIO_INPFILT_OFF | /* Input filter disabled */
IOCON_PIO_SLEW_STANDARD | /* Standard mode, output slew rate control is enabled */
IOCON_PIO_OPENDRAIN_DI /* Open drain is disabled */
);
IOCON_PinMuxSet(IOCON, PORT3_IDX, PIN27_IDX, port3_pin27_config); /* PORT3 PIN27 */
2: In board.h I defined the following variables (basically changed the default "0s" to "4"):
#define BOARD_DEBUG_UART_BASEADDR (uint32_t) USART4
#define BOARD_DEBUG_UART_INSTANCE 4U
#define BOARD_DEBUG_UART_CLK_FREQ CLOCK_GetFlexCommClkFreq(0U)
#define BOARD_DEBUG_UART_CLK_ATTACH kFRO12M_to_FLEXCOMM4
#define BOARD_DEBUG_UART_RST kFC4_RST_SHIFT_RSTn
#define BOARD_UART_IRQ_HANDLER FLEXCOMM4_IRQHandler
#define BOARD_UART_IRQ FLEXCOMM4_IRQn
3: In usart_interrupt_transfer.c: I made the following definitions
#define DEMO_USART USART4
#define DEMO_USART_CLK_FREQ CLOCK_GetFlexCommClkFreq(4U)
4: In main() I commented out "BOARD_InitDebugConsole()"
It seems to me like the way I'm configuring the peripheral is incorrect and thus is causing a change in logic levels. Can you confirm my procedure is correct for initializing FlexComm4 for USART operation?