It seems that most Chinese chips PUYA PY32F002Ax5 have the core from PY32F030x6 chips inside, which gives undocumented features like DMA support, PLL with the ability to run chip on 48 MHz, additional timers like TIM3, and 4 KB RAM with 32 KB flash.
How to check if you PY32F002Ax5 has more memory
There you have several options:
- Build and flash this code to test RAM and flash https://github.com/IOsetting/py32f0-template/tree/main/Examples/PY32F0xx/HAL/Test/PY32F002A_32KF_4KR
- Create an empty 32kb binary file in your preferred hex editor (or use the online hex editor https://hexed.it), put some bytes to the end of the file, flash the file to the chip, then verify those bytes by reading the firmware back.
How to unlock hidden features of PY32F002Ax5
If you’re using the HAL and LL libraries from the repository https://github.com/IOsetting/py32f0-template, you just need to modify Makefile, change:
MCU_TYPE = PY32F002Ax5
MCU_TYPE = PY32F003x6
Already tested chips
PY32F002AA15M6TU
I tested the small one PY32F002AA15M6TU in ESSOP10 package (btw it costs only 15 cents).
The original source of the image is LCSC https://www.lcsc.com/product-detail/Microcontroller-Units-MCUs-MPUs-SOCs_PUYA-PY32F002AA15M6TU_C5292058.html
According to the datasheet, the chip has 3 KB of RAM and 20 KB of flash memory with a maximum core frequency of 24 MHz. I tested 4 KB RAM and 32 KB flash and they work fine. Also, I was able to use ADC with DAM, use TIM3 (which the PY32F002A shouldn’t have, only TIM1 and TIM16), and run the chip with PLL and 48 MHz frequency.
PY32F002AF15P
There is an article https://www.cnblogs.com/milton/p/17052963.html from a Chinese guy who tested this chip. He tested 4 KB RAM and 32 KB flash, ADC with DMA, and PLL with 48 MHz.
References:
https://www.cnblogs.com/milton/p/17052963.html https://github.com/wagiminator/Development-Boards/tree/main/PY32F002AF15P_DevBoard#unofficial-additional-features