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.
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...
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.