Hello there!
I'm trying to initialize i2c in master-transmitter mode and send data with c6713 using Code Composer Studio and assembly, but can't seem to get it to work. The problem is that there's no signal on SDA and SCL pins after I start the program.
Here's a initialization part:of my code:
; Place I2C in reset state (IRS = 0 in ICMDR) MVKL .S1 0x0024,A1 MVKLH .S1 0x01B4,A1 MVKL .S1 0x0,A2 STW A2,*A1 NOP 5 ; Initialization procedure - I2CMDR MVKL .S1 0x0024,A1 MVKLH .S1 0x01B4,A1 MVKL .S1 0x690,A2 STW A2,*A1 NOP 5 ; Configure the slave address MVKL .S1 0x001C,A3 MVKLH .S1 0x01B4,A3 MVKL .S1 0x0,A4 STW A4,*A3 NOP 5 ; Set up I2C prescaled module clock - I2CPSC MVKL .S1 0x0030,A5 MVKLH .S1 0x01B4,A5 MVKL .S1 0x0,A6 STW A6,*A5 NOP 5 ; Program clock control registers - I2CCLKL and I2CCLKH MVKL .S1 0x000C,A7 MVKLH .S1 0x01B4,A7 MVKL .S1 0x12,A8 STW A8,*A7 NOP 5 MVKL .S1 0x0010,A9 MVKLH .S1 0x01B4,A9 MVKL .S1 0x12,A10 STW A10,*A9 NOP 5 ; Configure the master address MVKL .S1 0x0000,A1 MVKLH .S1 0x01B4,A1 MVKL .S1 0x0,A2 STW A2,*A1 NOP 5 ; Configure data transmit register - I2CDXR MVKL .S1 0x0020,A5 MVKLH .S1 0x01B4,A5 MVKL .S1 0x1F,A6 STW A6,*A5 NOP 5 ; Take I2C controller out of reset MVKL .S1 0x0024,A7 MVKLH .S1 0x01B4,A7 MVKL .S1 0x6A0,A8 STW A8,*A7 NOP 5 ; Generate a START event MVKL .S1 0x0024,A9 MVKLH .S1 0x01B4,A9 MVKL .S1 0x26A0,A10 STW A10,*A9 NOP 5
Thanks in advance!