>> Van: Tom Handley <
thandley
KILLspamTELEPORT.COM>
>> Aan:
.....PICLISTKILLspam
.....MITVMA.MIT.EDU
>> Onderwerp: Circular Buffer Help
>> Datum: zondag 26 april 1998 21:51
>>
>> I would really like to hear from you software `Gurus' on this...
>
>Oh, Jolly ! Now I can pose as a 'Guru' ;-)
>
>> Given a 32K Byte SRAM circular buffer, a `trigger-event', and a fixed
>> delay count after the event, I would like to know the best method of
>> determining when the event' occurred.
>>
>> One method would subtract the delay count from 32K and use the result
>to
>> clock the SRAM address counter to point to the event.
>
>This method is usable, although you will be referring to the Adress-counter
>as in the next example. It'll take more time though, 16K clock's take some
>amount of time ... And what if you want to have more samples _before_ the
>event than _after_ (say 90% before and 10% after) ...
>
>> Another method is reading the current SRAM address counter and
>> subtracting the delay to get an absolute pointer to the event.
>
>This method is quite fast, because you only have to do a simple 16-bit
>subtraction/addition. And that for any event-delay.
>
>> In any case, You are working with the relative offset from the event.
>> Both methods will provide a pointer to the event using simple math. My
>> question is; do you really need to read the counter address in this
>> application? From a software standpoint, is there any advantage?
>
>No, you don't have to. But it will be quickest. _and_ you will have an
>absulute reference. (Two counters, one in hardware & one in software
>_could_ get out-of-sync ...)
>
>> This has a direct impact on my PIC-based logic analyzer project and I
>> would like to `nail this down' as I can save resources with the first
>method.
>> Thanks,
>>
>> - Tom
>
>Greetz,
> Rudy Wieser
>
>