Jump to content
43oh

MSP-EXP430G2 - two pair UART and I2C communication


Recommended Posts

Hi!

I've got a launchpad MSP-EXP430G2 rev. 1.5 (with msp430g2553) and I need to use two pair of UART (2xRx and 2xTx). To be more specific, here's what I have to do:

  • PC transmits 'data' to MSP --> MSP process that 'data' --> MSP transmits 'processed data' to another MCU...
  • PC receives 'processed data' from MSP <-- MSP process that 'data' <-- MSP receives 'data' from another MCU...

In short:

PC -> MSP -> another MCU -> MSP -> PC

 

Is it possible to do this with that launchpad? If it is, could you hint me some examples? I'm completely new with MSP.

Link to post
Share on other sites

Probably not with UART between the two MCUs (without diving into the messy world of software-based UART) but maybe SPI (high speed) or I2C (a bit slower but way faster than the PC-LaunchPad UART anyhow). Look into the USCI section of the MSP430x2xx User Guide for the scary details of how those peripherals work... or Energia might give you an easier way to start, http://energia.nu ... However if you switch to using the MSP-EXP430F5529LP launchpad instead, it has 2 genuine UARTs.

 

Sent from my Galaxy Note II with Tapatalk 4

Link to post
Share on other sites

I've tried that Energia software and it looks really cool!

 

First of all I've tested UART echo - so easy and works very well.

 

I2C should be enough for me so I've tested Energia's Wire examples (sender - reader) -> https://github.com/energia/Energia/tree/master/hardware/msp430/libraries/Wire/examples

 

I've connected two MSP with each other: P1.7 - P1.7 and P1.6 - P1.6.

One of them is connected with PC and should write data that is send through I2c. Unfortunately it's not working :/ I'm not sure why... Maybe something with that HW/SW jumpers? In what position they should be?

 

EDIT:
I've also connected that pullup resistors. Still the same.

Link to post
Share on other sites

I've setup everything one more time and I've noticed that stupid jumper :P Anyway, examples works! :)

 

Now I have to write program that supports two way communication: master sends 'data' -> slave recieve it and process it -> slave sends 'processed data' back to master. It is possible, right?

 

EDIT:

Nvm, I got this :) Thanks for the help.

Link to post
Share on other sites
  • 4 weeks later...

I2C slaves cannot "send" data, only respond to a query from a master.

I2C does however support multi-master, so either device could initiate the transmission. I doubt the Wire library supports multi-master though.

Alternatively you could set the MSP up to query the other MCU when you expect data, or maybe even poll it.

Another option would be to use an "out of band interrupt"; let the other MCU set an GPIO pin low/high when it has data ready for retrieval. Then the MSP acts upon this GPIO level and initiates a query to the other MCU over I2C.

Link to post
Share on other sites
  • 9 months later...

I've tried that Energia software and it looks really cool!

 

First of all I've tested UART echo - so easy and works very well.

 

I2C should be enough for me so I've tested Energia's Wire examples (sender - reader) -> https://github.com/energia/Energia/tree/master/hardware/msp430/libraries/Wire/examples

 

I've connected two MSP with each other: P1.7 - P1.7 and P1.6 - P1.6.

One of them is connected with PC and should write data that is send through I2c. Unfortunately it's not working :/ I'm not sure why... Maybe something with that HW/SW jumpers? In what position they should be?

 

EDIT:

I've also connected that pullup resistors. Still the same.

 

 

Hi could you share how could you do the software uart with energia?

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...