Hi,
I'm trying to get my MCU to communicate with my computer via a COM port, but so far, I've had no luck. My setup includes the MCUXpresso IDE, where I've activated the RX and TX pins. Additionally, I've configured USART communication, which resulted in the following configuration:
const usart_config_t USART0_config = {
.baudRate_Bps = 115200UL,
.syncMode = kUSART_SyncModeDisabled,
.parityMode = kUSART_ParityDisabled,
.stopBitCount = kUSART_OneStopBit,
.bitCountPerChar = kUSART_8BitsPerChar,
.loopback = false,
.enableRx = true,
.enableTx = true,
.clockPolarity = kUSART_RxSampleOnFallingEdge,
.enableContinuousSCLK = false,
.fifoConfig = {
.enableRxFifo = false,
.rxFifoSize = 4U,
.rxFifoThreshold = 1U,
.enableTxFifo = true,
.txFifoSize = 4U,
.txFifoThreshold = 0U
}
};
static void USART0_init(void) {
// USART0 peripheral initialization
USART_Init(USART0_PERIPHERAL, &USART0_config, USART0_CLOCK_SOURCE);
}
I then wrote a simple program intending to upload a file:
#include <stdio.h>
#include "board.h"
#include "peripherals.h"
#include "pin_mux.h"
#include "clock_config.h"
#include "LPC54101.h"
#include "fsl_debug_console.h"
#include "fsl_usart.h"
int main(void) {
// Initialize board hardware.
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitBootPeripherals();
#ifndef BOARD_INIT_DEBUG_CONSOLE_PERIPHERAL
// Initialize FSL debug console.
BOARD_InitDebugConsole();
#endif
// Sending some bytes via USART0
for (uint8_t i = 0; i < 15; i++) {
uint8_t data = 41 + i;
USART_WriteByte(USART0, data);
}
}
Following the steps outlined in this guide, I compiled my project and obtained a .hex file. I then used FlashMagic to upload the code to my LPC54101J512.
Despite not receiving any errors from the compiler or FlashMagic, and even after trying three different USB <-> UART converters, I'm not seeing any results.
Can anyone pinpoint what I might be doing wrong?