Git Product home page Git Product logo

zy12pdn-oss's Introduction

Open-Source Firmware for ZY12PDN USB-PD

Open-source firmware for USB Power Delivery trigger board based on an FUSB302B power delivery controller and a STM32F030F4 MCU.

ZY12PDN board

Building and Uploading

The firmware is built using Visual Studio Code and the PlatformIO extension.

To upload it, a SWD capable debug probe like ST-Link, J-Link or Black Magic Probe is connected to the four SWD pads on the back side of the board.

See Build and upload in the wiki for detailed instructions.

ZY12PDN board

Usage Instructions

The user interface – if it can be called so – is similar to the original ZY12PDN. The board can work in one of three modes:

  • Interactive mode: By pressing the button, the board switches between the available fixed voltages.
  • Fixed voltage mode: The board supplies a configured voltage. If the configured voltage is not available, the board will output 5V.
  • Configuration mode: By pressing the button, either the interactive mode or one of the fixed voltage modes is selected.

The LED color indicates either the active voltage (in interactive and fixed voltage modes) or the desired voltage (in configuration mode, with a flashing LED).

Color Interactive Fixed Voltage Configuration
Red 5V Configured voltage is not available † Configure interactive mode.
Yellow 9V 9V Configure fixed voltage mode with 9V.
Green 12V 12V Configure fixed voltage mode with 12V.
Cyan 15V 15V Configure fixed voltage mode with 15V.
Blue 20V 20V Configure fixed voltage mode with 20V.
Purple - Configure fixed voltage mode with highest available voltage.

† The LED will also blink in red if the board has been configured for the highest available voltage and the highest available voltage is neither 9V, 12V, 15V nor 20V.

Configuring the Board

The configuration mode is entered by plugging in the board while pressing the button. The LED will initially flash quickly in cyan until the button is released. Then it continues to flash to indicate the configuration mode.

The mode can be selected by pressing the button until the desired voltage or mode (see table above) has been selected. To save the configuration, the button must be pressed for a longer period until the LED goes off. While in configuration mode, the output voltage remains at 5V.

Notes on Fixed Voltages

Even if a fixed voltage above 5V has been selected and the selected voltage can be provided by the power supply, the supply will initially provide 5V until the target voltage has been successfully negotiated. 5V is also provided at the output of the ZY12PDN board as it is passed through directly. There is no switch (or MOSFET) in between.

If a fixed voltage has been configured and the power supply does not offer it as a fixed voltage but can supply it as part of a PPS (programmable power supply) capability, the PPS capability will used. This feature enables 12V on a number of power supply not offering 12V as a fixed voltage.

Documentation

Additional documentation can be found in the Wiki:

Acknowledgements

Thanks to the people that have also analyzed the ZY12PDN board and contributed to this work:

zy12pdn-oss's People

Contributors

fmckeogh avatar leseratte10 avatar manuelbl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

zy12pdn-oss's Issues

Change voltage via esp?

Hey, is its possible to trigger a specific voltage via an esp8266?
This would be very nice

About those unknown component

Hi, I did some search about those unknown components, and here are the results

The following components are not unique

First time using Github, hope this will be helpful to you.

Question- Getting info for the sorce capabilitys

Hello,

Is it possible to read the information about the source capability and how to send it to UART?

I am working around project to power my old laptop with USB-PD.
My idea is to use part of debug to read info about selected PD profile and mainly how much W can draw from the source. with the second MCU i will simulate DS2505 which is a communication chip inside the charger containing info about power capability of the charger. with this configuration i never harm the PD charger.

I look the debug code, but i cant find any code providing data how much amperes A can provide the charger, i think the voltage can be easily read and send to UART, when V and A are available the W can be calculated and sent to UART

Use as a USB-PD source?

Is it possible to use this hardware as a source and if so what software changes would be needed to support it?

To avoid an XY-problem, I have a solar USB-PD controller that advertises 20V even when the solar cells cannot sustain that. I can't really modify the solar controller, so I'm trying to make an adapter (made of two ZY12PDNs) which only advertises up to 15V then passes through subsequent communication to the solar controller.

Unable to select Voltage on ZY12PDN post upgrading with zy12pdn-oss Master branch

Hi,

I have bought ZY12PDN which was working perfectly, i wanted to add current limit circuit so that Source charger 9Mac 61W) doesn't trip. But after upgrading with this code, ZY12PDN no longer able to select any voltage than 5V. Led color still changes on pressing the button.

On debugging i found that sourceCaps array was empty. Can you please help me with this?

PPS dynamic voltage support

Does this firmware support PPS with dynamic voltages, or can support for that be added?

A Google search for the chip component number (FUSB302BMPX) brought me to another repo that claims PPS would be supported by the chip, at least.

Looking at the source code of this firmware, II found code in pd_sink.cpp that looks like it could be supported:

        } else if (type == pd_supply_type::pps) {
            if ((capability & (3 << 28)) != 0)
                continue;

            max_current = (capability & 0x007f) * 50;
            min_voltage = ((capability >> 8) & 0x00ff) * 100;
            voltage = ((capability >> 17) & 0x00ff) * 100;
        }

but then, down below in the same file, there seems to be code that excludes all PPS modes when requesting voltage:

void pd_sink::request_power(int voltage, int max_current)
{
    // Lookup object position by voltage
    int obj_pos = -1;
    for (int i = 0; i < num_source_caps; i++) {
        auto cap = source_caps + i;
        if (cap->supply_type != pd_supply_type::pps && voltage <= cap->voltage && voltage >= cap->min_voltage) {
            obj_pos = cap->obj_pos;
            if (max_current == 0)
                max_current = source_caps[i].max_current;
        }
    }

    if (obj_pos == -1) {
        DEBUG_LOG("Unsupported voltage requested", 0);
        return; // no match
    }

Is PPS only partially implemented and is not going to work? Or is it supposed to work and I'm mis-reading the code?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.