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

ERRATA 89 -the second line of the code

Hello ,

What is the purpose of the second line of the code in errata 89 ? 

I mean this line ;

*(volatile uint32_t *)0x40003FFC;

did you use this one like nop ?

best regards,

*(volatile uint32_t *)0x40003FFC = 0;
*(volatile uint32_t *)0x40003FFC;
*(volatile uint32_t *)0x40003FFC = 1;

  • Hello MB,

    The purpose of the second line of the code in errata 89 was to make sure there is no extra current draw. So, we have to disable the TWIM (TWI Master with easy DMA) /SPIM (Serial Peripheral Interface Master) properly by turning the TWIM/SWIM off (0) and back on (1) after it has been disabled. To do so, it has to be written 0 followed by 1 to the power register (address 0XFFC) of the TWIM/SPIM that must be disabled.   

    Therefore, this line *(volatile uint32_t *)0x40003FFC assures the effect of Read Back Register as any read on the system bus requires the write buffer to be emptied first. Then we ensure it sets to '0' before it sets to '1'. You can say to give an extra clock cycle before it sets to 1. 

    Hope it helps. Feel free to ask if you have further query.

    Best Regards,

    Kazi Afroza Sultana

  • "any read on the system bus requires the write buffer to be emptied first. "

    I am glad to ask that question because I learned another detail. 

    Thank you.

    By the way , so when we just define a pointer on that address, also creates a read code ? Because code it self looks like just a definition,not reading or value assigning ... I think this is the second thing that I learned as a detail.

    Thanks.

  • Hello,

     Regarding your query- ''When we just define a pointer on that address, also creates a read code ?''  The code will read/load the value of that address (0x40003FFC) into one of the CPU registers. 

    Was this you intend to know?

    BR
    kazi

Related