<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0">
<channel>
<title>Technoblogy</title>
<link>http://www.technoblogy.com/show?KVM</link>
<description><![CDATA[Electronics and microcontroller projects]]></description>
<pubDate>Wed, 25 Feb 2026 00:00:00 GMT</pubDate>
<lastBuildDate>Wed, 25 Feb 2026 00:00:00 GMT</lastBuildDate>
<language>en</language>
<image>
<url>http://www.technoblogy.com/pictures/KVM/icon-72.png</url>
<title>Technoblogy</title>
<link>http://www.technoblogy.com/show?KVM</link>
<width>72</width>
<height>72</height>
</image>
<generator>CL-HTTP RSS</generator>
<docs>http://blogs.law.harvard.edu/tech/rss</docs>
<item>
<title>ESP32-P4 Feather Board</title>
<description><![CDATA[<p>This is a Feather-format board based on the new ESP32-P4 high performance processor from Espressif:</p>
<p class="center"><img src="http://www.technoblogy.com/pictures/kvm/p4feather.jpg" alt="P4Feather.jpg" width="560" height="270" /></p>
<p style="text-align: center;"><em>The ESP32-P4 Feather board.</em></p>
<p>The ESP32-P4 is a dual-core RISC-V processor running at up to 400MHz, with 768KB of on-chip SRAM, 32Mbytes of on-chip PSRAM, and up to 32Mbytes of external flash.</p>
<h3>Introduction</h3>
<p>After designing the <a class="auto" href="http://www.technoblogy.com/show?3V6B">AVR128DA32 Feather Board</a>&nbsp;I read about Espressif's new ESP32-P4 processor, a high-performance processor with a RISC-V core, and decided it would be an interesting challenge to design a Feather-format board based on that. Like other recent ESP32-series chips the ESP32-P4 includes an internal native USB interface, so I decided to design the board to support USB via a USB-to-serial chip as well as this native USB.</p>
<h4>The design</h4>
<p>When I started the design I looked at three main sources of information: The ESP32-P4 datasheet <sup id="cite_ref1"><a href="#cite_note1">[1]</a></sup>, the ESP32-P4 Hardware Design Guidelines <sup id="cite_ref2"><a href="#cite_note2">[2]</a></sup>, and the Waveshare ESP32-P4 Nano circuit diagram <sup id="cite_ref3"><a href="#cite_note3">[3]</a></sup>.</p>
<p>I underestimated how much harder this board was going to be compared to the earlier AVR128DA32 Feather Board, and I soon realised that it would only be possible by changing to using 0402 resistors and capacitors, rather than the 0805 ones I was using, and by switching to a four-layer board. I checked on OSH Park and JLCPCB and was relieved that this wouldn't be much more expensive than a two-layer board.</p>
<p>The layers have the following functions:</p>
<table class="new">
<thead>
<tr>
<td><strong>Layer</strong></td>
<td><strong>Function</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td>Top</td>
<td>Components and most signal traces.</td>
</tr>
<tr>
<td>Second</td>
<td>Ground plane.</td>
</tr>
<tr>
<td>Third</td>
<td>Power traces.</td>
</tr>
<tr>
<td>Bottom</td>
<td>More signal traces, where necessary.</td>
</tr>
</tbody>
</table>
<p>For simplicity there are no blind vias, so each via connects between all four layers.</p>
<p>Switching to a four-layer board really made the layout much easier. The ground plane layer makes it unnecessary to think about routing the ground, apart from placing vias to connect through to it. Also, the third layer makes routing the power supply connections much easier.</p>
<h4>The Feather specification</h4>
<p>I've kept to the Adafruit Feather specification&nbsp;<sup id="cite_ref4"><a href="#cite_note4">[4]</a></sup>, but with the following extensions:</p>
<ul>
<li>Two additional pins at the top right corner of the board give access to the D+ and D- pins on the P4 USB interface.</li>
<li>There's an output from the 1.2V supply.</li>
<li>Analogue input GPIO22 is connected to the BAT battery voltage output via a voltage divider, so you can monitor the battery voltage.</li>
<li>There's a&nbsp;<strong>BOOT</strong>&nbsp;button for uploading programs.</li>
</ul>
<h4>Power supplies</h4>
<p>The ESP32-P4 has several power domains. The following table shows which GPIO pins are on each domain:</p>
<table class="new">
<thead>
<tr>
<td><strong>Pins</strong></td>
<td><strong>Power supply</strong></td>
<td><strong>Voltage</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td>GPIO0-GPIO3</td>
<td>VDDPST_1/VBAT</td>
<td>3.3V</td>
</tr>
<tr>
<td>GPIO4-GPIO15</td>
<td>VDDPST_1</td>
<td>3.3V</td>
</tr>
<tr>
<td>GPIO16-GPIO23</td>
<td>VDDPST_2</td>
<td>3.3V</td>
</tr>
<tr>
<td>GPIO24-GPIO38</td>
<td>VDDPST_4</td>
<td>3.3V</td>
</tr>
<tr>
<td>GPIO39-GPIO48</td>
<td>VDDPST_5</td>
<td>1.2V</td>
</tr>
<tr>
<td>GPIO49-GPIO54</td>
<td>VDDPST_6</td>
<td>3.3V</td>
</tr>
</tbody>
</table>
<p>Even though the board doesn't use any of the I/O pins on the 1.2V power domain, it's still needed to power the ESP32-P4 core.</p>
<p>The Espressif design documents recommend the use of a buck converter such as the&nbsp;TLV62569&nbsp;to derive the 3.3V supply from the 5V USB input, but I decided to use simpler APA2112 linear regulators for both the 3.3V and 1.2V supply rails. These are capable of supplying up to 600mA, and so should be adequate for the ESP32-P4, given that I'm not planning to connect power-hungry peripherals. I measured the current consumption of the final board at about 150mA, rising to 200mA when PSRAM was enabled, well within the capability of the regulators.</p>
<h4>Chip identification</h4>
<p>The second character of the four-character manufacturing code indicates the chip revision number <sup id="cite_ref5"><a href="#cite_note5">[5]</a></sup>:</p>
<table border="0">
<tbody>
<tr>
<td><strong>Chip Revision</strong></td>
<td>XAXX</td>
<td>XCXX</td>
<td>XEXX</td>
<td>XFXX</td>
<td>XGXX</td>
</tr>
<tr>
<td><strong>Manufacturing Code</strong></td>
<td>v0.0</td>
<td>v1.0</td>
<td>v1.3</td>
<td>v3.0</td>
<td>v3.1</td>
</tr>
</tbody>
</table>
<p>The chips I bought from AliExpress all have the code FEF0 which indicates v1.3.</p>
<h3>The circuit</h3>
<p>Here's the circuit:</p>
<p class="center"><a href="/pictures/kvm/esp32-p4circuit.gif" target="_blank"><img src="http://www.technoblogy.com/pictures/kvm/esp32-p4circuit.gif" alt="ESP32-P4Circuit.gif" width="720" height="292" /></a></p>
<p style="text-align: center;"><em>Circuit of the ESP32-P4 Feather board.<br /></em><em>Click to open a larger version in a new window.</em></p>
<h4>USB to Serial Converter</h4>
<p>The board uses a Silicon Labs&nbsp;CP2102N QFN24 USB-to-Serial converter chip to interface between the USB D+/D- signals and the ESP32-P4 RXD and TXD pins. You could also use the CP2104 which is pin compatible and functionally identical in this circuit.</p>
<p>The ESP32-P4 also includes a native USB interface, and I've brought this out to two pins labelled D+ and D- at the top right corner of the board, giving you the option to use this instead or as well as the main USB socket for USB connectivity.</p>
<h4>Flash memory</h4>
<p>The flash memory chip can be between 2MB and 32MB. Specify the amount of flash you want to make available, up to the size of your chip, in the <strong>Flash Size</strong> option on the <strong>Boards</strong> menu. You'll also have to set the&nbsp;<strong>Partition Scheme</strong> to an appropriate option.</p>
<p>Here's the parts list (click to expand):</p>
<h4><a onclick="tg('Parts',this,'Parts list')" href="javascript:void(0)">► Parts list</a></h4>
<div id="hParts" style="display: none;">
<table class="new">
<thead>
<tr>
<td><strong>Qty</strong></td>
<td><strong>Item</strong></td>
<td><strong>Value</strong></td>
<td><strong>Size</strong></td>
<td width="144"><strong>Components</strong></td>
<td><strong>Typical parts</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td>2</td>
<td>Ceramic capacitor</td>
<td>22pf</td>
<td>0402</td>
<td>C14, C16</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/81-GRT1555C1H220JA2J" target="_blank">Murata&nbsp;GRT1555C1H220JA02J</a></td>
</tr>
<tr>
<td>15</td>
<td>Ceramic capacitor</td>
<td>0.1&micro;F 25V</td>
<td>0402</td>
<td>C5, C8, C12, C15, C17, C18, C19, C20, C21, C22, C23, C24, C25, C27, C28</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/81-GRM155R71E104KE4D" target="_blank">Murata&nbsp;GRM155R71E104KE14D</a></td>
</tr>
<tr>
<td>4</td>
<td>Ceramic capacitor</td>
<td>1&micro;F 25V</td>
<td>0402</td>
<td>C2, C10, C11, C13</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/81-GRM155R61E105KA2J" target="_blank">Murata&nbsp;GRM155R61E105KA12J</a></td>
</tr>
<tr>
<td>6</td>
<td>Ceramic capacitor</td>
<td>10&micro;F 10V</td>
<td>0402</td>
<td>C1, C3, C6, C7, C9, C26</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/81-GRM155R61A106ME1D" target="_blank">Murata&nbsp;GRM155R61A106ME11D</a>&nbsp;</td>
</tr>
<tr>
<td>1</td>
<td>SMD resistor</td>
<td>100&Omega; 5%</td>
<td>0402</td>
<td>R11</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/603-RC0402JR-07100RL" target="_blank">Yageo&nbsp;RC0402JR-07100RL</a></td>
</tr>
<tr>
<td>2</td>
<td>SMD resistor</td>
<td>1k&Omega; 5%</td>
<td>0402</td>
<td>R2, R5</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/603-RC0402JR-071KL" target="_blank">Yageo&nbsp;RC0402JR-071KL</a></td>
</tr>
<tr>
<td>1</td>
<td>SMD resistor</td>
<td>4.7k&Omega;&nbsp;5%</td>
<td>0402</td>
<td>R3</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/603-RC0402JR-074K7L" target="_blank">Yageo&nbsp;RC0402JR-074K7L</a></td>
</tr>
<tr>
<td>2</td>
<td>SMD resistor</td>
<td>10k&Omega;&nbsp;5%</td>
<td>0402</td>
<td>R1, R8</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/603-RC0402JR-0710KL" target="_blank">Yageo RC0402JR-0710KL</a></td>
</tr>
<tr>
<td>4</td>
<td>SMD resistor</td>
<td>100k&Omega; 5%</td>
<td>0402</td>
<td>R6, R7, R9, R10</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/603-RC0402JR-07100KL" target="_blank">Yageo&nbsp;RC0402JR-07100KL</a></td>
</tr>
<tr>
<td>1</td>
<td>LED</td>
<td>SMD Red</td>
<td>0805</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>1</td>
<td>LED</td>
<td>SMD Orange</td>
<td>0805</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>1</td>
<td>Crystal</td>
<td>40MHz 10pF</td>
<td>3.2 x 2.5mm</td>
<td>&nbsp;</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/581-CX3225FB40F0FZZH" target="_blank">40MHz crystal</a></td>
</tr>
<tr>
<td>1</td>
<td>Schottky Diode</td>
<td>MBR120</td>
<td>SOD-123</td>
<td>&nbsp;</td>
<td><a href="https://uk.farnell.com/on-semiconductor/mbr120vlsft1g/diode-schottky-1a-20v-sod-123fl/dp/1431044" target="_blank">MBR120VLSFT1G</a>&nbsp;or MBR0520</td>
</tr>
<tr>
<td>1</td>
<td>P-MOSFET</td>
<td>DMP2045U</td>
<td>SOD-23</td>
<td>&nbsp;</td>
<td><a href="https://uk.farnell.com/diodes-inc/dmp2045u-7/mosfet-p-ch-20v-4-3a-150deg-c/dp/3405184" target="_blank">DMP2045U-7</a>&nbsp;or&nbsp;DMG3415U</td>
</tr>
<tr>
<td>1</td>
<td>Regulator</td>
<td>AP2112-3.3</td>
<td>SOT-23-5</td>
<td>&nbsp;</td>
<td><a href="https://uk.farnell.com/diodes-inc/ap2112k-3-3trg1/ldo-fixed-3-3v-0-6a-sot-25-85deg/dp/3257429" target="_blank">AP2112K-3.3TRG1</a></td>
</tr>
<tr>
<td>1</td>
<td>Regulator</td>
<td>AP2112-1.2</td>
<td>SOT-23-5</td>
<td>&nbsp;</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/621-AP2112K-1.2TRG1" target="_blank">AP2112K-1.2TRG1</a></td>
</tr>
<tr>
<td>1</td>
<td>LiPo Charger</td>
<td>MCP73831T-2ACI</td>
<td>SOT-23-5</td>
<td>&nbsp;</td>
<td><a href="https://uk.rs-online.com/web/p/battery-management/7386360" target="_blank">Microchip&nbsp;MCP73831T-2ACI</a></td>
</tr>
<tr>
<td>1</td>
<td>USB to Serial Converter</td>
<td>CP2102N</td>
<td>QFN24</td>
<td>&nbsp;</td>
<td><a href="https://uk.farnell.com/silicon-labs/cp2102n-a02-gqfn24r/usb-uart-bridge-40-to-85deg-c/dp/3387002" target="_blank">CP2102N-A02-GQFN24R</a></td>
</tr>
<tr>
<td>1</td>
<td>Flash</td>
<td>W25Q128JVS</td>
<td>SOIC-8</td>
<td>&nbsp;</td>
<td><a href="https://www.mouser.co.uk/ProductDetail/454-W25Q128JVSIM" target="_blank">W25Q128JVS</a></td>
</tr>
<tr>
<td>2</td>
<td>Push button</td>
<td>Momentary</td>
<td>4.6 x 2.8mm</td>
<td>&nbsp;</td>
<td><a href="https://uk.farnell.com/c-k-components/kmr211g-lfs/switch-spst-0-05a-32vdc-smd/dp/1437635" target="_blank">C&amp;K Components KMR211G</a></td>
</tr>
<tr>
<td>1</td>
<td>USB Micro Socket</td>
<td>Micro USB Type B</td>
<td>5 pin</td>
<td>&nbsp;</td>
<td><a href="https://uk.farnell.com/amphenol-icc-fci/10118193-0001lf/micro-usb-2-0-type-b-rcpt-smt/dp/2751675" target="_blank">10118193-0001LF</a></td>
</tr>
<tr>
<td>1</td>
<td>LiPo Socket</td>
<td>S2B-PH-SM4-TB</td>
<td>MicroSD</td>
<td>&nbsp;</td>
<td><a href="https://uk.farnell.com/jst-japan-solderless-terminals/s2b-ph-sm4-tb-lf-sn/connector-header-smt-r-a-2mm-2way/dp/9492615" target="_blank">S2B-PH-SM4-TB(LF)(SN)</a></td>
</tr>
<tr>
<td>1</td>
<td>Microcontroller</td>
<td>ESP32-P4</td>
<td>QFN104</td>
<td>&nbsp;</td>
<td><a href="https://www.aliexpress.com/item/1005009092159047.html" target="_blank">ESP32-P4NRW32</a></td>
</tr>
<tr>
<td>1</td>
<td>PCB</td>
<td>Four-layer&nbsp;</td>
<td>50.8 x 22.9mm</td>
<td>&nbsp;</td>
<td>See <a href="#resources">Resources</a> below</td>
</tr>
</tbody>
</table>
</div>
<h3>Construction</h3>
<p>I created a four-layer PCB in Eagle, and ordered a set of PCBs from JLCPCB. I used these to build three complete prototypes, two of which are shown in the photographs.</p>
<p>All the components are mounted on the top of the board, and there are expanded pin legends on the underside:</p>
<p class="center"><img src="http://www.technoblogy.com/pictures/kvm/p4featherback.jpg" alt="P4FeatherBack.jpg" width="560" height="270" /></p>
<p style="text-align: center;"><em>The underside of the P4 Feather board.</em></p>
<p>All the resistors and capacitors are 0402 size, and the processor chip is a 104-pin QFN package, so the board is quite tricky to solder by hand. I used a Miniware MHP50-B5 50x50mm hotplate <sup id="cite_ref6"><a href="#cite_note6">[6]</a></sup>&nbsp;<sup id="cite_ref7"><a href="#cite_note7">[7]</a></sup>&nbsp;at 235&deg;C with&nbsp;Chip Quik SMD291AX10T3 solder paste; the board neatly&nbsp;fits diagonally on the plate.</p>
<p>For the ESP32-P4 and CP2102N chips I used a pin to make a thin worm of solder paste along the rows of pads. Time spent getting the line of solder paste thin and even saves time later sorting out solder bridges. I also put some dots of solder paste on the centre pad of each chip. I then dropped the chips in place with a pair of Rhino SW-11 tweezers <sup id="cite_ref8"><a href="#cite_note8">[8]</a></sup>, if necessary giving them a few taps to position them.</p>
<p>After mounting the ESP32-P4 and CP2102N chips I inspected the pins carefully for any solder bridges. One way of removing them is with a fine-tipped soldering iron and desoldering braid, but I dislike that method because it tends to scratch the PCB. My preferred method is prepare a length of stranded connecting wire, with a few millimetres at the end stripped and dipped in flux. I then heat up the area around the solder bridges with a hot air gun, and when the solder melts apply the end of the wire to soak up the excess solder.&nbsp;</p>
<p>For the 0402 components I put a blob of solder paste on each of the pads, and then positioned the component with the tweezers. I recommend soldering the components into place in batches; otherwise if you try to place too many at once it's easy to accidentally knock the earlier ones out of position.</p>
<p>Finally, I recommend running solder through the holes in the square pads on the underside of the USB connector to firmly anchor its mounting lugs.</p>
<h3>Testing the board</h3>
<p>Here's my recommended sequence for initially testing the board:</p>
<ul>
<li>Apply +5V between <strong>USB</strong> and <strong>GND</strong> while monitoring the current consumption; it should be about 105&nbsp;mA. Anything much above this indicates a possible short, so disconnect quickly and check for shorts between tracks on the board.</li>
<li>Apply +5V between <strong>USB</strong> and <strong>GND</strong> again, and check for +3.3V between the <strong>3V3</strong> pin&nbsp;and&nbsp;<strong>GND</strong>, and 1.2V between the <strong>1V2</strong> pin and <strong>GND</strong>.</li>
<li>Connect the board to a computer check in the Arduino IDE that there's a Serial port on the <strong>Port</strong> submenu on the <strong>Tools</strong> menu. If no port appears it probably indicates a problem with the D+ or D- connections between the USB socket and the CP2102N chip.</li>
<li>Open the Arduino IDE Serial Monitor set to 115200 baud and press the <strong>RESET</strong> button on the ESP32-P4 Feather.</li>
</ul>
<p style="padding-left: 18px;">You should see the following prompt from the ESP32-P4:</p>
<pre style="padding-left: 18px;">ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x1 (POWERON),boot:0xa (SPI_FAST_FLASH_BOOT)
SPI mode:DIO, clock div:1</pre>
<p style="padding-left: 18px;">followed by some addresses. This indicates that the ESP32-P4 is attempting to boot from flash, the default boot method which would run a program that you have uploaded.</p>
<p>The next step is to try uploading an example program, such as <strong>BlinkSOS</strong>, as described in the following section.</p>
<p>Note that it's normal for the orange&nbsp;<strong>CHG</strong>&nbsp;LED to flicker when no battery is connected.</p>
<h3>Running a program</h3>
<p>Here's a simple C program <strong>BlinkSOS</strong> to test the P4 Feather board. It's a more interesting variation of the standard Arduino Blink example that flashes SOS in morse code on the built-in LED:</p>
<pre>#define LED_BUILTIN 1

void setup() {
  pinMode(LED_BUILTIN, OUTPUT);
}

void loop() {
  uint64_t message = 0b10000000101010001110111011100010101;
  do {
    digitalWrite(LED_BUILTIN, message &amp; 1);
    delay(250);
    message = message &gt;&gt; 1;
  } while (message &gt; 1);
}</pre>
<p>It uses a binary constant to specify the sequence of dots and dashes. For more information about the format and timing of morse code see&nbsp;<a class="auto" href="http://www.technoblogy.com/show?3QEF">AM Morse-Code Transmitter</a>.</p>
<h3>Uploading a program via the USB socket</h3>
<h4>Install the&nbsp;ESP32 Arduino core</h4>
<p style="padding-left: 18px;">If you don't already have the ESP32 Arduino Core installed:</p>
<ul>
<li>Add the following URL to the <strong>Additional Boards Manager URLs</strong> list in the Arduino IDE <strong>Preferences</strong> dialog box:</li>
</ul>
<pre style="margin-left: 18px; font-size: 13px;">https://espressif.github.io/arduino-esp32/package_esp32_index.json</pre>
<ul>
<li>In the Arduino IDE search for the <strong>ESP32 Arduino</strong>&nbsp;core in&nbsp;<strong>Boards Manager</strong> and install it.</li>
</ul>
<p style="margin-left: 18px;">I tested this with core version 3.3.7.</p>
<h4>Set up the Board options</h4>
<ul>
<li>Select <strong>ESP32 Arduino&nbsp;</strong>from the <strong>Board</strong> menu, and&nbsp;<strong>ESP32P4 Dev Module</strong>&nbsp;from the submenu.</li>
<li>Set the <strong>Board</strong> options as follows:</li>
</ul>
<p style="padding-left: 18px;"><strong>USB CDC On Boot: "Disabled"</strong><br /><strong>Upload Mode: "UART0 / Hardware CDC"</strong>&nbsp;<br /><strong>Flash Size: "4MB (32Mb)"<br /></strong><strong>Partition Scheme: "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)"<br /></strong><strong>PSRAM</strong>: "<strong>Disabled"</strong></p>
<p style="padding-left: 18px;"><strong></strong>or, if you want to use PSRAM (more workspace but slightly slower):</p>
<p style="padding-left: 18px;"><strong>PSRAM</strong>: "<strong>Enabled"</strong></p>
<p style="padding-left: 18px;">You can leave all the other options at their defaults.</p>
<h4 style="font-size: 14px;">Upload the program</h4>
<ul>
<li>Connect a 10k&Omega; resistor between the GPIO36 (SCK) and 3.3V connections on the board's edge connectors.</li>
<li>Hold down the&nbsp;<strong>BOOT</strong>&nbsp;button, press and release the&nbsp;<strong>RESET</strong>&nbsp;button, then release&nbsp;<strong>BOOT</strong>.</li>
<li>Select the board's USB port from the&nbsp;<strong>Port</strong>&nbsp;menu.</li>
<li>Select&nbsp;<strong>Upload</strong>&nbsp;in the Arduino IDE to upload the program to the board.</li>
<li>Press and release&nbsp;<strong>RESET</strong>.</li>
</ul>
<p>The <strong>BlinkSOS</strong> program should start running, blinking the red LED.</p>
<p>You can remove the 10k&Omega; resistor after uploading.</p>
<h4>Troubleshooting</h4>
<p>If the upload fails with an error such as:</p>
<pre>A fatal error occurred: Failed to connect to ESP32-P4: No serial data received.</pre>
<p>check the following:</p>
<ul>
<li>Open the Arduino IDE Serial Monitor set to 115200 baud, hold down the <strong>BOOT</strong> button, press and release the&nbsp;<strong>RESET</strong>&nbsp;button, and then release <strong>BOOT</strong>.</li>
</ul>
<p style="padding-left: 18px;">You should see a prompt from the ESP32-P4&nbsp;similar to:</p>
<pre style="padding-left: 18px;">ESP-ROM:esp32p4-eco2-20240710
Build:Jul 10 2024
rst:0x1 (POWERON),boot:0x307 (DOWNLOAD(USB/UART0/SPI))
waiting for download</pre>
<p>This confirms that the ESP32-P4 is waiting for data.</p>
<h4>Running at 400MHz</h4>
<p>Although the final ESP32-P4 chips will be certified to run at 400MHz, the currently available chips are limited to 360MHz in ESP-IDF and Arduino core. However, you can run at 400MHz by including the directive:</p>
<pre>#define CONFIG_ESP_DEFAULT_CPU_FREQ_MHZ=400</pre>
<p>I didn't encounter any problems doing this.</p>
<h3>Using the ESP32-P4 Feather board</h3>
<h4>Pins</h4>
<p>The function of each pin on the edge connector is described in the following table:</p>
<table class="new">
<thead>
<tr>
<td><strong>Pin</strong></td>
<td><strong>Description</strong></td>
</tr>
</thead>
<tbody>
<tr>
<td><strong>RST</strong></td>
<td>Reset.</td>
</tr>
<tr>
<td><strong>3.3V</strong></td>
<td>3.3V output from the regulator for powering external circuits; up to 500mA.</td>
</tr>
<tr>
<td><strong>GND</strong></td>
<td>Ground.</td>
</tr>
<tr>
<td><strong>A0-A5</strong></td>
<td>Analogue inputs, or general pins <strong>16</strong> to <strong>21</strong>. The default resolution is 12 bits.</td>
</tr>
<tr>
<td><strong>SCK</strong>, <strong>MOSI</strong>, <strong>MISO</strong></td>
<td>SPI pins, or general pins <strong>36</strong>, <strong>32</strong>, and <strong>33</strong>.</td>
</tr>
<tr>
<td><strong>RX</strong>, <strong>TX</strong></td>
<td>Serial pins, available as <strong>Serial0</strong>, or general pins <strong>38</strong> and <strong>37</strong>.</td>
</tr>
<tr>
<td><strong>GND</strong></td>
<td>Extra <strong>GND</strong> pin.</td>
</tr>
<tr>
<td><strong>SDA</strong>, <strong>SCL</strong></td>
<td>I2C pins, or general pins <strong>7</strong> and <strong>8</strong>.</td>
</tr>
<tr>
<td><strong>24, 25</strong></td>
<td>General pins.</td>
</tr>
<tr>
<td><strong>2 to 6</strong></td>
<td>General pins *.</td>
</tr>
<tr>
<td><strong>USB</strong></td>
<td>5V output from the USB connector. &dagger;</td>
</tr>
<tr>
<td><strong>EN</strong></td>
<td>Take low to disable the regulators.</td>
</tr>
<tr>
<td><strong>BAT</strong></td>
<td>Direct output from the LiPo battery.</td>
</tr>
<tr>
<td><strong>D+, D-</strong></td>
<td>Native CDC USB port.</td>
</tr>
</tbody>
</table>
<p>* The pin legends for these pins are incorrect on the prototype boards shown in the photographs, but have been corrected on the final board files.<br />&dagger; Can also be used to power the board from an external 5V supply, in which case the USB port should be left unconnected.</p>
<h4>Using a LiPo battery</h4>
<p>If you have a LiPo battery connected it will power the board, but if you connect the USB cable the board will be powered by USB and the LiPo battery will be charged. The <strong>CHG</strong> LED will light when the battery is charging.</p>
<p>Check the polarity of your LiPo battery before connecting it; some LiPo batteries use the same connector but with the opposite polarity, which would damage the board.</p>
<p>The maximum recommended charge rate for a LiPo battery is <strong>1C</strong>, which means for a 200mAh battery it should not be more than 200mA. The charge rate on the Feather board is set to 200mA by R4. If you have a larger battery and want a faster charge rate you can change this resistor; see the table on the circuit diagram.</p>
<h4>Checking the battery voltage</h4>
<p>Pin GPIO22 is connected to the battery via a potential divider, setting it at half the battery voltage, so you can check the battery voltage with <strong>analogRead(22)</strong>.</p>
<h3>Graphics demo</h3>
<p>Here's an example showing the ESP32-P4 board running the graphics demo for my&nbsp;<a class="auto" href="http://www.technoblogy.com/show?2LMJ">Compact TFT Graphics Library</a>, which lets you interface to a range of different TFT colour displays using SPI. Here it's using the Adafruit 1.14" 240x135 display <sup id="cite_ref9"><a href="#cite_note9">[9]</a></sup>:</p>
<p class="center"><img src="http://www.technoblogy.com/pictures/kvm/esp32-p4demo.jpg" alt="ESP32-P4Demo.jpg" width="720" height="340" /></p>
<p style="text-align: center;"><em>A demo graphics program running on the ESP32-P4 Feather board.</em></p>
<h3>Using uLisp</h3>
<p>One of my objectives in designing the ESP32-P4 Feather board was to use it as a platform for my Lisp interpreter, uLisp.</p>
<h4>Installing uLisp</h4>
<p>Get the latest release of the ESP version of uLisp from: <a href="/show?1AA0#esp-version">Download and install uLisp</a>.</p>
<p>Then install it as described above for uploading a program.</p>
<p>You should then be able to type or copy and paste Lisp programs into the field at the top of the <strong>Serial Monitor</strong> window, and click the&nbsp;<strong>Send</strong>&nbsp;button or press Return to enter them.</p>
<p>The ESP32-P4 Feather board running at 400MHz runs my <a href="http://www.plasticki.com/show?1EO1#tak" target="_blank">Tak benchmark</a> in 1.5s, compared to 64.6s for an Arduino Uno.</p>
<h4>LED</h4>
<p>The ESP32-P4 Feather board has a red LED connected to pin 1. &nbsp;You can blink it with the following program:</p>
<pre>(defun blink (&amp;optional x)
  (pinmode 1 :output)
  (digitalwrite 1 x)
  (delay 1000)
  (blink (not x)))</pre>
<p>You can flash "SOS" in morse code with the following <strong>blink-sos</strong> program:</p>
<pre>(defun blink-sos ()
  (let ((message #*1010100011101110111000101010000000))
    (pinmode 1 :output)
    (loop
     (dotimes (i (length message))
       (digitalwrite 1 (aref message i))
       (delay 250)))))</pre>
<p>This is similar to the C version above, except that it uses a Lisp bit array to specify the sequence of dots and dashes. Run it by typing:</p>
<pre>(blink-sos)</pre>
<p>Exit from the program by entering ~ followed by return.</p>
<p>You can save the <strong>blink</strong> program to flash memory by typing the command:</p>
<pre>(save-image)</pre>
<p>You can now load it again after a reset by typing:</p>
<pre>(load-image)</pre>
<h4><span style="font-size: 1em;">Analogue inputs</span></h4>
<p>The ESP32-P4 Feather board provides 6 analogue inputs accessible on the edge connector on pins 16 to 21. The default resolution is 12 bits, but you can change it with <strong>analogreadresolution</strong>.</p>
<p>Pin 22 is connected to the battery via a potential divider, setting it at half the battery voltage, so you can check the battery voltage with:</p>
<pre>&gt; (/ (* (analogread 22) 6.6) 4096)
3.33867</pre>
<h4>SPI</h4>
<p>The&nbsp;ESP32-P4 Feather Board&nbsp;has one SPI port on pin numbers 33 (MISO), 32 (MOSI), and 36 (SCK).</p>
<h4>I2C</h4>
<p>The&nbsp;ESP32-P4 Feather Board&nbsp;has one I2C port on pins 7 (SDA) and 8 (SCL).</p>
<p>You can verify that the SPI port is working by connecting an SPI device to SDA, SCL, 3V3, and GND and running the following <strong>scan</strong> program:</p>
<pre>(defun scan () 
  (dotimes (p 127)
    (with-i2c (str p)
      (when str (print p)))))</pre>
<p>To run it type</p>
<pre>(scan)</pre>
<p>It should print out the I2C addresses of the devices on the bus.</p>
<h3>Uploading a program using the native CDC USB</h3>
<p>This is an alternative to using the USB socket and CP2102N to upload a program.</p>
<ul>
<li>Set the <strong>Board</strong> options&nbsp;as follows:</li>
</ul>
<p style="padding-left: 18px;"><strong>USB Mode: "USB-OTG (TinyUSB)"</strong><br /><strong>USB CDC On Boot: "Enabled"</strong><br /><strong>Upload Mode: "USB-OTG CDC (TinyUSB)"&nbsp;</strong><br /><strong>Flash Size: "4MB (32Mb)"</strong><br /><strong>Partition Scheme: "Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)"</strong><br /><strong>PSRAM: "Disabled"</strong></p>
<p style="padding-left: 18px;">or, if you want to use PSRAM (more workspace but slightly slower):</p>
<p style="padding-left: 18px;"><strong>PSRAM: "Enabled"</strong></p>
<p style="padding-left: 18px;">You can leave all the other options at their defaults.</p>
<h4>Upload the program</h4>
<ul>
<li>Connect a USB cable to the board as follows:</li>
</ul>
<p style="padding-left: 18px;">5V to USB, D+ to D+, D- to D-, and GND to GND.</p>
<p style="padding-left: 18px;">I used a USB-A shell <sup id="cite_ref10"><a href="#cite_note10">[10]</a></sup>&nbsp;wired with a four-core ribbon cable.</p>
<ul>
<li>Connect a 10k&Omega; resistor between the GPIO36 (SCK) and 3.3V connections on the board's edge connectors.</li>
<li>Hold down the&nbsp;<strong>BOOT</strong>&nbsp;button, press and release the&nbsp;<strong>RESET</strong>&nbsp;button, then release&nbsp;<strong>BOOT</strong>.</li>
<li>Select the board's USB port from the&nbsp;<strong>Port</strong>&nbsp;menu.</li>
<li>Select&nbsp;<strong>Upload</strong>&nbsp;in the Arduino IDE to upload the program to the board.</li>
</ul>
<p>The program should start running immediately after the upload.</p>
<p>You can remove the 10k&Omega; resistor after uploading.</p>
<h3>Resources</h3>
<p>Get the Eagle or Gerber files for the PCB here:&nbsp;<a href="https://github.com/technoblogy/esp32-p4-feather" target="_blank">https://github.com/technoblogy/esp32-p4-feather</a>.</p>
<p>Or order boards from OSH Park here: <a href="https://oshpark.com/shared_projects/djTl6qP2" target="_blank">ESP32-P4 Feather Board</a>.</p><hr>
<ol>
<li id="cite_note1"><a href="#cite_ref1">^</a> <a href="https://documentation.espressif.com/esp32-p4-chip-revision-v1.3_datasheet_en.pdf" target="_blank">ESP32-P4 Datasheet</a> on espressif.com.</li>
<li id="cite_note2"><a href="#cite_ref2">^</a> <a href="https://docs.espressif.com/projects/esp-hardware-design-guidelines/en/latest/esp32p4/esp-hardware-design-guidelines-en-master-esp32p4.pdf" target="_blank">ESP32-P4 Hardware Design Guidelines</a> on espressif.com.</li>
<li id="cite_note3"><a href="#cite_ref3">^</a> <a href="https://files.waveshare.com/wiki/ESP32-P4-NANO/ESP32-P4-NANO-schematic.pdf" target="_blank">ESP32-P4 Nano Schematic</a> on waveshare.com.</li>
<li id="cite_note4"><a href="#cite_ref4">^</a> <a href="https://learn.adafruit.com/adafruit-feather?view=all" target="_blank">Introducing Adafruit Feather </a>on Adafruit.</li>
<li id="cite_note5"><a href="#cite_ref5">^</a> <a href="https://docs.espressif.com/projects/esp-chip-errata/en/latest/esp32p4/01-chip-identification/index.html" target="_blank">ESP32-P4 Chip Revision Identification</a> on docs.espressif.com.</li>
<li id="cite_note6"><a href="#cite_ref6">^</a> <a href="https://www.adafruit.com/product/5903" target="_blank">MHP50-B5</a> on Adafruit.</li>
<li id="cite_note7"><a href="#cite_ref7">^</a> <a href="https://www.aliexpress.com/item/1005006299730562.html" target="_blank">MHP50-B5</a> on AliExpress.</li>
<li id="cite_note8"><a href="#cite_ref8">^</a> <a href="https://www.adafruit.com/product/3096" target="_blank">Rhino SW-11 Tweezers</a> on Adafruit.</li>
<li id="cite_note9"><a href="#cite_ref9">^</a> <a href="https://www.adafruit.com/product/4383" target="_blank">Adafruit 1.14" 240x135 Color TFT Display</a> on Adafruit.</li>
<li id="cite_note10"><a href="#cite_ref10">^</a> <a href="https://www.adafruit.com/product/1387" target="_blank">USB DIY Connector Shell</a> on Adafruit.</li>
</ol>
]]></description>
<pubDate>Wed, 25 Feb 2026 00:00:00 GMT</pubDate>
<guid isPermaLink="true">http://www.technoblogy.com/show?5AII</guid>
</item>
</channel>
</rss>
