pico-coder / sigrok-pico

Use a raspberry pi pico (rp2040) as a logic analyzer and oscilloscope with sigrok
727 stars 83 forks source link

Sampling with 1-4 digital channels and 1-3 analog channels causes digital samples to be duplicated #10

Closed pico-coder closed 2 years ago

pico-coder commented 2 years ago

By inspection found a bug in how the DMA data is interpreted and sent to memory. In the send_slices_function there is a second_nibble and related code which supposed to use the upper 4 bits of an 8 bit double sample. But it's broken so we always send the lower value twice. Workarounds: Either: -Use 1-4 channels without any analog which will use the D4 optimized mode. -If analog channels are enabled, use 0 channels or 5 or more digital channels. Fix will be to simplify the storage of sample captures in these modes.

pico-coder commented 2 years ago

In the rev2 release, data parsing for digital only configs greater than 4 channels was rewritten to be clearer but also to be optimized to handle 1B,2B and 4B widths of DMA storage. And along with that this bug was fixed was well.