This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Problems reading CAN Controller LEC in Infineon XC164CI

Hello!

In an application I have the problem of reading the contents of the TwinCAN Controller A Status Register.
Below you will see a code snipped and what the compiler creates out of it:

773:  mem=CAN_ASR;
00010C5A D7408000  EXTP     #0x0080,#1
00010C5E F2F40402  MOV      R4,DPP0:0x0204
00010C62 E4801E00  MOVB     [R0+#0x001E],RL4

mem is an integer variable, so the compiler seems to correctly move just the lower byte into the variable itself

If I unplug the CAN, the CAN_ASR is updated with the value 0x00EB, which I can see in the Peripherals and Memory Window of µVision2 when I come to the code position shown above. But when I do a single step in the code, R4 is not updated with this value. It will have 0x00E8 as contents. The lower 3 bits, which represents the LEC are missing!!
Has anybody already had problems with this??

Andreas

0