Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

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

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top