Which 10 Cent Microcontroller is Right for You? Comparing the CH32V003 to the PY32F002A.
Summary
TLDRIn this video, Zach compares two ultra-budget microcontrollers, the Puya PY32 and WCH CH32V003, both priced around 10 cents. He explores the differences between their cores, the RISC-V of the CH32 and the ARM Cortex-M0+ of the PY32, and their implications for hobbyists and industry. Zach discusses the peripherals, ease of use, and availability, conducting real-world tests including blinking an LED and reading an ADC value. Despite the CH32's faster speed and DMA support, he concludes that the choice between them depends on specific project needs, but for larger quantities and consistent availability, the PY32 might be more suitable.
Takeaways
- 😀 The video compares the CH32V003 and PY32 microcontrollers, both of which are ultra cheap and cost around 10 cents.
- 🧩 The CH32V003 features a RISC-V core, an open-source instruction set architecture, while the PY32 uses the ARM Cortex M0+ core, which is proprietary and involves royalties.
- 📚 The script discusses the importance of considering more than just the processor core when comparing microcontrollers, including memory, peripherals, power systems, and system clocks.
- 💻 The video mentions that programming microcontrollers is often abstracted by compilers, making the underlying core less critical for many users.
- 🛠️ The script highlights the lack of documentation for the CH32V003 hardware drivers as a drawback, contrasting with the more extensive resources available for the PY32.
- 💡 The video suggests that RISC-V could have significant implications for the industry, particularly in academia and for companies looking to integrate processing cores without licensing fees.
- 🔍 The script notes that the CH32V003 seems to be more popular and has better community support, which can be an important factor for hobbyists and developers.
- 💰 The video discusses the cost and availability of the microcontrollers, with the PY32 appearing to be more consistently available in larger quantities.
- 🛒 The script describes the process of setting up and programming both microcontrollers, noting that the CH32V003 was easier to get started with due to better software support.
- 🏆 The conclusion of the video is that neither microcontroller is definitively better, and the choice between them depends on the specific needs of the project and the availability of the components.
Q & A
What are the two ultra cheap flash-based microcontrollers discussed in the video?
-The two ultra cheap flash-based microcontrollers discussed are the Puya PY-32 and the WCH CH32V003.
What is the main difference between the RISC-V core in the CH32 and the ARM Cortex-M0+ core in the PY-32?
-The RISC-V core is an open-source instruction set architecture, while the ARM Cortex-M0+ core is proprietary intellectual property from ARM, which includes additional resources like hardware models and software tools.
Why might the availability of the microcontrollers be a concern for large-scale projects?
-The availability of the microcontrollers could be a concern for large-scale projects because the CH32V003 was found to have limited stock, which might not be sufficient for bulk requirements, unlike the PY-32 which has shown no such issues.
What is the significance of RISC-V for the microcontroller industry according to the video?
-RISC-V is significant because it allows for free implementation of processors, which can be particularly beneficial for companies, researchers, and hobbyists who might not have otherwise developed their own silicon.
What are the advantages of using the CH32V003 over the PY-32F002 based on the video?
-The CH32V003 has advantages such as a faster clock speed, a DMA controller, and a built-in op-amp. It also has a larger community and more online resources, which can be helpful for support and tutorials.
How does the video presenter feel about the open-source nature of RISC-V?
-The presenter is a huge fan of open-source and believes that RISC-V will have a positive impact on the industry, supporting the idea of freely implementing processors without licensing fees.
What is the primary reason the presenter chose the PY-32 for their tile backsplash project despite the availability of the CH32V003?
-The primary reason was the availability of the PY-32 in sufficient quantities for the project, as the CH32V003 had limited stock which might not meet the requirement of 500 units needed for the project.
What is the recommended IDE for programming the CH32V003 according to the video?
-The recommended IDE for programming the CH32V003 is MounRiver, which is Eclipse-based and feels familiar to those who have used other ARM-based IDEs.
What is the main complaint the presenter has about the documentation for the CH32V003?
-The main complaint is the lack of documentation for the hardware drivers, which makes it difficult to understand how to use certain functions without referring to example code or reading through the drivers themselves.
How does the video presenter summarize the choice between the CH32V003 and PY-32F002 for future projects?
-The presenter suggests that both microcontrollers are useful and have their pros and cons, and the choice between them should be based on the specific requirements of the project. Both are considered valuable options for future projects.
Outlines
🤖 Introduction to Affordable Microcontrollers
The paragraph introduces a comparison between two ultra-affordable microcontrollers, the Puya PY32 and the WCH CH32V003, both priced around 10 cents. The speaker, Zach, expresses curiosity about whether he made the right choice by purchasing 500 PY32 units for a project. He plans to test the CH32V003 development board, which is the cheapest in the CH32 series and most comparable to the PY32F002, to determine which microcontroller is more suitable for those on a tight budget. The focus is on the core processor differences, with the PY32 using the RISC-V architecture and the CH32 using the ARM Cortex-M0+ core. Zach also discusses the implications of using open-source versus proprietary cores, including licensing and support from ARM for the latter.
💻 Open-Source RISC-V vs. Proprietary ARM
Zach delves into the differences between the RISC-V and ARM Cortex-M0+ cores, emphasizing RISC-V's open-source nature and ARM's proprietary model. He mentions that while RISC-V is free and open, ARM's model includes royalties and a more comprehensive package that aids in silicon implementation. Zach speculates on the likelihood of Puya's proper licensing of the ARM core, citing the presence of PY32 in Keil uVision, an IDE released by ARM. He also touches on the broader aspects of microcontrollers beyond the core, such as memory, peripherals, and power systems, which can be more critical than the core itself. Zach concludes that for most hobbyists, the choice of core may not significantly impact programming due to the use of high-level languages and compilers that abstract hardware differences.
🛠️ Practical Considerations for Microcontroller Selection
Zach discusses the practical aspects of choosing a microcontroller, such as cost, ease of use, availability, support, toolchains, and total cost of ownership. He suggests that the 10-cent microcontrollers are best suited for projects requiring a large number of units performing basic tasks, rather than for one-off development boards. He shares his experience with purchasing a development board set that included the CH32V003, a programmer, and chips, and compares it with other options like the STM32 Blue Pill, ESP32S, and Arduino. Zach emphasizes that while cost is a factor, it shouldn't be the only consideration, especially when building products for sale or long-term reliability.
🔍 Comparing Specifications and Pricing
In this paragraph, Zach compares the specifications and pricing of the CH32V003 and PY32F002 microcontrollers. He notes the CH32's higher clock speed, DMA controller, and built-in op-amp, while the PY32 offers more RAM, Flash memory, and a higher-resolution ADC. Zach also discusses the availability of the microcontrollers on LCSC, with the PY32 appearing to have better stock availability. He mentions that for development boards, the CH32 has more options and is easier to order, giving it an edge over the PY32 in that category. The paragraph concludes with a detailed comparison of features like timers, ADCs, and connectivity options, highlighting the similarities and differences between the two microcontrollers.
💻 Programming Experience and Documentation
Zach shares his experience programming the CH32V003 using the MounRiver IDE and contrasts it with his experience with the PY32. He finds the CH32's setup in MounRiver to be straightforward, requiring minimal configuration. However, he encounters an issue with interrupt handler attributes that leads to a hard fault, which he resolves with help from online discussions. Zach criticizes the lack of documentation for the CH32's hardware drivers but appreciates the well-written data sheets and reference manuals. He also notes the absence of simple example codes for basic functionalities like timer interrupts and ADC conversions. Despite these challenges, Zach manages to blink an LED and read an analog voltage with the CH32, comparing the ease of use and functionality with the PY32.
🏆 Conclusion and Future Considerations
Zach concludes the comparison by acknowledging that the choice between the CH32V003 and PY32F002 depends on the specific application requirements. He gives the edge to the CH32 for its out-of-the-box experience with MounRiver, support for the RISC-V movement, hardware features, and the availability of online help. However, he also recognizes the PY32's strengths and notes that he will consider both microcontrollers for future projects. Zach emphasizes the importance of considering factors like stock availability and the potential risks of relying on microcontrollers with limited stock for large projects. He ends by stating that both microcontrollers are valuable and cost-effective, and he plans to continue using them in his work.
Mindmap
Keywords
💡RISC-V
💡ARM Cortex-M0+
💡Microcontroller
💡Flash-based Microcontroller
💡Development Board
💡Instruction Set Architecture (ISA)
💡Open Source
💡Proprietary
💡IDE (Integrated Development Environment)
💡Peripherals
💡Cost-effectiveness
Highlights
Comparison between the CH32V003 and the PY32 microcontrollers, both priced around 10 cents.
Discussion on the merits of the CH32V003 in the comments section of a previous video.
Introduction to the development board for the CH32V003, comparable to the PY32F002.
Core differences between the RISC-V core in the CH32 and the ARM Cortex-M0+ core in the PY32.
RISC-V as an open-source instruction set architecture versus ARM's proprietary core.
Implications of using ARM's intellectual property and potential royalties.
Availability of the PY32 in Keil uVision IDE, suggesting proper licensing from ARM.
WCH's proprietary implementation of the RISC-V architecture in the CH32.
Importance of microcontroller peripherals beyond the processor core.
Programming experience and the abstraction of hardware differences by compilers.
Open-source preference and its impact on software and hardware choices.
Potential benefits of RISC-V for academia and the industry.
Considerations beyond cost when choosing microcontrollers, such as ease of use and support.
Use case scenarios for 10-cent microcontrollers in personal projects versus commercial products.
Availability and pricing comparison between CH32V003 and PY32F002 from LCSC.
Development board options and their impact on ease of use for the CH32V003 and PY32F002.
Performance and real-world testing of the CH32V003 and PY32F002 microcontrollers.
Comparative analysis of the CH32V003 and PY32F002 based on functionality, software environment, and ease of coding.
Final thoughts on the suitability of CH32V003 and PY32F002 for different applications and projects.
Transcripts
a little while back I made a video about
this the 10-cent Pua py 32
microcontroller in that video I
mentioned that the py 32 wasn't the only
Ultra cheap flash-based
microcontroller but there's also the wch
ch32
v003 which also comes in around 10 cents
and it seems to be far more popular many
of you left comments on that video
discussing the merits of the ch32
and that got me wondering did I make the
right choice when I bought 500 of the
p32 for my latest
project well there's really only one way
to find
out this is a development board for the
ch32
v003 which is the cheapest of the ch32 V
series and it's the most comparable to
the p32 f002 a that I talked about
previously I'm going to put this through
its paces and determine which of these
you should use if you only have 10 cents
and you ignore the cost of passives and
the circuit board and everything else
you need to get started let's get into
it I'm Zach and you're watching Zack of
all
[Music]
trades I'm going to get started by
discussing the biggest and probably most
controversial difference between the py
32 and the
ch32 the pro processor core specifically
the differences between the risk 5 Core
in the ch32 and the arm cortex m0 plus
core in the
p32 risk 5 which stands for reduced
instruction set computer five is a free
and open-source instruction set
architecture for background an
instruction set architecture defines how
the processor should behave with respect
to software by outlining the things like
in instructions registers and memory
handling binary code that is written for
One processor should work on any
processor that follows the exact same
Isa now let's contrast this to the
cortex m0 plus core the MZ plus is
intellectual property from arm which is
a for-profit company and it's more than
just an Isa but it also includes things
like Hardware models physical IP and
stuff that gets you much closer to
actually building the ship on Silicon
you also are going to get software tools
and simulation
tools now when you buy a cortex part a
fraction of what you spend goes back to
arm in royalties okay I am assuming here
that whoever makes the chip has properly
licensed from arm there have been
instances where foreign companies have
stolen the IP while I can't be 100% sure
that puya is licensing the devices
correctly they do show up in Keel
microvision which is a IDE that's
released by arm
it seems a little unlikely to me that
arm would knowingly add microcontrollers
to their software if they weren't
properly licensing them so then what do
the makers of risk 5 chips do for their
Hardware Designs well most commonly it
would seem that they develop their own
proprietary implementations which is
what wch has done here with the ch32 and
their shinky core hope I'm pronouncing
that right there are other open- source
implementations including verilog
descriptions and that's pretty cool in
all honesty though I don't know that
this matters for the majority of
hobbyists we're not likely to be making
our own silicon although that day is
approaching you can Implement these
verilog descriptions on fpgas but that's
probably more of a learning exercise
than something You' regularly
do another point I'd like to make is
that microcontrollers are far more than
just their processor cores they also
have memory peripherals power system
systems clocks and so on and those can
actually be more important than the core
itself the arm versus risk 5 debate
doesn't actually tell us anything about
these peripherals and the majority of
time these aren't going to be
open the differences in peripherals also
means that programming various risk five
or arm parts even with the same core can
be very difficult as there's not really
any standardization of
these finally I don't believe the
underlying C core makes all that big of
a difference from a programming
perspective since most of us are
probably writing our code in C or a
higher level
language if you want to multiply two
numbers you're probably not worrying
about loading values into registers
finding the right instructions you're
just going to type Cals a * B semicolon
and move on with your life the compiler
handles the rest and it's going to
abstract away many of the differences in
the underlying Hardware now don't get me
wrong I'm a huge fan of Open Source I
definitely prefer not to pay
corporations for software that hasn't
really changed functionality in decades
looking at you Microsoft Office and I
refuse subscription based
software much of the software I use on a
daily basis is open source and I
contribute when I can I also believe
risk 5 is an important development that
will have a really positive impact on
the industry but from what I've seen so
far I don't believe that risk 5 microc
controllers have a really substantial
Edge over arm devices at least not yet
for one the ch32 is different enough
that you'll need different software and
different programmers and that adds to
the cost and it can have a fairly steep
learning curve and despite not requiring
royalties risk five parts don't seem
cheaper at least not for the parts I'm
comparing here but I'll get to cost in a
second what I do think is awesome about
risk 5 and one of the reasons I'm really
excited about it is that it will allow
companies researchers and even hobbyists
to freely Implement processors where
they probably wouldn't have otherwise
bothered I foresee companies making more
ic's smart as adding a processing core
to a ADC an IMU or a radio whatever
that'll no longer require that company
to involve their lawyers and write
contracts and pay fees just to license
that Core Design the benefits for
Academia will also be huge not just
research purposes but also because
students now have an actual open-source
Isa to study when they're learning how
processors
operate I think there are also benefits
on the 64-bit processor side for
application processors as well as
personal Computing but I'm not as
familiar with that and it's outside the
scope of this
discussion that's all I'm going to say
right now about core differences but at
the end I'll bring this full circle and
give you my thoughts when choosing a
microcontroller or any other component
for that matter
cost is only one part of the broad
picture ease of use availability support
tool chains total bomb cost ease of
assembly part Lifetime and so on are all
things you need to consider so when
might you actually want to use one of
these 10-cent microcontrollers versus
one of the more expensive
options first I personally believe that
these chips only make sense if you're
using them on your own circuit boards if
you're looking to just buy a development
board for a one-off project then I
couldn't recommend either of these for
reference I got this development board
as part of a larger package on Amazon it
came with this a ch32 v203 development
board a wch link e programmer and five
each of the chips from both of these
boards and this was all
$27 I put a link down in the description
if you're interested and I can attest
that these work fine at least to the
extent I've tested them
now while I wouldn't say this is a
terrible deal and there are certainly
cheaper options especially if you go
from overseas vendors there are lots of
options from other more reputable
companies in this price range and
they're certainly easier to use and
they're going to have more
features the stm32 blue pill or the new
cleos the
esp32s any of the arduinos the Raspberry
Pi Pico I think that these and really
any of the popular development boards
are going to be better choices
so one use case for these 10-cent Parts
could be to save money when you're
building a product you're going to sell
although honestly I'm not sure I'd feel
that comfortable doing that either I
would worry that one of these
manufacturers might suddenly stop making
these which would invalidate much of the
non-recurring engineering You'
done also if I opened up some product
I'd bought especially something I
expected to have a long life and I saw
one of these Ultra sheep chips in there
I'd be a little put off personally if I
were making something I planned on
selling I'd spend a little more money
from a part from St or Texas Instruments
or
Renu one of the parts I could just buy
from digy and be reasonably assured it'd
be around for the next
decade now where I do think these
microcontrollers are really useful is
for projects where you need a lot of
microcontrollers that are doing pretty
basic tasks this is what I'm doing with
the p y32 in my tile backsplash
project here I'm using the inter ADC on
the py 32 to digitize a microphone
signal and communicate the peak value
back to a main processor I need about
250 of these so for a personal project I
just really can't afford to use anything
more
expensive check out the video on that
project if you haven't And subscribe so
you can be sure to catch the rest of
it these types of projects things like
making an analog sensor into a smart one
doing at the sensor processing or event
detection
heck even making your own personal
Computing cluster these are the cases
where these Ultra cheap microcontrollers
shine so I've called these both 10-cent
microcontrollers but how accurate is
that for comparison I'm only looking at
the lowest spec cheapest Parts which are
the ch32
v003 and the py 32
f002 and these prices are as of mid
2024 on LCSC which I considered to be a
reliable vendor you can buy the py 32
for between 13.2 C and 17.5 cents if you
buy only 5 and 8 cents to a smidge over
11 cents if you buy 500 depending on the
package the ch32 in comparison is on the
order of 19 to 23.5 cents for five and
12 to 14 1.2 cents for
500 additionally as of right now you
can't even order 500 of a single type of
ch32 because there are only 415 sop 8s
in stock and 100 qfm 20s for the py 32
on the other hand all five options are
in stock and the scarcest one has over
4500 now I know that you can buy the
ch32 on AliExpress from the official wch
store in fact you can apparently get 50
of the8 pin ch32 v003 chips for a single
dollar shipped which is
absurd but that's a onetime deal and you
don't have much control over
quantity I am also personally far less
comfortable ordering from AliExpress but
you could feel differently about that so
from a cost and availability perspective
on bare chips I have to give the
advantage to the py
32 if you're looking for development
boards though then the exact opposite is
true there is this board for the py 32
f003 on LCS CX right now it costs about
$14.5 which is a bit high for what
you're getting and I've noticed that the
price fluctuates
considerably there are a couple other
options for the p32 but they have no
reviews and probably no
documentation the C32 though like I said
I got this on Amazon delivered in two
days with the spare chips it was a
little pricey at $27 but very easy to
order check out the description for the
link there's also plenty of other
cheaper options for the ch32
particularly from overseas just Googling
ch32 v003 will turn up lots of options
so for development boards I've got to
give the edge to the
ch32 taking a look at the data sheets
you'll find that there's really no clear
winner as the p32 f002 and the ch32 v003
trade blows in different areas now
allegedly the py 32 f2a
uses the same die as some of the higher
end parts and you can unlock additional
features if you know what you're doing
but that's not guaranteed that might not
always be true so for this comparison
I'm sticking strictly to what is
advertised to start the ch32 can run up
to 48 MHz and it has a PLL that can make
that frequency from the 24 MHz internal
oscillator the py 32 though runs at half
that 24 MHz it has no PLL
the p32 does have the edge for Ram and
Flash with 3 kilobytes of RAM and 20
kilobytes of flash whereas the ch32 has
2 kiloby of RAM and 16 kiloby of flash
both parts have one Advanced timer and
one basic timer but the p32 has an
additional low power timer both have
adcs however the py 32s is 12 bits and
the CH 32s is only 10 if you're sampling
that data really quickly though you
don't want to load up the process
then you're going to find the dma on the
ch32 very useful but you don't get on
the
p32 the ch32 also has a built-in op amp
which if you need it could reduce your
build of materials in comparison with
the
p32 for connectivity they both have one
uart one spy and one i2c but there's a
caveat for the
ch32 the Spy is only broken out on the
20 pin packages there's no spy on the 16
and eight pin options
compare that to the py 32 where you get
the option for all three regardless of
package if you have an application in
mind though you should probably check
out the multiplexing on those really
small packages as some of those
functions
overlap other than that these two parts
are really similar they can both operate
at 5 volts they both have comparable
package options and number of IO and
they have similar low power modes as you
can probably see it is hard to declare
one of these better than the other
without knowing your exact
application on one hand the ch32 is
faster and has dma and that built-in op
amp but the py 32 has more Flash and RAM
and a higher resolution
ADC the data sheets one thing but how
did these chips actually perform in the
real world and how easy are they to use
for the py 32 go back and check out my
previous video where I walked through
setting up the IDE and then did two
coding examples now the p32 has
pretty much no information online and
there really aren't any tutorials which
is definitely a drawback so in the
previous video I went into quite a bit
of detail on how to use them there is
much more information for the ch32
though so I'm not going to walk through
this step by step like I did before what
I am going to do is replicate the two
test codes I did in the last video first
I'm going to Blink an LED using a timer
and interrupts and then secondly I'm
going to read an analog voltage with the
internal ADC and report it to computer
over
serial I'll then compare the experience
on the ch32 with that of the
p32 for ID I'm going to be using Mound
River this is what is recommended by wch
which is why I'm choosing it similar to
what I did for the
p32 there are other IDE options probably
better options there's even support for
the Arduino IDE so don't be too scared
away by this mound river is Eclipse
based so it's going to feel pretty
familiar if you're coming from some
something like the stm32 cube
IDE as mentioned the boards I'm testing
this with came from Amazon and included
two development boards one for the ch32
v003 and one for the
v203 as well as 10 bear chips and the
wch link e which is this comically bulky
USB programmer that you can't actually
push the buttons on without removing the
case there's also a GitHub repository
I've linked that has lots of information
on this ship and this board things like
the schematics example code some how-to
PDFs I recommend you poke through that
before you get started when you open
Mound River and go to create a project
you basically just need to provide a
name and select the chip you're using
click okay and that's it all the start
code and the how drivers are there and
ready to use the start code sends the
system clock rate and the chip ID over
uart as well as has some uart Echo
functionality without making any changes
to the start code I compiled and flashed
it just to verify that this at least
worked I used the serial adapter built
into the link e as well as MOA xterm on
a PC all I had to do was connect 3.3
volts from the debugger to VCC on the
board ground to ground s swdi to pd1 and
RX to pd5 this would have worked great
except my link e firmware was ever so
slightly out of date so M River refused
to use it and it forced me to update it
which I tried to do itself halfway
through the update process though the
link e disconnected from my computer and
didn't come back now those of you that
deal with these things regularly know
that this can be a bad situation a
little searching though led me to the
wch link utility which is available
straight from WC's website this luckily
recognized the link e and I was able to
update it without much trouble back over
in Mound River the program now flashed
directly and the serial communication to
my PC worked as it
should I then got started modifying the
code to Blink an LED with a timer this
is pretty straightforward and honestly
pretty similar to the p32 or any other
arm part you configure the timer start
it in the appropriate mode configure the
LED GPO pin write an interrupt Handler
where the pin is actually flipped and
then you call the initialization
functions from the main function and
enter an infinite Loop
interrupts will do the
rest interestingly the ch32 development
board doesn't actually connect the led
to a pin unlike what you would usually
see so you get to choose where it goes
the downside though is that this does
require a wire on the development board
which might not be desirable for your
final application I did have one issue
and a couple of
complaints the issue I ran into is in
regards to attributes on the interrupt
Handler function prototype
I'm not going to go into great detail
here as I wouldn't say that I fully
understand it myself but the Crux is
that if you create an interrupt Handler
and the wch interrupt fast attribute is
applied to the other interrupt handlers
then you should go ahead and apply it to
the one you create as well I didn't and
my initial code ended up in the hard
fault
Handler luckily since this
microcontroller is fairly widely used I
actually found a discussion and a
solution for this issue online line my
complaints are in regards to the
documentation the data sheet the
reference manual there's a core manual
and a bunch of other how-to guides
they're really well written and they're
written in English unlike what you get
for the
p32 but I could not find any
documentation for the hardware drivers
despite the fact that they're used by
default in Mound River now to be fair
poya also does not have documentation
for the drivers on the p32 but those
drivers are BAS basically just copied
from STM 32s so st's 2000ish page Hal
manual is directly
applicable for the ch32 I basically
didn't have any guidance other than the
reference code and reading through the
drivers in the
IDE now I know roughly what I'm doing
and the drivers behave pretty similarly
to the arm devices they mostly just
differ in syntax so I was able to
stumble through this by just using the
ide's autocomplete functionality
and kind of just guessing what the
function should be but still it would
have been really nice to have a manual
if anyone knows that one exists please
let me know now this brings me to
another minor complaint this is
regarding the reference code the
reference code provided on GitHub is
quite complete it covers every
peripheral but I found that it only
covers more complicated use cases take
the timers for instance there's an
example code for dma for encoder
counting for output compare one pulse
modee Etc but there's not an example
that just covers setting up a timer to
generate an interrupt the ADC is another
good example there is no code that just
covers a single software start
conversion which is probably what most
beginners the ones who are reading the
example code anyway are trying to do you
can certainly piece together what you
need from some of the more complicated
examples but I found this a bit odd
regardless I worked through this Blinky
example reasonably quickly and I got the
board to Blink its LED 500 milliseconds
on 500 millisecs off without much
trouble this was certainly faster than
getting the py 32 running even when you
take into account updating the link e on
to the more complicated example reading
a voltage with the ADC and sending it
over serial to a computer setting up the
uart here couldn't have been easier
literally because it's already done for
you in the start code there is a debug
file
included you can go through and check
out the exact functionality but one
thing it does is redirects print F to
ur1 all you need to do is know the pins
pd5 for TX and pd6 for RX hook them up
to the link e appropriately and then
print F just
works compare this to the p32 where I
still haven't gotten print F to redirect
correctly I'm compiling messages and
then sending them over to Art the manual
way the other main thing that needs to
be done here is configuring the ADC this
took a little bit of playing around
because of the aformentioned lack of
documentation on the how drivers pretty
simple stuff like should this field be
zero indexed or one indexed and how do I
do a single conversion since all the
example codes or multiple or injected
conversions overall though I would say
that this example took me a similar
amount of time to what it did on the p32
with my lack of familiarity with the
drivers being offset by the fact that
the uart was already set
up so here's the circuit setup I've just
run VCC to one side of a potentiometer
ground to the other side and the center
tap of the pot to pd3 which is ADC
Channel 4 on this chip this makes an
adjustable voltage divider and you can
see here that as I rotate the pot the
ADC values respond logically I'll be at
only to 1023 as this is only a 10 bit
ADC the ADC noise seems quite small only
an LSB or so at 43 cycle sampling time
and I ran this for many hours and I
didn't observe any drift so now that
I've had the chance to test out both the
p32 and the ch32 including their
functionality native software
environment and ease of writing and
flashing code which chip is the
winner well I hate to reiterate what
I've already said but it really does
depend on what your final application is
for this chip as they both have pros and
cons and they could make break a
particular
project but if they both have the
features you need then well I have to
give the edge to the
ch32 it comes down to four things first
when you download mountain river and you
select the ch32
V3 it pretty much just works there's no
messing around with configuration no
trying to load the right Hardware
libraries really nothing other than
needing to update the link e after that
I literally hooked up the debug probe
compil
loaded the start code and that was it it
just
worked second and you might not
personally care about this but risk 5 is
kind of cool right now and by using the
ch32 you're helping to support that
movement third I think I have to give
the hardware Edge to the
ch32 it runs at twice the speed it has a
dma controller and I feel like that's
probably a little more useful than what
the py 32 has has which is additional
Flash and RAM the higher resolution ADC
and an additional timer you could debate
this point though so take that with a
grain of
salt and finally there's a lot of online
help for the ch32 not necessarily
directly from wch but in online
discussion and even a lot of
tutorials now the p32 is very very
similar to the stm32 so stm's
documentation even for stuff like the
how drivers is very use use ful but
there's essentially no online help
specifically for the
p32 that said I did find the lack of
driver documentation on the ch32 to be
quite
frustrating so did I make the wrong
choice when I bought these 500 p32 chips
for my tile backsplash
project I don't think so and it all
comes down to
availability remember when I said that
for the ch32
v003 there were only 415 of one package
and 100 of another package in stock well
I wrote that a couple days ago and
before filming this I went back and
checked again now there is not a single
ch32 v003 in stock at
LCSC and that's the problem if you want
10 50 maybe even 100 CH 32s then sure
you can probably order them on
AliExpress you'll probably get what you
need but if you need a whole spool of
these even just 500 of them then you're
out of look with the p32 though I've
never had to worry about stock plus it's
not like one of these existing negates
the usefulness of the other one you can
have and use both of them I think that
they're both fantastically useful
microcontrollers they're not all that
different to program they're both an
insane value and now that I've got an
experience with both of them I'm going
to keep them both in mind for future
projects that's all I've got today in
the next videos I'll be getting back to
some of the projects so please like
subscribe
and check those out thanks for watching
関連動画をさらに表示
(SSDs vs HHDs) What's The Difference Between SSD and HDD?
เทียบชัด ๆ Intel Core i9-14900K VS Core i7-14700K เจนเดียวกัน แต่ความแรงต่างกันขนาดไหน ?| iHAVECPU
10x42 vs 10x50 Binoculars - Which is Best?
Should You Use Microsoft Office or Apple Apps on Your Mac?
Ip address statis atau dinamis, manakah yang lebih baik ?
Agile vs Waterfall Methodology | Difference between Agile and Waterfall | Intellipaat
5.0 / 5 (0 votes)