logo elektroda
logo elektroda
X
logo elektroda

PY32F002 - Chinese ARM for 8 cents from PUYA

piotr_go 32103 77
ADVERTISEMENT
Treść została przetłumaczona polish » english Zobacz oryginalną wersję tematu
  • #31 20382093
    piotr_go
    DIY electronics designer
    jarekgol wrote:
    piotr_go wrote:
    in LCSC they have C19
    what does it mean?

    Flu v4.xx
  • ADVERTISEMENT
  • #32 20382100
    jarekgol
    Level 39  
    Right, I'm starting to effectively push it out of my mind :) from this LCSC is bought similarly to aliexpres?
  • #33 20382124
    piotr_go
    DIY electronics designer
    No, it's a normal wholesaler like TME, Mouser, etc...
    All in our own warehouses.
  • ADVERTISEMENT
  • #34 20382129
    jarekgol
    Level 39  
    But shipping from China? Like 3 weeks? Because Mouser delivers it in a few days, but for PLN 80.
  • #35 20382133
    piotr_go
    DIY electronics designer
    In LCSC also if you pay more you will get it by express.
  • ADVERTISEMENT
  • #36 20382158
    jarekgol
    Level 39  
    "Global direct standard line" for $5.80 7-15 days works as stated in your experience?
  • #37 20382173
    piotr_go
    DIY electronics designer
    jarekgol wrote:
    "global direct standard line"

    This is what I order.
    The image shows a shipment tracking timeline with key dates from November 30 to December 13, 2022, ending with delivery.
  • #39 20403717
    piotr_go
    DIY electronics designer
    Yes, yes, we know.
    Unfortunately, layouts for "10 cents" only on aliexpress.
  • #40 20431393
    Macosmail
    Level 35  
    WCH from RISC-V arrived today. LED flashes. I already have PUYA, but they are still lying and gaining power.

    PY32F002 - Chinese ARM for 8 cents from PUYA
    PY32F002 - Chinese ARM for 8 cents from PUYA
  • #41 20431548
    piotr_go
    DIY electronics designer
    I recently ordered modules for BL616 and ESP32 starter.
    Internet radio in the making. I'll start a new thread when I take pics.
  • #42 20467666
    l0ud
    Level 14  
    Hey @piotr_go, have you tested this PY32F002 in the QFN16 housing and confirmed that it is also PY32F030 with 32kB FLASH and 4kB RAM? I ordered some of it from lcsc and I'm wondering whether to prepare the PCB for the PY32F002 project with an "extra" frame, or it's better to put on 003 which I have in larger housings.
  • #43 20467755
    piotr_go
    DIY electronics designer
    One sec.......
    4kB RAM, 32kB FLASH
  • #44 20472214
    l0ud
    Level 14  
    Thank you very much. I designed and ordered an adapter for qfn16 (in my opinion, the coolest case in this series) and I will see if mine is also really 030.
  • #45 20512071
    witawat57
    Level 1  
    How to download program to mcu PY32F002A on windows?
    Can use st-link V2?
  • #47 20525759
    wichers
    Level 2  
    Made some PY32F002 boards for testing purposes, Two blue printed circuit boards with integrated circuits and pins, lying on a dark background..

    I accidently messed around with A13. Is there any way to 'unbrick'/erase a device before the firmware is loaded? Couldn't find anything in the documentation.

    A manual reset quickly following by a erase does not help..
    Thanks!
  • #48 20525863
    piotr_go
    DIY electronics designer
    Have you tried BOOT0=Hi ?
  • #49 20525933
    wichers
    Level 2  
    Thank you for your quick reply, I fixed it.

    I should have mentioned this, it was the QFN (PY32F002AW15U6TR) giving me problems it has no BOOT0 pin. BOOT0 did help to erase the TSSOP20. Solution for the QFN is to do hardware RESET when powered on.

    All very obvious. I made stupid mistake though, I had two projects with the same name but both with different MCU's. I had the wrong processor selected, ouch!
  • #50 20526128
    trimarco232
    Level 2  
    Hi,
    I am currently drawing the pcb for a nano shaped board for the PY32F030 . I am from the arduino world ...)
    the goal is to have a more powerful remplacement for existing nano projects
    so it has to have the same size as nano, same pinout, same pins for most of the peripherals, to work only at 5V, have an USB port to connect to PC, and eventually being programmed with the system bootloader
    I have questions about the BOOT0 and NRST pins :
    - the BOOT0 is connected to a solder bridge, allowing the user to rely it to GND or +5V
    is this the right way to do it ? has it an internal pull resistor ?
    - the NRST pin will be connected to the CH340 pin DTR
    can I connect it directly by a diode, or must it be inverted by a transistor ? has it an internal pull resistor ?
    thanks ! PY32F002 - Chinese ARM for 8 cents from PUYA
  • #51 20526149
    piotr_go
    DIY electronics designer
    trimarco232 wrote:
    the BOOT0

    There is an internal pull-down resistor, but may be too weak if you connect something to the IO.

    trimarco232 wrote:
    the NRST

    Internal pull-up, reset low.
  • #52 20532193
    trimarco232
    Level 2  
    Hi,
    thanks !
    the result of my research is that the RTS# output of the CH340E is normally at a high level (v or 3v3) ; il becomes low only if it is connected to USB and controlled to be active
    so, I will just put a schottky between the RTS# pin of CH340E and the reset node of the PY32, so the CH340E will reset the PY32 while the RTS# pin is active
    NanoPY5 circuit board with various connectors and electronic components.
  • #53 20535038
    jarekgol
    Level 39  
    @trimarco232 in Arduins on atmegs this is capacitor coupled. And from what I observed, when you click upload, the programmer changes this state for a short while, and when you fire up the port monitor (or other terminal without flow control), the state changes to active, but thanks to the capacitor, the processor immediately comes out of the reset and works on its own .
  • #54 20536007
    trimarco232
    Level 2  
    yes , thanks ,but the question is : might it work with py32 ?
    the risk is that te pulse is too short, or have not enough steeped flanks
    one can avoid this by controlling the reset through a diode ; just hope that the 0v3 level will be LOW enough to make a proper reset
  • #55 20569658
    bclax5
    Level 1  
    >>20366259
    @l0ud Would you mind sharing the openocd files you created? That would be amazingly helpful!
  • #56 20576582
    l0ud
    Level 14  
    @bclax5 Please, code based on stm32 driver, definitely not clean or complete ;) .

    https://github.com/l0ud/openocd-puya

    It worked well enough for me before I started using pyocd.

    my usage:

    openocd.conf:
    source [find interface/cmsis-dap.cfg]
    source [find target/swj-dp.tcl]
    source [find mem_helper.tcl]
    
    adapter speed 270
    
    swd newdap puya cpu -enable
    dap create puya.dap -chain-position puya.cpu
    target create puya.cpu cortex_m -dap puya.dap
    
    flash bank puya.flash puyaf0x 0x08000000 0x8000 0 0 puya.cpu
    init
    


    VSCode, Cortex debug extension, launch.json:
    
    {
        "version": "0.2.0",
        "configurations": [
            {
                "name": "Cortex Debug",
                "cwd": "${workspaceFolder}",
                "executable": "${workspaceFolder}/build/puya_playground.out",
                "request": "launch",
                "type": "cortex-debug",
                //"breakAfterReset": true,
                "runToEntryPoint": "main",
                "servertype": "openocd",
                "configFiles": [
                    "openocd.cfg"
                ],
            },
            {
                "name": "pyOCD",
                "cwd": "${workspaceFolder}",
                "type": "cortex-debug",
                "request": "launch",
                "executable": "${workspaceFolder}/build/puya_playground.out",
                "servertype": "pyocd",
                "targetId": "PY32F030x6", 
                "svdFile": "CMSIS/Device/PY32F0xx/py32f030xx.svd",
                "svdPath": "CMSIS/Device/PY32F0xx/py32f030xx.svd",
                "showDevDebugOutput":"none",
            },
        ]
    }
    
  • #57 20598134
    dabyd64
    Level 10  
    Hi, I've been watching those puyas for several months, finally I ordered some to lcsc also made some development boards for py32f002/003/030 and hk32f030m :)

    Three development boards with microcontrollers, USB-C ports, and pin headers.

    But now I've seen you're using serial to program them?
    Do they have embedded bootloader?
    What software to use?
    If this is true, I might embed a CH340E for easier programming, though I hope I can use J-Link too.

    Thanks!!
  • ADVERTISEMENT
  • #59 20611428
    dabyd64
    Level 10  
    So this is the final board for PY32F002, I'll be ordering this soon.
    Uses the same parts as the other board for HK32F
    Quote:

    Rest are common parts easily sourced anywhere, 0402 resistors / capacitors, pin headers, 25xx/24xx memories...

    Edit: Fix PCB
    - Missing GND trace for CH340E.
    - CH340E RTS/DTR not working as expected, remove them.
    - Fix BOOT0 button, pull pin high instead low.
  • #60 20742237
    XiaoTao
    Level 1  
    >>20512071
    You can use daplink or jlink to download programs to the PY32

    Added after 10 [minutes]:

    I have tested that PY32F002AF15P has additional features such as 48MHZ, 32K, and 4K DMA. The PY32F002AF15U6TR packaged in QFN20 is still in transit, and I am not sure if it also has additional features and capacity Microcontroller set with wires and several electronic components on a desk.

Topic summary

The discussion revolves around the PY32F002 and PY32F003 microcontrollers from PUYA, which feature an ARM Cortex M0+ core and are priced at 8 cents and 16 cents, respectively. Users express interest in purchasing these microcontrollers, with links provided to suppliers like LCSC. The PY32F002 offers 20kB FLASH and 3kB RAM, while the PY32F003 includes additional features like DMA and more timers. The microcontrollers support various interfaces (SPI, USART, I2C, ADC) and have a power supply range of 1.7V to 5.5V. Users discuss programming methods, compatibility with STM32, and the availability of development tools. There are also mentions of challenges in programming and documentation access, particularly for the QFN package. Overall, the conversation highlights the growing interest in low-cost ARM microcontrollers and their potential applications.
Summary generated by the language model.
ADVERTISEMENT