I’m trying to do some profiling of the SPI interface between a 2136x DSP and a host processor (bytes/sec, commands/sec, etc) and am trying to use EMUCLK to limit the ‘recording window' to a certain number of seconds. I just wanted to verify a couple of things:
1) EMUCLK starts at zero and begins incrementing immediately after reset? (It’s active during the boot process, and increments even while idle instructions are executed)
2) It increments at the core-clock rate?
I ask because I’m getting some suspicious results. At the very top of the SPI ISR, where I handle communications with the host, I have this line so that I can subtract the ‘offset’ – i.e. the amount of time that the processor spent booting and setting up, rather than executing normally.
if( gFirstClk == 0) asm("r0=emuclk; dm(_gFirstClk)=r0;"); //update C variable
So, what has me questioning my results is that I’m getting a value of 0x25 for gFirstClk every time? What I do is to power-up the part, and let it run for 10 seconds or so – then I hit connect in the debugger and then halt. (It’s config’d to not do anything upon connection.)