readme.md (9706B)
1 # Debug version matrix.c 2 3 This matrix.c is 0.13.19:quantum/matrix.c with the following additions: 4 5 * Added the MATRIX_DEBUG_SCAN_{START/END} macro to measure the execution time of matrix_scan(). 6 * Added the MATRIX_DEBUG_DELAY_{START/END} macro to measure delay time. 7 * Added the MATRIX_MUL_SELECT handling for symmetric70_proto. 8 9 ## Current performance 10 11 | MCU | delay type | execution time <br> of <br> `matrix_scan()` | matrix scan rate | 12 |-------------------|---------------|------------|----------------| 13 | Pro Micro (16MHz) | default | 503us | 1810 scans/sec | 14 | Pro Micro (16MHz) | adaptive | 383us | 2320 scans/sec | 15 | Pro Micro (16MHz) | fast adaptive | 382us | 2330 scans/sec | 16 | Proton C (72MHz) | default | 210us | 4350 scans/sec | 17 | Proton C (72MHz) | adaptive | 76.4us | 10600 scans/sec | 18 | Proton C (72MHz) | fast adaptive | 75.6us | 10800 scans/sec | 19 20 ## Compile 21 22 * Set MATRIX_IO_DELAY value 23 * `make MTEST=mdelay0 handwired/symmetric70_proto/promicro/normal:default:flash` 24 * `make MTEST=mdelay=1 handwired/symmetric70_proto/promicro/normal:default:flash` 25 * `make MTEST=mdelay=2 handwired/symmetric70_proto/promicro/normal:default:flash` 26 * `make MTEST=mdelay=3 handwired/symmetric70_proto/promicro/normal:default:flash` 27 * `make MTEST=mdelay=4 handwired/symmetric70_proto/promicro/normal:default:flash` 28 * `make MTEST=mdelay=5 handwired/symmetric70_proto/promicro/normal:default:flash` 29 * `make MTEST=mdelay=10 handwired/symmetric70_proto/promicro/normal:default:flash` 30 * `make MTEST=mdelay=20 handwired/symmetric70_proto/promicro/normal:default:flash` 31 * `make MTEST=mdelay=30 handwired/symmetric70_proto/promicro/normal:default:flash` 32 * Measure the execution time of matrix_scan() 33 * `make MTEST=matrix_debug_scan[,<other options>..] handwired/symmetric70_proto/promicro/normal:default:flash` 34 * Measure delay time. 35 * `make MTEST=matrix_debug_delay[,<other options>..] handwired/symmetric70_proto/promicro/normal:default:flash` 36 * Change the behavior of delay 37 * `make MTEST=matrix_debug_delay,always_delay handwired/symmetric70_proto/promicro/normal:default:flash` 38 * `make MTEST=matrix_debug_delay,adaptive_delay,mdelay0 handwired/symmetric70_proto/promicro/normal:default:flash` 39 * `make MTEST=matrix_debug_delay,adaptive_delay_fast,mdelay0 handwired/symmetric70_proto/promicro/normal:default:flash` 40 41 ## Measurement result 42 ### Pro Micro (ATmega32u4 16Mhz) 43 #### Default setting (show `matrix_scan()` time) 44 - `make MTEST=matrix_debug_scan handwired/symmetric70_proto/promicro/normal:default:flash` 45 - CH1: Row 0 46 - CH2: Row 1 47 - CH3: Row 4 48 - CH4: matrix_scan() 49 - Execution time of matrix_scan() 503us 50 - Frequency of matrix scan 1.81kHz (551.0us) 51  52 53 #### Always call `matrix_output_unselect_delay()` (show `matrix_scan()` time, default MATRIX_IO_DELAY) 54 - `make MTEST=matrix_debug_scan,always_delay handwired/symmetric70_proto/promicro/normal:default:flash` 55 - CH1: Row 0 56 - CH2: Row 1 57 - CH3: Row 4 58 - CH4: matrix_scan() 59 - Execution time of matrix_scan() 521us 60 - Frequency of matrix scan 1.76kHz (568.5us) 61  62 63 #### Adaptive delay (show `matrix_scan()` time, MATRIX_IO_DELAY = 0) 64 - `make MTEST=matrix_debug_scan,mdelay0,adaptive_delay handwired/symmetric70_proto/promicro/normal:default:flash` 65 - CH1: Row 0 66 - CH2: Row 1 67 - CH3: Row 4 68 - CH4: matrix_scan() 69 - Execution time of matrix_scan() 383us 70 - Frequency of matrix scan 2.32kHz (431us) 71  72 73 #### Adaptive delay (show delay time, MATRIX_IO_DELAY = 0) 74 - `make MTEST=matrix_debug_delay,mdelay0,adaptive_delay handwired/symmetric70_proto/promicro/normal:default:flash` 75 76 ##### Press R0C1, R1C1 key 77 - CH1: Row 0 78 - CH2: Row 1 79 - CH3: Row 4 80 - CH4: delay time 81 - Delay time 68us 82 - Frequency of matrix scan 1.77kHz (565us) 83  84 85 #### Fast adaptive delay (show `matrix_scan()` time, MATRIX_IO_DELAY = 0) 86 - `make MTEST=matrix_debug_scan,mdelay0,adaptive_delay_fast handwired/symmetric70_proto/promicro/normal:default:flash` 87 - CH1: Row 0 88 - CH2: Row 1 89 - CH3: Row 4 90 - CH4: matrix_scan() 91 - Execution time of matrix_scan() 382us 92 - Frequency of matrix scan 2.33kHz (428us) 93  94 95 #### Fast adaptive delay (show delay time, MATRIX_IO_DELAY = 0) 96 - `make MTEST=matrix_debug_delay,mdelay0,adaptive_delay_fast handwired/symmetric70_proto/promicro/normal:default:flash` 97 98 ##### Press R0C1, R1C1 key 99 - CH1: Row 0 100 - CH2: Row 1 101 - CH3: Row 4 102 - CH4: delay time 103 - Delay time 11us 104 - Frequency of matrix scan 2.21kHz (452us) 105  106 107 ### Proton C (STM32F303 72MHz) 108 #### Default setting (show `matrix_scan()` time) 109 - `make MTEST=matrix_debug_scan handwired/symmetric70_proto/proton_c/normal:default:flash` 110 - CH1: Row 0 111 - CH2: Row 1 112 - CH3: Row 4 113 - CH4: matrix_scan() 114 - Execution time of matrix_scan() 210us 115 - Frequency of matrix scan 4.35kHz (230.0us) 116  117 118 #### Always call `matrix_output_unselect_delay()` (show `matrix_scan()` time, default MATRIX_IO_DELAY) 119 - `make MTEST=matrix_debug_scan,always_delay handwired/symmetric70_proto/proton_c/normal:default:flash` 120 - CH1: Row 0 121 - CH2: Row 1 122 - CH3: Row 4 123 - CH4: matrix_scan() 124 - Execution time of matrix_scan() 242us 125 - Frequency of matrix scan 3.85kHz (260.0us) 126  127 128 #### Adaptive delay (show `matrix_scan()` time, MATRIX_IO_DELAY = 0) 129 - `make MTEST=matrix_debug_scan,mdelay0,adaptive_delay handwired/symmetric70_proto/proton_c/normal:default:flash` 130 - CH1: Row 0 131 - CH2: Row 1 132 - CH3: Row 4 133 - CH4: matrix_scan() 134 - Execution time of matrix_scan() 76.4us 135 - Frequency of matrix scan 10.6kHz (94.4us) 136  137 138 #### Adaptive delay (show delay time, MATRIX_IO_DELAY = 0) 139 - `make MTEST=matrix_debug_delay,mdelay0,adaptive_delay handwired/symmetric70_proto/proton_c/normal:default:flash` 140 141 ##### Press R0C1, R1C1 key 142 - CH1: Row 0 143 - CH2: Row 1 144 - CH3: Row 4 145 - CH4: delay time 146 - Delay time 7.6us 147 - Frequency of matrix scan 9.47kHz (105.6us) 148  149 150 ##### Connect a 500pF capacitor between C2 line and GND, Press R0C2, R1C2, R2C2, R3C2, R4C2 keys 151 - CH1: Row 0 152 - CH2: Row 1 153 - CH3: Col 2 154 - CH4: delay time 155 - Delay time 12us + alpha 156 - Frequency of matrix scan 5.45kHz (183us) 157 - Threshold Voltage 1.9V 158  159 160 ##### Connect a 1000pF capacitor between C2 line and GND, Press R0C2, R1C2, R2C2, R3C2, R4C2 keys 161 - CH1: Row 0 162 - CH2: Row 1 163 - CH3: Col 2 164 - CH4: delay time 165 - Delay time 20us + alpha 166 - Frequency of matrix scan 4.48kHz (223us) 167 - Threshold Voltage 1.9V 168  169 170 #### Fast adaptive delay (show `matrix_scan()` time, MATRIX_IO_DELAY = 0) 171 - `make MTEST=matrix_debug_scan,mdelay0,adaptive_delay_fast handwired/symmetric70_proto/proton_c/normal:default:flash` 172 - CH1: Row 0 173 - CH2: Row 1 174 - CH3: Row 4 175 - CH4: matrix_scan() 176 - Execution time of matrix_scan() 75.6us 177 - Frequency of matrix scan 10.8kHz (92.2us) 178  179 180 #### Fast adaptive delay (show delay time, MATRIX_IO_DELAY = 0) 181 - `make MTEST=matrix_debug_delay,mdelay0,adaptive_delay_fast handwired/symmetric70_proto/proton_c/normal:default:flash` 182 183 ##### Press R0C1, R1C1 key 184 - CH1: Row 0 185 - CH2: Row 1 186 - CH3: Row 4 187 - CH4: delay time 188 - Delay time 1.6us 189 - Frequency of matrix scan 10.6kHz (94.4us) 190  191  192 193 ##### Connect a 500pF capacitor between C2 line and GND, Press R0C2, R1C2, R2C2, R3C2, R4C2 keys 194 - CH1: Row 0 195 - CH2: Row 1 196 - CH3: Col 2 197 - CH4: delay time 198 - Delay time 13.2us 199 - Frequency of matrix scan 6.58kHz (152.6us) 200 - Threshold Voltage 1.9V 201  202 203 ##### Connect a 1000pF capacitor between C2 line and GND, Press R0C2, R1C2, R2C2, R3C2, R4C2 keys 204 - CH1: Row 0 205 - CH2: Row 1 206 - CH3: Col 2 207 - CH4: delay time 208 - Delay time 20us 209 - Frequency of matrix scan 5.30kHz (188.8us) 210 - Threshold Voltage 1.9V 211 