I've been scouring the forums for a complete I2C implementation for MSP430G2553 using Code Composer Studio. All I can find are code snippets out of context or single byte examples.
I need to figure out how to do the following using Code Composer Studio 7x On an MSP430G2553 with I2C:
- Write a byte of data to a specific register.
- I need to do the above on 2 different I2C slaves.
- I need to read MULTIPLE bytes from a single I2C slave.
I am new to controller programming. I have been programming in Windows for 20 years, but the low level controller programming is just one huge paradigm shift for me. If somebody could point me to a good example of the above 3 operations that will work in Code Composer Studio 7.x, I'd be very grateful.
I'm not asking somebody to write my code. I'm just having trouble with the basic concepts of how things work when programming controllers in CCS. I'm used to calling a function like:
The above, when called would set pin 14 as an output pin.
However, when I see something in a TI example like:
UCB0CTL0 = UCMST + UCMODE_3 + UCSYNC; // I2C Master, synchronous mode
I can't make any sense of it. It's all abbreviated. Setting values is acting like calling a function. It's nice and compact, but for a guy used to calling a function with a meaningful name, it's incomprehensible... Looks like jibberish. I cannot read that code and make out what parts of it are doing what.. I'm thinking I might just need some 'Intro to Controller Programming' class to put me in the mode to decipher the above code.
It appears to me that the world of controller programming uses 'short-hand' instead of calling functions. I'm sure there's good reasons for this, but it's really hard to follow when first starting out. Any useful help with some explanations that would be useful to somebody like me who doesn't already know the answer would be greatly appreciated.
Anybody can say that they know how to do something. A truly gifted person can actually teach it to somebody that doesn't already know. That's what I'm asking for here. Or at least guide me to some source where the examples ARE spoon fed to start with. I just don't get the whole paradigm at this point, so it's hard for me to decipher...