Skip to content

Added VCC-GND YD-RP2040 boards.#2874

Open
NormanDunbar wants to merge 6 commits intoraspberrypi:developfrom
NormanDunbar:master
Open

Added VCC-GND YD-RP2040 boards.#2874
NormanDunbar wants to merge 6 commits intoraspberrypi:developfrom
NormanDunbar:master

Conversation

@NormanDunbar
Copy link
Copy Markdown

Added three new VCC-GND YD-RP2040 boards to cover the 4M, 8M and 16M flash sizes.

Fixes #2873.

I have added three new board files:

  • vcc_gnd_yd-rp2040_4m.h for the 4M flash variant.

  • vcc_gnd_yd-rp2040_8m.h for the 8M flash variant.

  • vcc_gnd_yd-rp2040_16m.h for the 16M flash variant.

  • There is an RGB LED on GPIO-23.

  • There is a user button on GPIO-24.

  • The 3v3_EN pin on the Pico, is apparently not implemented. Physical pin is GPIO-23.

  • ADC_VREF is not brought out to physical pin 35 unless a link is soldered. Without the link, it's GPIO-29/ADC3.

  • The RGB LED is not usable unless a link is soldered. GPIO-23 is a normal GPIO pin without the link.

  • The chip on these boards appears to be the B2 release of the RP2040. (PICO_RP2040_B2_SUPPORTED is defined.)

These are my first attempts at board definitions, please be gentle!

Thanks.

Added three new VCC-GND YD-RP2040 boards to cover the 4M, 8M and 16M flash sizes.
@lurch lurch self-assigned this Mar 20, 2026
The three board files have been amended to resolve queries raised by the
code reviewer "lurch" on the original pull request.
@NormanDunbar
Copy link
Copy Markdown
Author

NormanDunbar commented Mar 20, 2026

Afternoon Lurch.

I have made the requested changes and pushed them to my repo. See Commit 10333de above for details.

Thanks for your comments, much appreciated.

Cheers,
Norm.

All three files now have the same name for the button attached to
GPIO-24 as this is the only button and the Flash size has no meaning
for the pin name.
@NormanDunbar
Copy link
Copy Markdown
Author

Hi Lurch,

I did a test with that define containing hyphens. You were correct, gcc wasn't happy with it at all! Which is strange as I didn't get any errors in my testing.

I learned something today!

Cheers,
Norm.

I misread the comment on the PR and didn't rename the button
pins as requested. Fixed now. Apologies.
@NormanDunbar
Copy link
Copy Markdown
Author

Oh Hum! Apologies.

I misread your request to rename the button pin and leaft the "0" in the name. Fixed in 4b23e92.

Cheers,
Norm.

// The GPIO Pin used to monitor VSYS. Typically you would use this with ADC.
// There is an example in adc/read_vsys in pico-examples.
#ifndef PICO_VSYS_PIN
#define PICO_VSYS_PIN 29
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The pinout diagram at the bottom of https://makerselectronics.com/product/yd-rp2040-vcc-gnd-studio-microcontroller-board/ shows that GP29 is connected to one of the edge-holes, which makes me suspect that it isn't "used to monitor VSYS"?

Copy link
Copy Markdown
Author

@NormanDunbar NormanDunbar Mar 21, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Morning Lurch.

Yes, it appears from the pinout that GPIO-29 is connected to ADC3 which is the one for VSYS monitoring. So, I ran up the "read_vsys" example on a Pico and it noticed when I switched to battery power. This board always thinks it's on battery (and the voltage & temperature is off too. I'm in the North of Scotland, but it's not that cold!)

Power BATTERY, 9.89V (574%), temp -1479.8 DegC

It's a bit weird this board to be honest.

  • There's no ADC_VREF on the edge connector, there's an extra hole beside the 3v3 Out pin (physical pin 36) and a link marked vref just about the run pin. Shorting the link connects ADC_VREF to the 3v3 Out and, this makes the ADC work!

  • The RGB LED is on GPIO-23 but only if the link above the reset button is shorted otherwise GPIO-23 goes to physical pin 37, which is 3v3_en on the Pico.

  • The three SWD pins are mixed up compared to the Pico and there's a spare 3v3 pin there just to complicate things.

  • I've read also, that in USB Host mode, there's no power to any peripherals!

Anyway, all that aside, and give the test results, I've once again fixed the files. Commit 1701790 is the latest.

Cheers,
Norm.

@lurch
Copy link
Copy Markdown
Contributor

lurch commented Mar 23, 2026

Hi Norm,

(and the voltage & temperature is off too. I'm in the North of Scotland, but it's not that cold!)

Power BATTERY, 9.89V (574%), temp -1479.8 DegC

Was that the result from before you added the link between ADC_VREF and 3v3 Out ?

Shorting the link connects ADC_VREF to the 3v3 Out and, this makes the ADC work!

