Coldfire M5475 - Enabling data cache affects ability to see register value changes?

I've got some code which has setup the 5 DSPI pins on the ITX-Header connector of a Coldfire M5475EVB for GPIO.

We're trying to sample the values of these pins as fast as possible and appear to have solved a number of issues we had with the performance, one of the ways was to enable data, branch and instruction caches.

However, now we've got something to drive the pins, I found that when we read the MCF_GPIO_PPDSDR_DSPI register (the one which contains the pin states), we get the same value back each time. The value may change between board resets, but appears constant during execution, even when we're altering the states of the pins externally to known states.

After a comparison with an older version which worked, I tracked it down to the data cache. It seems that by setting the Enable Data Cache (DEC) bit in the CACR causes the processor to cache the value of the register, and never read it again, even though it's being changed (though probably not to the processor's/cache's knowledge).

Any advice about how to overcome this?

Thanks

Reply to
David Hearn
Loading thread data ...

I don't use this particular micro but your cache controller MUST have some method for configuring noncacheable regions, for precisely this reason.

Reply to
larwe

Hi,

David Hearn wrote: ...

just a dumb question ... did you set the ACRs accordingly ? Having the internal periphery space set to be cached is asking for trouble

HTH Stamatis

Reply to
stz

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.