-->
Page 2 of 2

Re: Timing issues trying to reproduce exact pulse widths

PostPosted: Sun Jan 31, 2016 3:42 am
by tve
There is some wifi stuff that uses the non-maskable interrupt :-(

Re: Timing issues trying to reproduce exact pulse widths

PostPosted: Sun Jan 31, 2016 1:02 pm
by unsignedchar
Could that be a caching issue?

Code that is running from flash goes through a small SRAM cache. So when the code is not in the cache, it is read from flash to cache first before the CPU can use it. (All automatic. In hardware. Impressive.)
Just maybe this is what you seeing? Sometimes your code gets aged out of the cache and has to be re-read.

Try to NOT inline the sensitive code.
Also, do NOT tag it with ICACHE_RODATA_ATTR.

Then the code goes into a special, fast SRAM set aside from the cache.

Might be worth a try. The fast SRAM isn't too big though. (Also 32k? Can't remember.)