Hi all,
Situation: Our code was running from flash, data was stored in RAM. Because of a faster processor we're going to get, we changed the startup so code gets copied to RAM and everything is running from RAM.
We also have a PEC transfer for A/D conversion and a PEC transfer to update 4K of video memory, from buffer to physical display.
What we see is that now everything is running from RAM, our processes (2 interrupt routines that call all modules) take -longer- to execute and we can't explain it. Does anyone have clue what could have caused this?
Both in the ROM and RAM situation, external memory has to be accessed so I don't know why extra waitstates would be inserted for PEC transfers. Timing of both ROM and RAM is the same, no waitstates. What could be the difference that caused things to get -slower- (execution time of 15ms becomes 20ms)?
Regards, Joost Leeuwesteijn
Hi Joost,
What is the exact derivative you are using? If I understand you correctly you are running everything via the external bus? If so and you have the identical settings in the BUSCONx registers then I would expect no difference in performance.
Regards, -Chris
What is the exact derivative you are using? If I understand you correctly you are running everything via the external bus?
C167CR-LM 20Mhz
If so and you have the identical settings in the BUSCONx registers then I would expect no difference in performance.
That's what we thought too... Some experiments seem to indicate that it has to do with the PEC transfers. Not sure why. When I disable the PEC transfer from the display, I win (back) 5ms...
In the old situation code was running from a different BUSCON (flash) than the PEC transfer (RAM), but both with zero waitstates, now everything is running from the same BUSCON. But it's still external memory so I don't see why extra waitstates should be inserted or something...
Maybe it's possible to do a manual memcopy instead of a PEC transfer, to get rid of any inserted waitstates. But that would defeat the whole purpose of a PEC transfer and I don't see why that would work.
Your only change was the address map and now you have a delay? As you described everything must go through the external bus (with the same access timing) so I don't see any chance for a difference in execution time.
The PEC is nothing more than an injected "MOV" instruction but the injection is triggered by interrupt level. So nothing changed here?
Some experiments seem to indicate that it has to do with the PEC transfers. Not sure why. When I disable the PEC transfer from the display, I win (back) 5ms...
Is this something you can share?
Regards, Chris