help on MSP430 I2C programming

Status
Not open for further replies.

casual3_2002

Advanced Member level 4
Joined
Nov 1, 2003
Messages
114
Helped
2
Reputation
4
Reaction score
1
Trophy points
1,298
Activity points
564
msp430 i2c

Anyone has some examples of MSP430 I2C programs for writing to
a slave register? The protocol is: STart --> Device Address+Write -->
ACK --> Register Address --> ACK --> Data ...... --> StoP
TI's I2C C examples is like: I2CTCTL |= I2CTRX + I2CSTT + I2CSTP;
which does not specify the Register Address. Anyone knows how to set the register address in the C program? Thanks a lot.
 

msp430 i2c c examples

The TI samples are for the IAR C-Compiler, if you take a look inside the sample you will see a line like this
" #include "msp430x16x.h" "
in the header you can find all register adresses which aply for this type of µC.
You can download the Trial version of the C-Compiler from the TI Website, then you have all the headers too.
Regards...
 

msp430 i2c programming

registers are not accessible directly from C. You should inline assembly code to access registers. There are also certain rules about C function parameters, like first r15 etc. So You may be aware what register is used.
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…