Skip to content

Commit f04b052

Browse files
Abort frame support
1 parent bd6633b commit f04b052

File tree

2 files changed

+20
-2
lines changed

2 files changed

+20
-2
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ I usually use old or junk parts on my projects to reduce electronic waste and su
3232
- POST code output to USB CDC
3333
- POST code output to the LEDs
3434
- Filter LPC I/0 frame with start, cycle/dir and address
35+
- Abort frame support
3536

3637
### Compilation
3738

src/lpc_bus_sniffer.pio

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
.program lpc_bus_sniffer
22
;.side_set 1 opt ; [DEBUG] side_set <count> (opt) (pindirs)
33

4-
.define NIBBLE_LOOP_COUNT 6
4+
.define NIBBLE_LOOP_COUNT 4
55

66
pull ; Get the filter from TX FIFO to the OSR.
77
mov Y, OSR ; Copy OSR to Y.
@@ -11,7 +11,21 @@ mov ISR, null ; Clean the ISR.
1111
set X, (NIBBLE_LOOP_COUNT - 1) ; Set the value to X register.
1212
wait 0 pin 5 ; Wait until the LFRAME pin goes low.
1313

14-
; Get 6 nibble (START + CY/DR + ADDR[3-0])
14+
; Get START
15+
wait 0 pin 4 ; Wait until the LCLK pin goes low.
16+
in pins, 4 ; Read START.
17+
wait 1 pin 4 ; Wait until the LCLK pin goes high.
18+
19+
; Get CY/DR
20+
wait 0 pin 4 ; Wait until the LCLK pin goes low.
21+
in pins, 4 ; Read CY/DR.
22+
; Check if the LFRAME is still low.
23+
jmp pin continue ; If jmp pin is high, jump to continue.
24+
jmp entry_point; ; Jump to start.
25+
continue:
26+
wait 1 pin 4 ; Wait until the LCLK pin goes high.
27+
28+
; Get 4 nibble (ADDR[3-0])
1529
read_nibble1:
1630
wait 0 pin 4 ; Wait until the LCLK pin goes low.
1731
in pins, 4 ; Read the LAD[0-3] pins.
@@ -89,6 +103,9 @@ void lpc_bus_sniffer_program_init(PIO pio, uint sm, uint offset, uint lpc_bus_pi
89103
// Set 'OUT' base pin. To drive the LED's.
90104
sm_config_set_out_pins(&c, led_pin_base, 8);
91105

106+
// Set 'JMP' pin. To read the LFRAME.
107+
sm_config_set_jmp_pin(&c, lpc_bus_pin_base + 5);
108+
92109
#ifdef SIDE_PIN
93110
// Set 'SIDESET' base pin. It's for debugging.
94111
sm_config_set_sideset_pins(&c, SIDE_PIN);

0 commit comments

Comments
 (0)