fossasia / pslab-firmware

Firmware for PSLab Open Hardware Platform https://pslab.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Logic analyzer: DMA puts values in buffer before being triggered

bessman opened this issue · comments

First, some nomenclature:

Trigger condition refers to a logic level change which is used to trigger the logic analyzer to start collecting data. It can be, for example, "rising edge" or "falling edge".

Event condition refers to a logic level change which the logic analyzer collects, nominally after being triggered. It can be, for example, "every edge", "rising edge", "falling edge", or "four rising edges".

Currently, the event condition will be detected even if it occurs before the trigger condition, and the current value of the timer (zero) will be copied to the buffer. This means that the first captured timestamp may be erroneous.

This can happen if, for example the trigger condition is "falling edge" and the event condition is "any edge". If a rising edge occurs before a falling edge, the captured timestamps will begin with two zeros, whereas only one of them should be there.