??? 02/16/05 09:48 Read: times Msg Score: +1 +1 Good Answer/Helpful |
#87632 - tweaking II. Responding to: ???'s previous message |
Jan Waclawek said: check the fraction of time wasted waiting for LCD not busy as Erik suggested. Mahmood Elnasser said:
I think this is pointless, because the time delay till the lcd-not-busy signal released is hardware dependent and I have no control over it. This was just to say, if the program spends say 50-70% waiting for the LCD not busy, there is no point in tweaking the program; but if you find that bypassing the wait function (using the trick Erik mentioned) does not speed up the program significantly, you have some space for speeding it up perhaps with rethinking and rewriting some part of it. Jan Waclawek said: Unfortunately this requires a place to store 2x 240 bytes of data - doesn't the LCD have some undisplayed RAM? It would requir only 2creads and 2 writes and a couple of bytes buffering in the XRAM/IRAM. Mahmood Elnasser said:
Unfortunately the LCD ram is too slow to access, remember? It does not really matter here. For the buffer, you need only one write and one read per waveform per step (4 operations for 2 waveforms altogether per step), and to maintain a small buffer of say 16 samples per waveform in the XRAM to take these into account when clearing/displaying a sample, if they are of the same y value (you can avoid having this small buffer performing the read-modify-write as you do now). So per step, you will have 2 reads to recover the old samples from the buffer, 2 writes to write the new samples to buffer, 2 writes to clear the old samples, 2 writes to display the new samples - summa summarum 8 operations per step. Compare to 128 read+writes now. Jan Waclawek said: As an extension to this idea, a wider blank area can be used (but still no full vertical cursor); this is still only 4 writes per step. Mahmood Elnasser said: This is still the same 2 writes to clear old samples per step - you KNOW where your samples are, hence you don't need to write the full column. The only difference is, you don't clear at the oldest sample, but say 4-5 samples further.
I still have to draw a cursor of white spaces at least to wipe out old sample. but at least I can save time by just deleting one complete vertical cursor which makes it look white. Anyhow, reducing the number of LCD accesses wil NOT help, if your program is NOT slow because of waiting for LCD not busy, so you better check this first. Have fun! Jan Waclawek |