MICROCHIP USB PD Demo Board User Guide

June 9, 2024
MICROCHIP

MICROCHIP-LOGO

MICROCHIP USB PD Demo Board

MICROCHIP-USB-PD-Demo-Board-PRODUCT

USB PD Demo Board

The USB PD Demo Board is a USB power delivery battery charger demo board featuring the ATSAMD21J18A microcontroller. The board includes a PKoB for USB programming/debugging, along with an Atmel ICE interface.

Board Overview

MICROCHIP-USB-PD-Demo-Board-FIG-1

Two types of expansion headers are supported by the board. There is one Xplained Pro I/O header with a 4-pin Xplained Pro power header, and a mikroBUS click board connector. The battery charger’s SEPIC power supply can support the full 20V/5A 100W USB PD specification. The demo code supports the OLED1 Xplained Pro add-on board on extension header 1. This add-on board is optional but is a useful tool for debugging and charger status monitoring. The OLED1 Xplained Pro board can be purchased separately. The USB PD Demo Board is a USB power delivery battery charger demo board featuring the ATSAMD21J18A microcontroller. The board includes a PKoB for USB programming/debugging, along with an Atmel ICE interface. Two types of expansion headers are supported by the board. There is one Xplained Pro I/O header with a 4-pin Xplained Pro power header, and a mikro-BUS click board connector. The battery charger’s SEPIC power supply can support the full 20V/5A 100W USB PD specification.

MICROCHIP-USB-PD-Demo-Board-FIG-2

Getting Started

  1. Verify the A) 5V Select Header has a jumper on the DBG side and the B) Reset Select has a jumper on the Boot side as shown below:
  2. A ) Jumper on left side
  3. B ) Jumper on bottom
  4. Download and launch MPLAB X IDE.
  5. Plug the debug USB into your computer and check that MPLAB X recognizes that the kit is connected.
  6. If the Power LED does not light up, check that the 5V select header is set to the correct source.
  7. Download the PSF folder from the GitHub site (https://github.com/MicrochipTech/PD_Sink_Battery_Charger_Demo) and unzip the folder.
  8. Open MPLAB X and click File > Open Project, then navigate to where you downloaded the file and go to the folder PSF_EVB_Sink > PSF > Demo > PSF_EVB_Sink > firmware and select the project file; PSF_EVB_Sink.x
  9. Select the programming tool : USB Type-C Demo Board-SN: XXX
  10. Build and program the demo code by pressing the button located on the
  11. Connect the positive side of a 12V battery to the battery terminal marked + and the negative side of the battery to the terminal marked -.
  12. Connect any USB PD capable charger to the USB-C connector to begin charging.

The demo code supports the OLED1 Xplained Pro add-on board on extension header

  1. This add-on board is optional but is a useful tool for debugging and charger status monitoring. The OLED1 Xplained Pro board can be purchased here: OLED1 Xplained Pro Board. Button 3 on the OLED1 board is used to switch between two display pages. On the first page, the battery charger status is shown (either Fault, Pre-condition, CC Mode, CV Mode, or Fully Charged). If a fault has occurred, it will display what type of fault it is. If there is no fault, it will display the battery SOC as a percentage. On page 2, the negotiated PD contract is displayed in terms of negotiated voltage and current.

Note : You may have to press the board reset button after plugging in the OLED1 board if the display does not work initially.

MICROCHIP-USB-PD-Demo-Board-FIG-5

Figures 5 and 6 detail the different state and fault codes that are recognized by the charger state machine and will be displayed on the OLED1 board. A brief description of what each code means is given

Status Type Integer Code Description
FAULT 0 A fault has been detected

PRECONDITIONING

|

1

| Battery voltage is too low for full current

charging

CCMODE

|

2

|

Constant current charge mode

CVMODE

|

3

|

Constant voltage charge mode

CHARGED| 4| Battery is fully charged

RECHARGE

|

5

|

Battery voltage has fallen since being charged

Charger state machine status codes

Fault Type Integer Code Description
GENERIC 0 Unknown fault
NOSOURCE 1 No PD source is attached

UVLO

|

2

|

Battery terminal voltage is too low

OVLO

|

3

|

Battery terminal voltage is too high

OVERTEMP| 4| Battery temperature is too high
UNDERTEMP| 5| Battery temperature is too low

Debug information is output to debug com port for the board. Using a terminal program, Tera Term, set to the correct COM port for the PD EVAL board and 115.2 KBaud, debug information will be printed to the terminal window as shown below.

MICROCHIP-USB-PD-Demo-Board-FIG-6

Debug information shown below of the charging of the battery.

MICROCHIP-USB-PD-Demo-Board-FIG-7

Calibration Procedure

Refer to page 7 of the user guide for calibration procedure details. An optional calibration procedure can be done to improve the accuracy of the charger current sense readings. A multimeter will be required for this process.

Steps to calibrate current readings:

  1. Construct the circuit shown in the diagram below.
  2. In the code file “SEPIC_CTRL.c” change the CALEN variable to 1 and reprogram the board to enable the calibration.MICROCHIP-USB-PD-Demo-Board-FIG-8
  3. Plug a PD power source in to the USB-C connector (not depicted below).
  4. Using the data visualizer in MPLAB X, enter the current (in mA) displayed on the multimeter. Doing this for two different values will enable us to calculate the necessary calibration parameters.
  5. These values are stored in EEPROM and the calibration only needs to be done once. You will have to repeat the calibration if you reprogram the board.MICROCHIP-USB-PD-Demo-Board-FIG-9

Charger Characteristics

Refer to page 8 of the user guide for charger characteristics details. The charger uses a constant current/constant voltage charge algorithm. There are three main states that the charger operates in, pre-condition, constant current charge, and constant voltage charge. The charger will enter pre- condition mode if it detects the battery voltage is too low to safely charge at full current. In this mode, charge current is limited to a few hundred milliamps. Once the charger detects the battery voltage is above the pre- charge cutoff threshold, it will ramp up current to the maximum allowed charge current. This value can be hard-coded by the user or can be set to automatically calculate based on the negotiated PD contract. The charger will continue to charge at constant current until the battery voltage nears its maximum voltage at which point it will enter constant voltage mode. In this mode, the charger checks the battery voltage every 500ms. If the voltage is above the maximum battery voltage, it will decrement current until it is at or slightly below that voltage threshold. This will maintain the battery voltage at a constant level. This process will continue until the charge current is below a specified cutoff current. At this point the charger will shutoff but will continue monitoring the battery and topping off the charge as needed.

MICROCHIP-USB-PD-Demo-Board-FIG-10

The parameters for charger state thresholds can be tuned in the “SEPIC_CTRL.c” file. Several defines are used to establish battery parameters and desired thresholds/cutoffs

MICROCHIP-USB-PD-Demo-Board-FIG-11

Additionally, the preferred charge current can be manually or automatically determined by modifying the code shown below.

MICROCHIP-USB-PD-Demo-Board-FIG-12

Schematics

Schematics and Bill of Materials
Refer to pages 11-17 of the user guide for schematics and bill of materials details.

MICROCHIP-USB-PD-Demo-Board-FIG-13MICROCHIP-
USB-PD-Demo-Board-FIG-14 MICROCHIP-USB-PD-Demo-Board-
FIG-15 MICROCHIP-USB-PD-Demo-Board-FIG-16 MICROCHIP-USB-PD-Demo-Board-FIG-17

PCB Print

MICROCHIP-USB-PD-Demo-Board-FIG-18

Bill of Materials

MICROCHIP-USB-PD-Demo-Board-FIG-19 MICROCHIP-
USB-PD-Demo-Board-FIG-20 MICROCHIP-USB-PD-Demo-Board-
FIG-21

References

Read User Manual Online (PDF format)

Read User Manual Online (PDF format)  >>

Download This Manual (PDF format)

Download this manual  >>

Related Manuals