Author Topic: MSP430 Serial Terminal in Paralell Out  (Read 1985 times)

0 Members and 1 Guest are viewing this topic.

Offline Simon123Topic starter

  • Regular Contributor
  • *
  • Posts: 205
  • Country: si
    • Youtube channel
MSP430 Serial Terminal in Paralell Out
« on: December 09, 2014, 07:27:55 pm »
Serial data terminal to binary value on output.
Hello!
I have to program a MSP430 board (g2432).
Its function should be to input decimal value on serial terminal, and get digital (8-bit should be ok) value on output.
I already need 2 analog pins for voltage measurment, but there are still some digital pins left.
On that paralell output i will put R 2R resistor ladder which wil create a simple DAC.
I kinda get stuck at software for this thing.
I am using energia for programming since i already have that voltage readout written in it.
Could someone help me with some examples or something?
And how should i use digital pins on that chip? Analog pins are marked A1,A2 ... But i dont know about digital ones. I already tried
B1 ... ofc it doesnt work. Is D1 ... proper way to do it?

Thanks for any help!
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: MSP430 Serial Terminal in Paralell Out
« Reply #1 on: December 09, 2014, 07:52:25 pm »
All pins on an MSP430 are accessed through their respective ports, P1, P2, etc.  Each port is 8 bits wide, which correspond to P1.0-1.7, etc.  You access them by accessing the corresponding register.  To read from port 1 you would read P1IN.  If you want to read from a specific pin on port 1, you would AND it with the bit you want, eg: P1IN&BIT2.  To write to a port you use P1OUT, to change the direction (input to output or vice versa) you use P1DIR, to change the mode you use P1SEL and P1SEL2, and so on.

I don't believe the G2432 has a UART port, so how will you be sending data serially?  I2C?  SPI?  You could bit-bang a UART using some GPIOs if necessary, there are guides online for doing that as well.

You should probably start with some simple LED blinking until you get a hand for the clock management system and GPIO interfacing.
 

Offline Simon123Topic starter

  • Regular Contributor
  • *
  • Posts: 205
  • Country: si
    • Youtube channel
Re: MSP430 Serial Terminal in Paralell Out
« Reply #2 on: December 09, 2014, 08:01:55 pm »
It has 2 uart pins and i have it connected to Launchpad thingie.
I was thinking something like that: http://bildr.org/2011/01/arduino-serial/
 

Offline suicidaleggroll

  • Super Contributor
  • ***
  • Posts: 1453
  • Country: us
Re: MSP430 Serial Terminal in Paralell Out
« Reply #3 on: December 09, 2014, 08:52:46 pm »
It has 2 uart pins and i have it connected to Launchpad thingie.

No, it really doesn't.
http://www.ti.com/product/msp430g2432
Code: [Select]
        MSP430G2432
Freq    16
Flash   8
FRAM    0
SRAM    0.25
GPIO    16
I2C     1
SPI     1
UART    0
DMA     0
ADC     8
etc.

Are you sure you're looking at the G2432?
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf