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.

UART on MSP430G2230?

Hi Guys,
I have the MSP430G2230 . It measures temperature via a sensor and save it in the flash .
An LED and a button is also connected. Now, i want to read these values in the flash over UART. 
Pins : - RST - TEST - P1.6 ( Pin4 ) are free .
How do I establish a UART connection to the MSP430G2230 ?
About tips and help I would be happy .
CIRCUIT : I use the MSP430g2 Launchapad to programm the g2230.
//                    MSP430G2230
//                 ---------------------------------------------
//            + - | VCC       (1)  (8)          VSS   |- -
//     LED <- | P1.2        (2)  (7)         TEST  |-X
//    TMP -> | P1.5        (3)  (6)          RST   |-X
//       free - | P1.6/A5    (4)  (5)           P1.7 |-SWITCH
// ------------------------------------------------ //
  • It does not have uart, so spi or i2c would be better.

    But as it have USI that can emulate startbit+byte+stopbit easily as it allows you to set a 10bit length for data.

    So just use SPI mode to send data on P1.6 with a common baudrate.
    You will not be able to read data easily.

    You could set RESET pin in NMI-mode as a way to tell to start the emulated TX uart transmission.
    Or just make it so that every time you press reset it will transmit any data that is in flash at boot-up.

  • Hi Soner!

    I didn't even know there are 8 pin devices available.

    Your device only has an USI module integrated, so no UART functionality built in. The only way could be programming a timer based software UART and use the last free pin for transmitting data to the PC, but this is just an idea. Software UART examples can be found in these code examples - have a look at

    • msp430g2xx2_ta_uart2400.c        Timer_A, Ultra-Low Pwr UART 2400 Echo, 32kHz ACLK
    • msp430g2xx2_ta_uart9600.c        Timer_A, Ultra-Low Pwr Full-duplex UART 9600, 32kHz ACLK

    But both of them use an external 32kHz crystal. I don't know if you can scale down the DCO to match the requirements, but you can give it a try.

    Dennis

  • And a 47k resistor from VCC to RST plus a 2n2 capacitor from RST to GND isn't a bad idea.

**Attention** This is a public forum