Yes, the ADC needs a "reference voltage" to compare the sampled-voltage to (and the temperature is also read using the ADC). I've not tested myself, but I suspect that if ADC_VREF is unconnected (i.e. "floating") then you'll get random readings from the ADC.
If you look at section 4.3 of https://pip.raspberrypi.com/documents/RP-008307-DS you can see that the power-circuitry on the official Pico boards can either run in a "noisy" but efficient PFM mode, or a less-noisy but less-efficient PWM mode (and to get more reliable ADC readings, you want to use the less-noisy mode). I suspect that for cost-saving reasons the power-circuitry on the YP-RP2040 boards only runs in the noisy PFM mode, and therefore to enable greater ADC accuracy it offers you the option of connecting a more accurate (less noisy) voltage reference to ADC_VREF.

The RGB LED is on GPIO-23 but only if the link above the reset button is shorted otherwise GPIO-23 goes to physical pin 37, which is 3v3_en on the Pico.

Hmm, if the RGB LED isn't functional unless you add this link, that should probably be mentioned in a comment above your PICO_DEFAULT_WS2812_PIN define?

The three SWD pins are mixed up compared to the Pico and there's a spare 3v3 pin there just to complicate things.
I've read also, that in USB Host mode, there's no power to any peripherals!

Neither of those things affect the board-header file that you're adding here 😉

Did you miss my earlier comment about PICO_VBUS_PIN and VCC_GND_YD_RP2040_BUTTON_PIN both being defined to be GP24? Given that you've said "This board always thinks it's on battery" I suspect that means you ought to remove the PICO_VBUS_PIN define? (You'll probably find that pressing the button makes the "read_vsys" example think that the YP-RP2040 board isn't battery powered 😆 )

The VBUS pin has been removed. (GPIO-24 as was) as the boiard doesn't
monitor VSYS.

Comments have been added regarding the RGB LED as some boards need a
link soldering to enable the RGB LED. Other boards do not.
@NormanDunbar
Copy link
Copy Markdown
Author

Afternoon Lurch,

Power BATTERY, 9.89V (574%), temp -1479.8 DegC

Was that the result from before you added the link between ADC_VREF and 3v3 Out ?

Yes, there was no link between the AREF and 3v3 pins. (For AREF it was a soldered on header pin I added myself). Since then, I've retested and the results are:

# On USB AND battery power, no link from 3v3 to AREF.
Power BATTERY, 0.00V , temp -1479.8 DegC 

# On USB power only, no link from 3v3 to AREF.
Power BATTERY, 0.00V , temp -1479.8 DegC 

# On battery power only, no link from 3v3 to AREF.
Power BATTERY, 0.00V , temp -1479.8 DegC 


# On USB AND battery power, 3v3 linked to AREF.
Power BATTERY, 0.00V , temp 24.3 DegC 

# On USB power only, 3v3 linked to AREF.
Power BATTERY, 0.00V , temp 24,4 DegC 

# On battery power only, 3v3 linked to AREF.
Power BATTERY, 0.00V , temp 24.4 DegC 

So, it's definitely not able to monitor VSYS. Interesting that the voltage is now reported as 0.00V whereas before the header was added, it was 9.89V. Weird.

Pressing the USR button attached to GPIO-24 makes no difference regardless of how the board is powered.

The RGB LED is on GPIO-23 but only if the link above the reset button is shorted otherwise GPIO-23 goes to physical pin 37, which is 3v3_en on the Pico.

Hmm, if the RGB LED isn't functional unless you add this link, that should probably be mentioned in a comment above your PICO_DEFAULT_WS2812_PIN define?

I have added a comment to that effect. However, it appears that some boards don't have the link. The pinout I have from the manufacturer, vcc-gnd.com, shows the link but other boards (eg Gary Explains on You Tube) didn't need the link soldering to make RGB work.

Did you miss my earlier comment about PICO_VBUS_PIN and VCC_GND_YD_RP2040_BUTTON_PIN both being defined to be GP24? Given that you've said "This board always thinks it's on battery" I suspect that means you ought to remove the PICO_VBUS_PIN define? (You'll probably find that pressing the button makes the "read_vsys" example think that the YP-RP2040 board isn't battery powered 😆 )

Apologies, yes I missed it. I have now removed the VBUS definition from the files. The USR button is the only mention of GPIO-24 now.

Latest commit is d76b0a2.

Once again, I really appreciate the time you have taken to talk me through this stuff. Thank you.

Cheers,
Norm.

@lurch
Copy link
Copy Markdown
Contributor

lurch commented Mar 24, 2026

Once again, I really appreciate the time you have taken to talk me through this stuff. Thank you.

Thank you for making all the changes I suggested! I'm happy to approve this now 👍

@NormanDunbar
Copy link
Copy Markdown
Author

Well, we finally got there!

Thanks again.

Cheers,
Norm.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants