background image

DualMCU

 ESP32

SKU: UE0002

3) Head to the menu and select: File -> Save and choose “Raspberry Pi Pico”

4) Save the script with the name: “HelloWorld.py”

29

Unit Electronics ® DualMCU ESP32

Modified: 26/06/2023

Summary of Contents for DualMCU

Page 1: ...communicate via serial protocol by simply activating a 2 way DIP SWITCH for example we can program the ESP32 as a wireless co processor to provide the RP2040 microcontroller with WIFI or BLUETOOTH communication For programming there is a mechanical selector that allows us to select which MCU connects using a single USB type C connector Interconnect a large number of I2C devices using its STEMMA QW...

Page 2: ...l for applications that require a portable and rechargeable wireless system Battery charging is done through its USB Type C connector or through an external source such as a solar cell connected by its dedicated VIN pin for external power sources Applications Internet of Things IoT prototyping machine learning evaluation development Support DualMCU is supported in the Arduino development environme...

Page 3: ...am erase cycles More than 20 year data retention Espressif ESP32 WROOM 32 Wi Fi Bluetooth Module 240MHz 32bit Dual Core Xtensa LX6 520kB on chip SRAM 448 Kbyte ROM for booting and core functions 8 MB Integrated SPI flash 1 kbit EFUSE non erasable memory for MAC addresses module configuration Flash Encryption and Chip ID IEEE 802 11b g n 802 11n up to 150 Mbps single band 2 4 GHz Wi Fi operation ce...

Page 4: ...evices with no soldering All 26 digital pins of RP2040 can be driven by the PWM block with a maximum of 16 controllable PWM outputs All ESP32 pins digital outputs can be used as PWM pins GPIOs 36 and 39 can t generate PWM 3 x Capacitive Touch Sensor from ESP32 microcontroller ESP32 CAN 2 0 Power 3 3 v LDO 600 mA 3 3V Power enable pin VUSB Output VIN 3 2 6 V Pin Built in 200mA lipoly charger with c...

Page 5: ... for UART Communication 3 13 Power Tree 4 Connector Pinouts 4 1 J1 USB C 4 2 JP1 4 3 JP2 4 4 RP2040 SWD JP3 4 5 RP2040 I2C JST1 4 6 ESP32 I2C JST2 4 7 JST3 Battery Connector 5 Board Operation 5 1 Getting Started with Micropython Thonny IDE 5 2 Installing the micropython interpreter on the RP2040 5 3 Examples Micropython 5 4 Micropython hello world on the RP2040 5 5 Getting Started Arduino IDE 5 6 ...

Page 6: ...25 V V3v3 3 3V output to user application 3 25 3 3 3 35 V I3v3 3v3 output current including onboard IC 600 mA VIH RP2040 Input high level voltage 2 3 6 V VIL RP2040 Input low level voltage 0 3 0 8 V IOH Max RP2040 Current at VDD 0 4v output set high 8 mA IOL Max RP2040 Current at VSS 0 4v output set low 8 mA VOH RP2040 Output high voltage 8 mA 2 62 3 3 v VOL RP2040 Output low voltage 8 mA 0 0 5 V ...

Page 7: ...495 V output set low 28 mA VOH ESP32 Output high voltage 2 64 3 3 V VOL ESP32 Output low voltage 0 33 V RPU ESP32 Pull Up Resistance 45 kΩ RPD ESP32 Pull Down Resistance 45 kΩ TOP ESP32 Operating temperature 40 85 C Sum of all current being sourced by GPIO and QSPI pins Sum of all current being sunk into GPIO and QSPI pins Per pin current sourced in the same domain is gradually reduced from around...

Page 8: ...es for low power Internet of Things IoT development and whatever your microcontroller application from motor control to machine learning from digital audio to automotive the DualMCU RP2040 ESP32 has the performance feature set and support to make your product fly 3 1 Block Diagram Block Diagram of DualMCU RP2040 ESP32 8 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 9: ...ash IC U6 AP2112K 3v3 LDO Voltage Regulator L1 Power On LED L2 Charge LED L3 Builtin LED L4 WS2812B LED L5 RGB 2020 LED J1 Male USB Type C Connector PB1 RP2040 Reset Button PB2 RP2040 Boot Button PB3 ESP32 Flash Button PB4 ESP32 Reset Button JP1 RP2040 GPIO Header JP2 ESP32 GPIO Header JP3 RP2040 SWD Debug Header JST1 RP2040 I2C JST Connector JST2 ESP32 I2C JST Conector JST3 JST Connector for LiPo...

Page 10: ... disconnected SB6 SDA Signal Selector Solder Bridge for ATECC608A MAHDA T disconnected B1 Lipo Battery Solder Pads 3 3 Processor The DualMCU is powered by a revolution of the Raspberry Pi RP2040 silicon microcontroller U1 manufactured on a modern 40nm process node is the debut microcontroller from Raspberry Pi and it brings signature values of high performance and ease of use to the microcontrolle...

Page 11: ... are exposed via JP2 y JP1 pin headers The ESP32 module includes a dual core Xtensa LX6 CPU that can also be programmed independently of the RP2040 through the USB mechanical selector SW2 via a CH340C USB bus convert IC U4 3 5 External Memory The RP2040 U1 has access to an external 2 MB of flash memory U3 via a QSPI interface All the application code and data must be stored in an external flash ch...

Page 12: ...microSD card becomes very handy for applications where we need to store files that are larger than the size of SPIFF flash file system of ESP32 3 10 Power Switch The toggle power switch SW1 provides the utility to turn the DualMCU ON or OFF and allows battery charging even when the power switch is in the off position 3 11 Mechanical selector for the USB Communication The mechanical USB selector SW...

Page 13: ... either the USB C port J1 or alternatively via VIN on JP1 The VIN pin also delivers the USB voltage from J1 approx 4 8 V when the external power supply on the VIN does not exist An AP2112K LDO Voltage Regulator provides 3V3 to the RP2040 and ESP32 microcontrollers and all other peripherals The maximum voltage supply for VIN is 6 V and the nominal current of AP2112K is 600 mA DualMCU RP2040 ESP32 P...

Page 14: ...040 ESP32 General Pinout 4 1 J1 USB C Pin Function Type Description 2 11 VBUS Power 5V USB Power A7 B7 D Differential USB differential data A6 A6 D Differential USB differential data 1 12 GND Power Ground 14 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 15: ...e Description 1 3v3 Power 3 3V Power 2 3v3 Power 3 3V Power 3 VN Analog ESP32 Sense Vp ADC1 CH3 RTC_GPIO3 GPIO39 4 VP Analog ESP32 Sense Vn ADC1 CH0 RTC_GPIO0 GPIO36 5 IO25 Analog RTC Digital ESP32 DAC1 ADC2 CH8 RTC_GPIO6 GPIO25 15 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 16: ...1 Digital RP2040 digital pin GPIO9 UART1_RX_PIN 15 TX0 Digital RP2040 digital pin GPIO0 UART0_TX_PIN 16 RX0 Digital RP2040 digital pin GPIO1 UART0_RX_PIN 17 IO15 Digital RP2040 digital pin GPIO15 18 IO10 Digital RP2040 digital pin GPIO10 19 IO3 Digital RP2040 digital pin GPIO03 SCL_1 20 IO2 Digital RP2040 digital pin GPIO02 SDA_1 21 MOSI Digital RP2040 digital pin GPIO19 SPI 22 SCK Digital RP2040 ...

Page 17: ...igital RP2040 digital pin GPIO25 34 IO6 Digital RP2040 digital pin GPIO06 35 GND Power Ground 36 GND Power Ground 37 RUN RESET Digital RP2040 Reset 38 3EN Digital AP2112K Enable 39 VBAT Power Battery Voltage Output 40 VUSB Power VUSB Output Pin Input Pin Each UART can be connected to a number of GPIO pins as defined in the GPIO muxing table in Section 2 19 2 of RP2040 official datasheet https data...

Page 18: ...2 Pin Function Type Description 1 3v3 Power 3 3V Power 2 RST Digital ESP32 Reset 3 IO2 Analog Digital ESP32 ADC2 CH2 GPIO2 TOUCH T2 RTC_GPIO12 4 IO0 Digital ESP32 DTR GPIO0 5 GND Power Ground 6 GND Power Ground 18 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 19: ...5 TOUCH T0 RTC_GPIO10 11 SCK Digital ESP32 SPI SCK GPIO18 12 CS Digital ESP32 SPI CS GPIO05 13 MOSI Digital ESP32 SPI MOSI GPIO23 14 MISO Digital ESP32 SPI MISO GPIO19 15 SDA Digital ESP32 I2C SDA GPIO21 16 RX0 Digital ESP32 UART0 RXD GPIO1 17 SCL Digital ESP32 I2C SCL GPIO22 18 TX0 Digital ESP32 UART0 TXD GPIO3 19 GND Power Ground 20 GND Power Ground 19 Unit Electronics DualMCU RP2040 ESP32 Modif...

Page 20: ...2040 SWD JP3 Pin Function Type Description 1 3v3 Power 3 3V Power 2 RUN RESET Digital RP2040 Reset 3 SWDIO Digital Serial Wire Debug 4 SWCLK Digital Serial Wire Debug 5 QSPI_SS Digital Bootsel 6 GND Power Ground 20 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 21: ...ery Connectors Pinout 4 5 RP2040 I2C JST1 Pin Function Type Description 1 GND Power Ground 2 3v3 Power 3 3V Power 3 SDA Digital RP2040 digital pin GPIO12 SDA_0 4 SCL Digital RP2040 digital pin GPIO13 SCL_0 21 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 22: ...ound 2 3v3 Power 3 3V Power 3 SDA Digital ESP32 I2C SDA GPIO21 4 SCL Digital ESP32 I2C SCL GPIO22 4 7 JST3 Battery Connector Pin Function Type Description 1 VBAT Power Positive voltage for the optional lipoly battery 2 GND Power Ground 22 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 23: ...SB C cable This also provides power to the board as indicated by the Power On LED 5 1 Getting Started with Micropython Thonny IDE What is Thonny used for Thonny is a free Python Integrated Development Environment IDE that was especially designed with the beginner Pythonista in mind First you need to install the Thonny Environment IDE on your system 23 Unit Electronics DualMCU RP2040 ESP32 Modified...

Page 24: ...terpreter tab select MicroPython Raspberry Pi Pico as the interpreter 2 To download the Micropython firmware on the RP2040 plug the USB C cable into the DualMCU move the mechanical USB selector to the A position see section 3 11 Mechanical selector for the USB Communication and press and hold the RP2040 reset button PB1 you can find it onboard with the label RST DualMCU RP2040 Reset Button 24 Unit...

Page 25: ...utton PB2 labeled BOOT and release the reset button PB1 RST Press and hold the RP2040 Boot and Reset buttons to enter bootloader mode The board should appear as a removable drive called RPI RP2 Removable drive called RPI RP2 25 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 26: ... 3 Go to Thonny IDE and click on Install or Update firmware to start the firmware download from Raspberry Pi Pico The following window should appear 4 Then click on install 26 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 27: ...ll automatically reboot Click to download the Micropython UF2 File 5 3 Examples Micropython The Raspberry Pi foundation makes available the necessary tools documentation and examples to get started with the RP2040 If you haven t already look into the documentation on the Pico We ll use this as a point of reference when using the RP2040 chip into the DualMCU board to fit your needs in this tutorial...

Page 28: ...int Hello World while True led_pin toggle utime sleep 1 2 In the menu select Run Select Interpreter This will open a new window for the Thonny options In the Interpreter tab select MicroPython Raspberry Pi Pico as the interpreter and select the COM port with which your system recognizes the DualMCU for RP2040 please make sure that the USB selector switch is in position A see section 3 11 28 Unit E...

Page 29: ...lMCU RP2040 ESP32 SKU UE0002 3 Head to the menu and select File Save and choose Raspberry Pi Pico 4 Save the script with the name HelloWorld py 29 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 30: ...wing repository https github com UNIT Electronics DualMCU RP2040 ESP32 Micropython Guide 5 5 Getting Started with arduino IDE for ESP32 MCU The Dual MCU could be programmed with the popular Arduino IDE the language used is based on C and C The open source Arduino Software makes it easy to write code and upload it to the board The first thing is to have the Arduino environment installed 1 Open the ...

Page 31: ...menu and select Tools Board Boards Manager and type ESP32 in the blank field select the option esp32 by Espressif Systems and press Install Wait a moment while the package should be installed and press Close 31 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 32: ...3 11 5 6 Hello world on the ESP32 from Arduino IDE 1 In the Tools menu select Board ESP32 Arduino ESP32 Dev Module 2 Connect the Dual MCU to your computer and go to the Tools menu and select the COM port for the DualMCU if you do not see the COM Port in your Arduino IDE you need to install the CH340C Driver 32 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 33: ...al println Hello World This is the ESP32 MCU from DualMCU Blinking a LED digitalWrite LED_G LOW turn the BLUE LED on delay 1000 wait for a second digitalWrite LED_G HIGH turn the BLUE LED off delay 1000 wait for a second 4 Save the sketch as Hello World in the File menu and select Save Then click the upload button or press CTRL U from keyboard to compile and upload the code to the ESP32 MCU 33 Uni...

Page 34: ...P2040 ESP32 SKU UE0002 5 Finally open the arduino serial monitor you will see a message printing every second and the BLUE LED on the DualMCU blinking 34 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 35: ... Press the ESP32 Flash button to start flashing the Arduino sketch Note The RP2040 MCU can also be programmed from Arduino IDE if you want to know how to do it please visit the following repository https github com UNIT Electronics DualMCU RP2040 ESP32 Arduino Programming 35 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 36: ...ress Salvador 19 Cuauhtémoc 06000 Mexico City CDMX 8 Reference Documentation Ref Link UNIT DualMCU Documentation https github com UNIT Electronics DualMCU UNIT DualMCU Examples https github com UNIT Electronics DualMCU tree main Example s UNIT DualMCU RP2040 Arduino Package https github com UNIT Electronics Uelectronics RP2040 Arduin o Package 36 Unit Electronics DualMCU RP2040 ESP32 Modified 26 0...

Page 37: ... Pico RP2040 Documentation https www raspberrypi com documentation microcontrollers Raspberry Pi Pico Python SDK https datasheets raspberrypi com pico raspberry pi pico python sdk pdf raspberrypi pico micro python examples https github com raspberrypi pico micropython examples Raspberry Pi Pico C C SDK https www raspberrypi com documentation microcontrollers c_s dk html raspberrypi pico C C exampl...

Page 38: ...MCU RP2040 ESP32 SKU UE0002 9 Appendix 9 1 Schematic https github com UNIT Electronics DualMCU blob main Hardware UE0002_DualMCUv30_Schematic pdf 38 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 39: ...DualMCU RP2040 ESP32 SKU UE0002 39 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Page 40: ...DualMCU RP2040 ESP32 SKU UE0002 40 Unit Electronics DualMCU RP2040 ESP32 Modified 26 06 2023 ...

Reviews: