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.

Software UART - MSP430g2452 - MSP430g2553 - Serial.println

Other Parts Discussed in Thread: MSP430G2452, MSP430G2553, ENERGIA

Hi,

I have a really simple as well as very annoying issue. This very basic instruction does not work as it should be.

Serial.println("hi");

When I choose the "MSP430g2452" as board, compile and upload it to my launchpad it will show me "hi" at my serial monitor. If I change the board to the one I actually use, "MSP430g2553", compile&upload it will not give me any message at the monitor. I feel like something must be wrong with my drivers/energia.

  • I did not change the jumper between both uploads.
  • I did upload exactly the same code, just with the correct board configuration and it does not work
  • I use Energia 0101E0012, I also tried Energia 0101E0011 - the same issue
  • I use a Windows emulation (Parallels), but even my MAC Energia had the same problem

What do I miss here? I am quite confused.

Best

  • Hi Markus,

    You mean the MSP430G2452 as a Microcontroller....

    I Assume on the launchpad G2...

    Where you get

    Quote:

    Included MSP430G2xx device features:

    • MSP430G2553IN20 – 16kB Flash, 512B RAM, interruptible GPIOs (capacitive sense-capable), 16-bit timers, 8ch 10-bit ADC, Comparator, Serial Communication (USCI – I2C, SPI & UART) & more
    • MSP430G2452IN20 – 8kB Flash, 256B RAM, interruptible GPIOs (capacitive sense-capable), 16-bit timers, 8ch 10-bit ADC, Comparator, Serial Communication (USI – I2C & SPI) & more

    And so there is no UART interface on the G2452.

    That's why you will not see anything in your Terminal.

    Cheers

    NBA

  • Hi Nessim,

    thank you for your response! I agree that it would make totally sense if:

    the terminal did not show anything using the MSP430G2452, but unfortunately it only shows me notifications when I do use the MSP430G2452, although I physically use the MSP430G2553 uC.

    Do you know what I mean?

    Best

     

  • Hi,

    ok now i got it.

    But drivers do not have anything to do with it:

    The drivers are useful for the launchpad, not the micro controller.

    So if you see anything on your screen : everything is ok with the drivers.

    Now you change the micro controller, and by this i think you mean the micro controller you indicate ion the software,

    something goes wrong.

    Now nobody can tell you unless you send in the code you are using....

    So please post in you code i will check it...

    NBA

  • Exactly that is what I do - I indicate another uC in energia.

    Here is my code:

    void setup() { Serial.begin(9600); }

    void loop() { Serial.println("hi"); }

    3833.msp430g2452.tiff

    3058.msp430g2553.tiff

  • Hi,

    ok now it is not really possible for me to tell you exactly what is happening behind you 2 lines of code:

    because energia writes the program fro you.

    You don't really get the whole picture of what's happening...

    Anyway, since energia knows that the g2452 doesn't have any UART, maybe it tries to make a software UART out of it.

    And this work on every possible MSP430 with output pins at a certain location...

    And that's why it worked for you!

    I'm guessing, if you select the g2553, energia knows that to has the hardware UART module and use it as preferred,

    and therefore, the jumpers which you did not change become wrong,

    So

    change you jumpers to HW UART like in the picture , and enjoy :-)

  • You are absolutely right! Thank you very much! I believed that the x553 has to be jumped at SW UART in order to directly communicate through USB with my terminal. Anyway - problem solved. Cheers!

  • Hi again,

    Don't get confused:

    G2452 doesn't have a UART Module => Energia sets a software UART => SW UART.

    G2553 have a UART Module => Energia uses that hardware module =>  meaning HW UART.

    Do not forget to click verified answer to close the topic.

    Cheers

  • Nessim, some minor correction:
    The software UART code uses the timer CCR0 and CCR1 registers to get a precise timing. This code is of course bound to the proper port pins for TA0.0 and TA0.1. Unfortunately, the use of these pins (and the CCRs they belong to) is twisted against the UART pins for hardware UART. And CCR0 and CCR1 cannot be easily swapped due to the difference between the two which the code depends on.
    Hence the problems with the jumpers. When using software UART, RX and TX are reversed compared to the hardware UART. Since energia uses one or the other depending on the availability of a hardware UART (as you correctly pointed out), the chip selection changes the pin meaning and requires different jumper settings on the LaunchPad board.

    Markus,
    the LaunchPad has a built-in USB/ser bridge, which is mainly used for debugging but also provides an up to 9600Bd serial bridge. From MSP side, it is a simple serial connection as if you’d directly connect to a PC’s COM port (with the proper level shifting). The bridge chip doesn’t care for where the data come sfrom or goes to, as long as the direction is correct and the baudrate is not more than 9600Bd and properly selected in the PC driver.

**Attention** This is a public forum