-
Update on AP33772 Library
03/13/2024 at 04:56 • 0 commentsOriginally, the PicoPD would require the user to unplug and replug in from the charger after uploading new firmware to request the power profile again. This mundane task can be annoying if you are actively adjusting a small part of the code.
Thanks to Patrick, the AP33772 library can now request PDO profiles after a new firmware upload. Changes has been reflected to AP33772-Cpp Repo.
-
Enhance protection code for AP33772
02/03/2024 at 18:23 • 0 commentsAttention: This feature will not work on PicoPD based on the design of the MOSFET
The new code push for AP33772 now supports the built-in over-temperature protection and over-current protection. The over-temperature protection utilizes the NTC (negative temperature coefficient) component if populated. Remember to switch on the MASK flag to enable these features.
- Fix voltage and PPS voltage request
- Voltage reading
- Current reading
- NTC temperature reading
- Set Over Current Threshold (if sense resistor is available)
- Set Over Temperature Threshold
- Set/clear mask bits
To turn on over-temperature protection
usbpd.setOTPTHR(100); //Turn off output if NTC detect 100C or above usbpd.setMask(OTP_EN); //Enable MASK
PicoPD does not support over-current protection or over-temperature protection due to the design of the output MOSFET. In PicoPD, the MOSFET is controlled by the RP2040, and not the AP33772 IC.
AP33772 IC does not support short-circuit protection. The datasheet does not mention this capability, and also no mention of over-current protection timing. I would not recommend using the AP3372 IC for high precision/high accuracy current-related sensing but as a rough estimate for current reading.
GitHub: AP33772-CPP
-
Enable Serial debugging on PicoPD
01/13/2024 at 21:34 • 0 commentsThere are two ways to enable Serial debugging on PicoPD:
Method 1: Using the provided solder pads at the back
Step 1: Desolder the front "USB Jumper" resistors. They are just 2x 0Ohm resistors that bridge between the RP2040 IC and the USB-C port.
Step 2: Use a USB Type A Plug Breakout Cable, or make your own from any USB cable and connect to the existing pad at the back of PicoPD
Method 2: Use a USB-C Splitter that separates the USB 2.0 signal into another USB-C port. You only need USB 2.0 FullSpeed for the job, but never hurts to get extra speed if needed later. Some existing products:
- USB-C USB-C Power/Data Splitter (USB-HighSpeed)
- USB-C PD Power Splitter (USB-HighSpeed)
You then need a total of 3 USB-C Cables. If you are planning to pull 5A total, ensure your Power and Combined cables are both rated for 5A. The data line can be non-e-mark (3A)
Method 3: Using a UART to USB Converter
Tap on many RP2040 RX and TX lines. These pins can be configured within the setup().
-
Improve 3.3V Rail with V1.2 + AP33772 Lib Completed
11/30/2023 at 06:20 • 0 commentsChanges with V1.2 PicoPD:
- Replace buck TPS62933 with LDO AP2204K-3.3. This will drop the total output current from 3A to 200mA. However, we get a much cleaner and more accurate 3V3 line to 0.5% (DeltaVout/Vout). Our internal ADC will happily accept this stable voltage. Lower dropout voltage means requesting PPS as low as 3.5V before messing up your ADC read scaling. Fortunately, the LDO output will still be stable, just less than 3.3V if the input is below 3.5V. The previous buck converter design will be unstable when the input voltage drops below 4V, causing the system to reset.
- Reduce component count.
Update on AP33772 library:
- Multiple users have tested the library and it seems to be stable.
- The latest release has included setMask and clearMask functions
-
Refine PCB layout with V1.1
09/28/2023 at 06:53 • 0 commentsLearning from the previous design, I have made some changes to the layout while keeping the schematic the same. Here are some main changes:
- Highlight 0-ohm jumper resistor: To use the USB 2.0 header, remove these 2 jumpers.
- Highlight GND ports on the top layer
- Thermal relief for the USB header: Easier to solder and desolder
The next October 25th,2023 batch will be V1.1. You can make your own using the provided Gerber, else you can support me through Tindie PicoPD.
-
AP33772 Library Release
09/03/2023 at 08:59 • 0 commentsI think the library is now at a point where you can use it for most of your applications. As of right now, it feature:
- Fix voltage and PPS voltage request
- Voltage reading
- Current reading
- NTC temperature reading
- Set parameter for NTC
Examples are included to cover most of the use cases that I can think of. Feel free to create an issue or comment here if you have any questions about your specific need.
Still missing the ability to edit Mask which will be updated soon. The library also does not support interrupt mode so there will be no self-feedback from the IC. I look forward to further testing.
Tested with:
- UGREEN 140W - PPS fully delivered <- Recommend
- RavPower 90W - No PPS
- Aergiatech 100W 4 Port - PPS does not work
-
AP33772 Library in progress
09/02/2023 at 00:32 • 0 commentsI have been working on the AP33772 library. As of right now, I have most of the basic functionality satisfied like:
- Set voltage
- Set max current
- Set warning/safety value
- Read voltage
- Read current
With 140W Ugreen GaN charger - PPS
With BaseUS GaN2 Pro - PPS
With RavPower PD Pioneer 90W - Non-PPS
-
Second iteration - 1st batch order
08/30/2023 at 07:31 • 0 commentsThe 2nd iteration covers all the mistakes made in the previous one:
- 5.1k Ohm termination on CC1 and CC2 to GND
- QuadSPI flash
- Crystal oscillator with 50Ohm ESR
- 1K series resistor to limit crystal oscillator drive
- USB trace set to 90Ohm differential impedance
Additional upgrade:
- Breakout USB header to have extra D+/D- and 5V input
- Blocking diode between 5V input and VBUS
- Easier to press buttons
Design challenges
The initial design has USB D+/D- connected only to the USB-C. If using the USB-C only, the user has two options,
- Connect to PC: programming and serial debugging, no USB PD.
- Connect to USB brick: running existing code without the ability to flash or serial debug the code.
All of this can be solved if you have an external flasher and debugger tool like Pico Probe using the SWD pins. Pico Probe works well with PlatformIO to compile and flash C++ code, but for MicroPython code using Throny, check out this method of packing your files into .uf2 and flash using PicoProbe. It is not as easy as just plug in your USB cable and flash it!
What if we add extra header pins for the USB cable and a switch to select where the D+/D- comes from?
The RP2040 has USB 2.0 hardware that is running at full speed. This means the fastest driver rise time is 4ns. FR4 propagation time is 6 inches/ns. We have a signal propagation distance of 24 inches over the 4ns rise time. If we are conservative and take 10% of the critical length, we have 2.4 inches of critical length that we can lose on impedance control. -> We have no problem losing impedance control over one 0 Ohm jumper 0402 resistor and one via.
Now when adding the extra header, if not connected, we have a permanent trace stud on the D+/D- line. This stub can impact the signal by creating a reflection when the signal travels to the end of the stud and bounces back. Following this rule of thumb to calculate the max length of the stud and USB 2.0 Fullspeed @ 12Mbps, we have:
maxStudLength (cm) = 0.75 / BitRate(Gbps) = 0.75 / 0.012(Gbps) = 62cm.
62cm seems to be too long! However, if that is the case, we can have a permanent header sticking out at 1.4cm + (0.5cm for traces) without much of a reflection problem.
-
First iteration - 1st batch order
08/30/2023 at 06:55 • 0 commentsOnce the first batch of the first design arrived. I was quite excited to plug it in and hope the red LED will turn on indicating that there is 5V power going into the buck converter. But nothing lights up. I also wasn't able to flash the board and run blink. A bit of debug shows that I have made some rookie mistakes:
- No 5.1k Ohm termination on CC1 and CC2 to GND
- Order DualSPI flash instead of QuadSPI flash
- SPI flash decoupling capacitor is placed too far away from the IC
- Crystal Oscillator has 80Ohm ESR instead of 50Ohm ESR recommended by Rasberry Foundation
- No series resistor to limit crystal drive
- USB trace is not set to 90Ohm differential impedance
Another Hackaday member also raised the question of how can you debug the board while providing PD power. With the current design, there are only two methods:
- Use a USB-C Splitter to have CC1 and CC2 routed between PicoPD and power brick, and have D+/D- routed between PC and PicoPD
- Use PicoProbe to program via SWD, and just plug the power brick directly into PicoPD
The AP33772 IC also can perform a "hard reset" which will cut off the power to the PicoPD temporarily. If "hard reset" is in the code, the device can stuck at a boot loop. To prevent this, a separate power supply is needed if the sole purpose is debugging.
---> 2nd design iteration is coming