This commit is contained in:
Correl Roush 2023-05-27 14:11:10 -04:00
parent beda72249f
commit 559d839303
4 changed files with 113 additions and 0 deletions

View file

@ -2,6 +2,7 @@
:ID: 2073a538-7846-4c4c-b385-58922d129cf7 :ID: 2073a538-7846-4c4c-b385-58922d129cf7
:END: :END:
#+title: Building electronics projects #+title: Building electronics projects
#+filetags: :project:
* Microcontrollers * Microcontrollers
:PROPERTIES: :PROPERTIES:
@ -19,3 +20,4 @@
** TODO [[id:156e16da-f160-48ad-b0a7-75ff44fdf607][Home Intercom Replacement]] ** TODO [[id:156e16da-f160-48ad-b0a7-75ff44fdf607][Home Intercom Replacement]]
** DONE [[id:6a6cbe09-8a0a-4fa8-96ef-0c28600ca991][Leveraging existing coaxial cable for high-speed networking]] ** DONE [[id:6a6cbe09-8a0a-4fa8-96ef-0c28600ca991][Leveraging existing coaxial cable for high-speed networking]]
** TODO [[id:904db55f-f907-42b0-941e-5d2188f4a3c4][Wiring the house with ethernet]] ** TODO [[id:904db55f-f907-42b0-941e-5d2188f4a3c4][Wiring the house with ethernet]]
** TODO [[id:3c3d0b02-2844-4f23-9389-907f24895bc8][Digital Audio Switch]]

View file

@ -0,0 +1,25 @@
:PROPERTIES:
:ID: 44750563-aa76-450d-8c72-cba9c0e0f6cd
:END:
#+title: MCP413X/415X/423X/425X
7/8-Bit Single/Dual SPI Digital POT with Volatile Memory
* Commands
#+begin_src python
def cmd(address, command, data=0x0):
command_byte = (address << 4 & 0b11110000
| command << 2 & 0b00001100)
if command in (0b00, 0b11):
# Include data byte
return bytearray([command_byte | (0b11 & data >> 8), data & 0xff])
return bytearray([command_byte])
return [format(b, '#010b') for b in cmd(0x01, 0b11, 0x4ff)]
#+end_src
#+RESULTS:
| 0b00011100 | 0b11111111 |
* Resources :ATTACH:
-[[attachment:22060b.pdf][Data Sheet]]

View file

@ -0,0 +1,86 @@
:PROPERTIES:
:ID: 3c3d0b02-2844-4f23-9389-907f24895bc8
:END:
#+title: Digital Audio Switch
* ESP32 Pin Connections :ATTACH:
[[attachment:ESP32-Pinout.png][ESP32-Pinout.png]]
| Connection | Pin | Pin | Connection |
|------------+---------+--------+------------|
| | EN | GPIO23 | SWITCH INH |
| ROT SWITCH | GPIO36* | GPIO22 | I2C SCL |
| | GPIO39* | GPIO1 | |
| ROT A | GPIO34* | GPIO3 | |
| ROT B | GPIO35* | GPIO21 | I2C SDA |
| | GPIO32 | GPIO19 | SWITCH B |
| | GPIO33 | GPIO18 | SWITCH A |
| DAC BCK | GPIO25 | GPIO5 | |
| DAC DIN | GPIO26 | GPIO17 | |
| DAC LRCK | GPIO27 | GPIO16 | |
| SPI CLK | GPIO14 | GPIO4 | |
| SPI MISO | GPIO12 | GPIO2 | |
| SPI MOSI | GPIO13 | GPIO15 | SPI CS |
| | GND | GND | GND |
| | VIN | 3V3 | VCC |
* Components
** Digital Potentiometer
*** Pins
- *SPI*
** OLED Display
*** Pins
- *I2C*
** 2-Channel Switch
*** Pins
- Channel Select A
- Channel Select B
- INH (Mute)
- VCC
- GND
** Digital Analog Converter (PCM5102)
*** Pins
*** Pins
- BCK
- DIN
- LRCK
- VCC
- GND
*** Wiring notes
[[https://raspberrypi.stackexchange.com/a/94951/154943]]
#+begin_quote
On these purple PCBs there are 5 sets of bridging pads.
On the front (component side) there is one pair of pads which may be bridged to tie the SCK (system clock) low. This will force the PCM510x to generate the system clock using its internal PLL. You may bridge these pads to remove the need for an external SCK or connect the SCK pin to ground (0V). The Raspberry Pi does not supply a system clock so this will be required to connect to the Raspberry Pi.
On the back (non-component side) there are 4 sets of 3 pads for the 4 functions:
- FLT :: Filter select : Normal latency (Low) / Low latency (High)
- DEMP :: De-emphasis control for 44.1kHz sampling rate: Off (Low) / On (High)
- XSMT :: Soft mute control(1): Soft mute (Low) / soft un-mute (High)
- FMT :: Audio format selection : I2S (Low) / Left justified (High)
The centre pad is connected to the corresponding pin. Each of these function pads may be bridged with solder either high or low (or the pins connected to +3.3V / 0V). (My board is supplied with 1, 2 & 4 bridged low and 3 bridged high, i.e. normal latency filter, 44.1kHz de-emphasis disabled, soft-mute not asserted, I2S audio format.)
The normal filter is an FIR with good response, delaying the signal by approx. 500us (at 44.1 kHz) which should be fine. The fast filter is an IIR with slightly poorer response and delays the signal approx. 80us. Very few (if any) audio sources have pre-emphasis applied so DEMP should be low. The XSMT pin would allow muting of the output via a GPI (if the solder bridge was removed). Raspberry Pi supports I2S bitstream so FMT should be low.
/Do not connect pins to a supply rail if the solder bridges are applied./
The VIN pin goes to a pair of voltage regulators, one of which provides the 3.3V required by the PCM510x. This also connects to the A3V3 pin. The regulator is low drop so VIN may be fed from 3.3V or 5V.
The input pins SCK, BCK, DIN & LCK are fed through a resistor pack which should allow 5V signals to be connected to the 3.3V PCM510x chip, i.e. the board is 3.3V but 5V tolerant.
/Note: LCK pin is actually LRCK (left right clock)./
The 'L' & 'R' pins are directly connected to the 3.5mm jack. Simultaneous connection to both should be avoided. The 2 'G' pins are connected to ground and are provided for convenience of wiring audio output jacks.
This is a very well designed PCB. It is a shame that this description is not provided elsewhere.
#+end_quote
** Rotary Encoder Switch
*** Pins
- VCC
- GND
- Switch Input
- Rotary 1
- Rotary 2

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB