cancel
Showing results for 
Search instead for 
Did you mean: 

Failed write the IIC register ICBR of SPC584C70E3FMC

JJaso.1
Associate

After IIC module is initialized, when I prepared the data and to write the IBCR register to send it, after the register is written with the value 0x70(master mode, tx mode, interrupt enable and generate START condition), the value read from the IBCR is 0x50. Who can tell me what's wrong?

Thanks!

0693W00000YAPjbQAH.png0693W00000YAPjlQAH.png

1 ACCEPTED SOLUTION

Accepted Solutions
Erwan YVIN
ST Employee

Hello ,

You should check the fonction IICB_vSetControlReg

Which debugger do you use ?

TRACE32 or PLS ?

i recommend you to switch in assembler mode ..

sometimes , there is a misalignment of the hex file and source code file.

Best regards

Erwan

View solution in original post

2 REPLIES 2
Erwan YVIN
ST Employee

Hello ,

You should check the fonction IICB_vSetControlReg

Which debugger do you use ?

TRACE32 or PLS ?

i recommend you to switch in assembler mode ..

sometimes , there is a misalignment of the hex file and source code file.

Best regards

Erwan

JJaso.1
Associate

Hello Erwan

Thanks a lot for your answer!

My debugger is MULTI. And the function IICB__vSetControlReg is defined as below:

#define IICB__vSetControlReg(u8Ch, a)    REG_WRITE8((IIC0__nBaseAddress+IIC__nCtrlRegOffset), a)

#define REG_WRITE8(address, value)    ((*(volatile uint8*)(address))= (uint8)(value))

I followed your suggestion to debug in assembler mode. The result is confused!

Please see the debugger information as the attached image shows

0693W00000YAkJhQAL.pngWhat possible reasons can cause the register IBCR to fail to write?

Best regards!