Steve Underwood wrote:
Steffen Netz wrote:
Hi,
in the TI-UG is mentioned a difference in I2CDRW/I2CDRB as
Word/Byte-Registers.
In the msp430/usart.h, I found:
#define I2CDR_ 0x0076 /* I2C data */
sfrb(I2CDR, I2CDR_);
Can we write for compatibility:
#define I2CDRW_ 0x0076 /* I2C data Word*/
sfrb(I2CDRW, I2CDR_W);
#define I2CDRB_ 0x0076 /* I2C data Byte*/
sfrb(I2CDRB, I2CDR_B);
Address 0x0076 is on the 8 bit bus. It is most certainly an 8 bit
register. What makes you think it could be treated as a word register?
What is in our header file agrees with the current header files from TI.
I don't think it would be wise not to follow their way of doing things.
Steve
When I2CWORD bit is set in the I2CTCTL register, the I2CDR (=0x0076) is
operating in word mode (referred to I2CDRW in SLAU049E). When the bit is
reset, only the lower byte is used and word write operation would fail.
I have used similar macros, except for sfrw(...)
#define I2CDRW_ 0x0076 /* I2C data Word*/
sfrw(I2CDRW, I2CDR_W);
/Andrei