GlennSar 0 Posted April 5, 2014 Share Posted April 5, 2014 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. Quote Link to post Share on other sites
spirilis 1,265 Posted April 5, 2014 Share Posted April 5, 2014 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 Quote Link to post Share on other sites
Rickta59 589 Posted April 5, 2014 Share Posted April 5, 2014 You might look at the implementation of the BSL programmer done with an msp430g2553 launchpad. It provides 2 uarts, one connected to the pc usb via the hardware UART and the other to a chip via a software timer UART. Find it some place on the TI site. Quote Link to post Share on other sites
GlennSar 0 Posted April 5, 2014 Author Share Posted April 5, 2014 Thanks, guys. I'm gonna play with this tomorrow. Quote Link to post Share on other sites
GlennSar 0 Posted April 6, 2014 Author Share Posted April 6, 2014 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. Quote Link to post Share on other sites
spirilis 1,265 Posted April 6, 2014 Share Posted April 6, 2014 Connected external 4.7Kohm (preferred) pullups between each line and 3.3V (Vcc)? Should be one on the P1.6 net and one on the P1.7 net. Edit: Also, disconnect the green LED jumper that connects to P1.6. Sent from my Galaxy Note II with Tapatalk 4 Quote Link to post Share on other sites
GlennSar 0 Posted April 6, 2014 Author Share Posted April 6, 2014 I've setup everything one more time and I've noticed that stupid jumper 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. Quote Link to post Share on other sites
drexel21 0 Posted May 1, 2014 Share Posted May 1, 2014 @@GlennSar Could you share how you figured it out? Quote Link to post Share on other sites
roadrunner84 466 Posted May 1, 2014 Share Posted May 1, 2014 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. Quote Link to post Share on other sites
mbeals 74 Posted May 1, 2014 Share Posted May 1, 2014 if you can swing it, the MSP-EXP430F5529LP launchpad has two USCI_Ax peripherals that support UART, as well as two USCI_Bx perips for I2C /SPI Quote Link to post Share on other sites
xyiii 0 Posted February 13, 2015 Share Posted February 13, 2015 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? Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.