Go Down

Topic: Why does my wave form generator using interrupts max out at 3.8KHz. (Read 333 times) previous topic - next topic

econjack

I did cut the array size in half, but it still dies at almost exactly the same frequency. I'll try to move the code inline and see what happens. Thanks!

PeterH

How much memory does one complete waveform require? I don't know how long pgm_read_byte_near() takes but it might be significant at these frequencies. Can you get a general idea of how much time the interrupt handler is using by setting an I/O pin high at the start of the handler and low at the end? The duty cycle on the pin would tell you whether your handler was anywhere near overrunning.

PS if you have performance critical functions that you want to execute inline, you can mark them as inline functions - you don't need to inline them manually.
I only provide help via the forum - please do not contact me for private consultancy.

econjack

Mornin' Peter: I'm away from my system and I don't know how long a read takes from program memory.  I'll investigate that as soon as I can. It may well be that I simply don't have the horsepower to do what I'm trying to do. Thanks...

Robin2


@Robin2: I wasn't the OP where I posted the code,


I'm sure you will understand why I assumed you were. So post your code here to save people having to jump elsewhere to read it.

...R

econjack

@Peter: Each waveform takes 128 bytes, processing it's a fairly long process and therein lies the rub. I think I'll have to live with the cutoff.

Thanks, all, for your help.

Go Up