Skip to main content
JJaso.1
Associate
February 10, 2023
Solved

Failed write the IIC register ICBR of SPC584C70E3FMC

  • February 10, 2023
  • 2 replies
  • 1485 views

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

This topic has been closed for replies.
Best answer by Erwan YVIN

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

2 replies

Erwan YVIN
Erwan YVINBest answer
ST Employee
February 13, 2023

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
JJaso.1Author
Associate
February 15, 2023

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!