AnsweredAssumed Answered

BF538F EZ-Kit I2C issue

Question asked by Smolny Employee on Mar 11, 2010
Latest reply on Mar 15, 2010 by Smolny

Can't make I2C i/f work on 538F Ez-kit.

 

Initialization (Master Transmit, Fast Mode):
#define PRESCALE_VALUE 10
#define CLKDIV_HI 17                                    //30%DUTY CYCLE
#define CLKDIV_LO 8
*pTWI0_CONTROL = TWI_ENA | PRESCALE_VALUE;
*pTWI0_CLKDIV = 0x1708; //((CLKDIV_HI) << 8) | (CLKDIV_LO);
*pTWI0_MASTER_ADDR = DeviceAddr;  //Device is 0111000b, so 0x38
*pTWI0_MASTER_CTRL = 0x0209;

 

Right after writing to MASTER_CTRL we get
TWI0_MASTER_CTRL == 0x0208 (master didn't enabled)
TWI0_MASTER_STAT == 0x0004 (ANACK?)
TWI0_INT_STAT    == 0x0030

 

And I ever didn't see any transitions on SDA/SCL - no START sequence.

I can control both lines with overriding in MASTER_CTRL - but can't start normal Master Mode.

Outcomes