Skip to content

Signal Capture for debug

hasu@tmk edited this page Feb 13, 2022 · 28 revisions

This is not useful if you have logic analyzer or oscilloscope. This is used by users without the equipments to see signal of their keyboard.

There is IBMPC converter firmware with Signal Capture enabled.

Capture record

Signal Capture prints signal data in text format on hid_listen like below.

64CF51:23 446D67:61 447A47:60 448713:62 44A9E8:60 44AB5C:61 44AC76:63 44AED4:61 44B163:63 

format on hid_listen:

# Capture record format: <time> ':' <stat>
#     time   6 hex chars; timestamp of event, which counts 1/16 us per tick
#           and is comprised of three bytes:
#               timer xtra(overflow count)
#               timer high
#               timer low
#     stat   2 hex chars;  Pin state

Convert into VCD format

https://en.wikipedia.org/wiki/Value_change_dump

$ python3 capture2vcd.py <capture_file>

or $ cat <capture_data> | python3 capture2vcd.py

You can see converted VCD data with tool like sigrok pulsview or GTKWave.

Internals

Capture record format in AVR memory(0x100-2FF):

// Capture record in iqueue buffer:
//     [0]:Pin
//     [1]:Timer low
//     [2]:Timer high
//     [3]:Timer overflow
Clone this wiki locally