We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello,
I have a free running hardware timer on a LPC2478 (timers are 32 bit). no interrupts related to that timer are used.
can the following code corrupt the value latched from the hardware timer, if the timer ticks just when the copy is done? can it cause a misbehavior of the loop? I know this is not a good programming example - I'm just curious.
unsigned long timer_value_ref = T2TC ; do { } while (T2TC - timer_value_ref < 1000) ;
Just a note. If the ARM core/memory interface requires that the compiler switches to multiple smaller read/write operations for unaligned accesses, then you must not request that the compiler packs data that gets accesses from multiple threads or from application loop and ISR. The default is of course that the compiler do not pack the data.