Skip to content

Commit 0162c73

Browse files
author
martin
committed
incorporate review comments
- README.adoc Clarify that the wavelength of the IR LED should be compatible with the detector used; Correct the number of jumper wires in the BOM. - Wiring diagram Use red wire for +3v3 and black for GND. - Fritzing source file Fix having added the wrong file. - ir_loopback/ir_loopback.c Correct typo in comment. - nec_receive_library/nec_receive.pio Amend comment to clarify that the provided 'init' function sets the state machine clock divider relative to the system clock. Amend comment to clarify that the 'init' function sets up the ISR as described.
1 parent 102c33d commit 0162c73

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

pio/ir_nec/README.adoc

+3-3
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ The tasks of encoding and decoding the data are offloaded to the RP2040 PIO stat
88

99
== Wiring information
1010

11-
Connect GPIO 14 to the positive side ('anode') of an IR LED via a suitable series resistor e.g. 1.5k Ohms, and the negative side ('cathode') to ground.
11+
Connect GPIO 14 to the positive side ('anode') of an IR LED via a suitable series resistor e.g. 1.5k Ohms, and the negative side ('cathode') to ground. The wavelength of the LED is unlikely to be critical so long as it is compatible with your detector.
1212

13-
Connect GPIO 15 to the output of a 3.3v IR detector such as the VS1838b, and wire the power connections of the detector to the 3v3 and ground. The program expects the decoder output to be low (logic '0') when a carrier is detected.
13+
Connect GPIO 15 to the output of a 3.3v IR detector such as the VS1838b, and wire the power connections of the detector to 3v3 and ground. The program expects the decoder output to be low (logic '0') when a carrier is detected.
1414

1515
[[pio_ir_loopback_wiring]]
1616
[pdfwidth=75%]
@@ -53,5 +53,5 @@ nec_carrier_control.pio::: The PIO assembler code to transmit a complete frame.
5353
| Infra-Red LED | 1 | generic part
5454
| 1500 ohm resistor | 1 | generic part
5555
| Infra-Red Detector | 1 | generic part e.g. VS1838b
56-
| M/M Jumper wires | 3 | generic part
56+
| M/M Jumper wires | 5 | generic part
5757
|===

pio/ir_nec/ir_loopback/ir_loopback.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
// Infrared loopback example ('NEC' format)
1414
//
1515
// Need to connect an IR LED to GPIO 14 via a suitable series resistor (e.g. 1.5k)
16-
// and an ective-low IR detector to GPIO 15 (e.g. VS1838b)
16+
// and an active-low IR detector to GPIO 15 (e.g. VS1838b)
1717
//
1818
// Output is sent to stdout
1919

pio/ir_nec/nec_receive_library/nec_receive.pio

+6-4
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,13 @@
1111
;
1212
; The input pin should be connected to an IR detector with an 'active low' output.
1313
;
14-
; This program expects there to be 10 state machine clock ticks per 'normal' 562.5us burst period,
15-
; in order to permit timely detection of start of a burst.
14+
; This program expects there to be 10 state machine clock ticks per 'normal' 562.5us burst period
15+
; in order to permit timely detection of start of a burst. The initailisation function below sets
16+
; the correct divisor to achive this relative to the system clock.
1617
;
17-
; Frames consists of 32 bits sent least-siginificant bit first so the Input Shift Register should be
18-
; configured to shift right and autopush after 32 bits.
18+
; Within the 'NEC' protocol frames consists of 32 bits sent least-siginificant bit first; so the
19+
; Input Shift Register should be configured to shift right and autopush after 32 bits, as in the
20+
; initialisation function below.
1921
;
2022
.define BURST_LOOP_COUNTER 30 ; the detection threshold for a 'frame sync' burst
2123
.define BIT_SAMPLE_DELAY 15 ; how long to wait after the end of the burst before sampling

pio/ir_nec/pio_ir_loopback.fzz

4.6 KB
Binary file not shown.

pio/ir_nec/pio_ir_loopback.png

-32.5 KB
Loading

0 commit comments

Comments
 (0)