PCB for Annex32 with D1 Mini module

Annex for ESP32
Post Reply
lyizb
Posts: 9
Joined: Fri Feb 12, 2021 8:23 pm
Has thanked: 8 times
Been thanked: 3 times

PCB for Annex32 with D1 Mini module

Post by lyizb »

This is from the old forum, but it might be gear newcomers to Annex could use.

This youtube video [External Link Removed for Guests] is just a lark.

Version 2 of the PCB (as in the video):
PCB v2 bare.jpg
The schematic is an embarrassment--I couldn't find an Eaglecad footprint for the ESP32 D1 Mini, and I've never successfully created a part in Eagle, so I just used 2 dual-row 20-pin footprints. The schematic is Version 3--I removed the possible DS18B20 pullup on pin 12 (which would prevent booting), and gathered input pins 34, 35, 36, & 39 in one place for easier connection of an ebay 4-pushbutton module.

PCB v3 sch and pcb.jpg:
PCB v3 sch and pcb.jpg
Tested: SD card, ILI9341 tft, touch, serial, serial 2 @ 9600, I2C with an MCP23017, various led outputs, 7 DS18B20s, 4 inputs with 100K pullups, and mono audio output using pin 25.

I was unable to get the PCM5102A I2S DAC to work, either from the PCB or with flying wires directly from the D1 Mini, with 2 different DAC modules. Checked and rechecked the wiring. I had gotten this to work in the past, so I don't know what the problem is.

This is my funky code for the youtube video:

Code: [Local Link Removed for Guests]

I2C.SETUP 21, 22  ' set I2C port on pins 21-sda and 22-scl--esp32
TFT.INIT 1
TFT.FILL 0

    PIN.MODE 12, OUTPUT
    PIN.MODE 17, OUTPUT
    PIN.MODE 33, OUTPUT
    PIN.MODE 2, OUTPUT
    PIN.MODE 16, OUTPUT
    PIN.MODE 5, OUTPUT
    pin(12)=0: pin(17)=0: pin(33)=0
    pin(2)=0: pin(16)=0: pin(5)=0

MCP23017 = &h20  ' assumes A2, A1, A0 to GND
'MCP23017 internal registers
IODIRA = 0: IODIRB = 1: IOCONA = 10: OLATA = 20: OLATB = 21
    i2c.WriteRegByte MCP23017,IODIRA,0 ' set direction to output
    i2c.WriteRegByte MCP23017,IODIRB,0 ' set direction to output
  I2C.WriteRegByte MCP23017,OLATA,0 ' turn all off
  I2C.WriteRegByte MCP23017,OLATB,0 ' turn all off

play.setup 0 ' speaker, pin25, mono
pause 3000
a$="/cherokeeshuffle.mp3"
'a$="/FireballMail.mp3"
  play.volume 80
  PLAY.MP3 a$
    pause 500
    pin(12)=1
    pause 500
    pin(17)=1
    pause 500
    pin(33)=1
    pause 500

'  do
    ntimes=6
    gosub mcp17
    pause 1000
    ntimes=1
'  loop

tft.text.pos 2,5
TFT.FILL TFT.RGB(255,0,0) ' red
tft.text.col TFT.RGB(255,255,255),TFT.RGB(255,0,0)
tft.print " Hello, Annex World"
pause 2000
tft.text.col TFT.RGB(255,255,255),TFT.RGB(0,255,0)
TFT.FILL TFT.RGB(0,255,0) ' green
tft.print " Hello, Annex World"
pause 2000
tft.text.col TFT.RGB(255,255,255),TFT.RGB(0,0,255)
TFT.FILL TFT.RGB(0,0,255) ' blue
tft.print " Hello, Annex World"
pause 2000
TFT.FILL 0
do
  x=rnd(319)
  y=rnd(239)
  c=rnd(65535)
  r=rnd(50)+10
  tft.circle x,y,r,c,c
'  pause 100
  gosub mcp17
  pin(2)=1-pin(2): pin(16)=1-pin(16): pin(5)=1-pin(5)

  if PLAY.ISPLAYING = 0 then
    if a$="/cherokeeshuffle.mp3" then
      a$="/Fire on the Mountain.mp3"
    else
      a$="/cherokeeshuffle.mp3"
    endif
    PLAY.MP3 a$
  endif
loop

mcp17:
  for i = 1 to ntimes 
    i2c.WriteRegByte MCP23017,OLATA,&HAA ' &b10101010
    i2c.WriteRegByte MCP23017,OLATB,&HAA ' &b10101010
    PAUSE     250 
    I2C.WriteRegByte MCP23017,OLATA,&H55 '&b01010101 '  
    I2C.WriteRegByte MCP23017,OLATB,&H55 '&b10101010 '  
    PAUSE     250 
  Next i 
'  I2C.WriteRegByte MCP23017,OLATA,0 ' turn all off
'  I2C.WriteRegByte MCP23017,OLATB,0 ' turn all off
  return
You can send the attached gerber zip file (Version 3) directly to (for instance), JLCPCB.com, and get 5 PCBs for about $8US (slow boat shipping to the U.S.). (Shipping is probably more costly now in March of 2021.)

The Version 3 Eaglecad sch and pcb files are also attached, and can be modified freely (remove the .txt file type).

Thanks so much to cicciocb for creating such a powerful BASIC for the ESP32 (and ESP8266).
You do not have the required permissions to view the files attached to this post.
cicciocb
Site Admin
Posts: 309
Joined: Mon Feb 03, 2020 1:15 pm
Location: Toulouse
Has thanked: 85 times
Been thanked: 197 times
Contact:

Re: PCB for Annex32 with D1 Mini module

Post by cicciocb »

Thank you Lizby,
it will be very interesting for testing and development.
tops10
Posts: 1
Joined: Fri Mar 12, 2021 1:03 am
Has thanked: 4 times

Re: PCB for Annex32 with D1 Mini module

Post by tops10 »

Hi Lizby
You may have the same problem. My PCM5102 dac arrived last week and it didn't work. Consulting my favorite search engine I found none of the pcb solder bridge jumpers where set. I'm impressed with the audio quality, especially at such a low cost.
PCM5102A DAC Jumpers
1. Filter select. H = Low latency, L = Normal latency
2. De-emphasis control for 44.1kHz sampling rate. H = On, L = Off
3. Soft mute control. H = Soft un-mute, L = Soft mute
4. Audio format selection, H = Left justified, L= I2S
You do not have the required permissions to view the files attached to this post.
Post Reply