I'm using a BF514 running at 396MHz and a core Timer to implement a callback that performs some bit-wise processing at the timer's specified rate. I've noticed that the speed in which I can output a pulse using the programmable flag system services is a lot slower than I expected. Timing in my application is somewhat critical and I'm finding that this slowness is limiting how fast I can pump data out as well. I have to be doing something wrong. Maybe callbacks are too slow? I would not think so with the CPU running quite fast.
The loop below can only generate a pulse as short as approximately 290ns when running the CPU core at 396MHz and nothing else happening. I'm using system services to adjust the clock and retrieve once its set to confirm.
The pulse width I'm looking for is more on the order of tens of nanoseconds, say around 50 or 60ns. In my callback I'm using this:
and it too is limited to around that 290ns time. Maybe I need to modify the flag register directly in C for this type of thing? Any suggestions or ideas would help. Thanks.