This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F5437: Using BSL-RX and TX pins as regular UART on Replicator REP430F

Part Number: MSP430F5437
Other Parts Discussed in Thread: REP430F, SN74LVC1T45

Tool/software:

Hello, 

My intention is to complement Replicator REP430F with custom code that allows communication and programming replicator with desired image.
My problem is that I cannot bring UART to work. I haven't found any notes that BSL-RX and TX pins cannot be used for user application as UART line.
Currently, I use Replicator430F from slau320 repository as a base code.

Here is my UART code:

Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include "Config430.h" // High-level user input
#include "driverlib.h"
#include "debug_log.h"
#ifdef MCLK_18MHZ
#define MCLK_FREQ 18000000 // 18 MHz
#else
#define MCLK_FREQ 12000000 // 12 MHz
#endif
#define UART_BASE USCI_A0_BASE
#define UART_BAUD_RATE 115200
bool is_init_done = 0;
void Debug_UART_Init(void)
{
if (!is_init_done)
{
GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0);
// Configure UART pins: P3.4 = UCA0TXD, P3.5 = UCA0RXD
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


This code is added after general MCU initialization from file Replicator430.c
Fullscreen
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
void runProgramm(void)
{
//! \brief Data pointer
word p;
//! \brief Buffer, used for memory read with ReadMemQuick()
word ReadArray[0x40];
/*------------------------------------------------------------------------------------------------------*/
/* 1. | Initialize host MSP430 (on Replicator board) & target board */
/*------------------------------------------------------------------------------------------------------*/
InitController(); // Initialize the host MSP430F5437
ShowStatus(STATUS_ACTIVE, 0); // Switch both LEDs on to indicate operation.
Debug_UART_Init();
Debug_UART_Log(test_msg);
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX


What I tried:
1. I verified that clock works and set to 12 Mhz(choose in config file), by enabling test through the pin and checking with logic analyzer.
2. I tried to use internal UART loop back and it works, I see register values change when I try to TX, RX register is populated with same value, if I enable interrupts, they also trigger.
3. I set level shifter SN74LVC1T45 (REP430F schematic), to output process signal B->A direction P2.0 LOW output. see document REP430F user guide for schematic.
4. I connected FTDI serial cable to check output and I see nothing. I cannot logic analyzer and it also doesn't register any signaling.

Any help would be appreciated!

  • Hi,

    I still not understanding what you are trying to do here. But looked into your code. Can you try below code to configure the P3.4 and P3.5 pin as UART function?

    P3SEL |= GPIO_PIN4 + GPIO_PIN5;

    instead of calling GPIO_setAsPeripheralModuleFunctionInputPin()

    Best regards,

    Cash Hao

  • Hello,
    Thank you for your response!
    I have tried to set pins in the following way as well, no result.

    I'm just trying to setup UART peripheral, in application code based on Replicator430 code(http://www.ti.com/lit/zip/slau320)


  • Found the issue, I used wrong function for Setting Direction pin to low.

    Instead of GPIO_setOutputLowOnPin(GPIO_PORT_P2, GPIO_PIN0);
    Should have used GPIO_setAsOutputPin(GPIO_PORT_P2, GPIO_PIN0);

**Attention** This is a public forum