Embedded techniques engineer Jay Carlson has been on the hunt for the lowest-possible-cost microcontroller to characteristic on-board flash storage — and believes he is discovered it, within the type of a Puya chip that includes an Arm Cortex-M0+ core.
“Puya? They’re a flash reminiscence firm out of Shanghai that’s been round since 2012 — largely making actually low-cost SPI flash reminiscence for IoT [Internet of Things] devices,” Carlson explains in a weblog put up dropped at our consideration by Adafruit. “Whereas it could appear odd that the most affordable MCU [Microcontroller Unit] is made by a flash reminiscence firm, if you understand a factor or two about chip design (which I do not) you may know that it’s typically the flash reminiscence contained in the half that is the most costly IP within the design.”
The most cost effective flash-equipped microcontroller, Jay Carlson has claimed, comes from a flash reminiscence maker — and packs an Arm Cortex-M0+ core. (📷: Puya)
It is this, Carlson explains, which causes many ultra-low-cost microcontrollers to be constructed with out on-board flash in any respect, providing as a substitute single-use electronically programmable read-only reminiscence (EPROM) that may solely be burned as soon as earlier than having its contents locked without end extra. The Puya PY32 vary, in contrast, comes with true embedded flash — and a well-known Arm Cortex-M0+ core, somewhat than the free and open-source RISC-V structure seen in a lot of its low-cost rivals.
“On the time of publication, costs have shot up fairly a bit in comparison with once I first ordered these components,” Carlson notes, “however presently, the costs vary from lower than 8 cents as much as $0.74 relying on the precise half, configuration, and amount you’re shopping for. The F002A is the bottom mannequin: it clocks in at 24MHz, has 20k of flash, [and] 3k of SRAM [static RAM].
“It has one advanced-control timer with 4 outputs (plus two complementary pairs for driving H-bridges), 1 low-power timer, 1 general-purpose timer, a 1 MSPS 12-bit ADC with 6 exterior channels, two comparators, a fundamental watchdog timer, and one SPI, I2C, and USART peripheral. And since this can be a Cortex-M0+, you get an SWD debugging interface, a SysTick timer, and a nested vector interrupt controller (NVIC) bundled in.”
Carlson describes the event expertise as comparatively clean, during to debugging with business instruments. (📷: Jay Carlson)
That is a number of options in a sub-10¢ chip, however there’s extra to advocate the components than simply value. Carlson describes the event expertise as comparatively clean, bar a bit of fiddling to get the software program improvement package configured for Visible Studio Code somewhat than Kiel MDK. “Total, these components are a lot simpler to make use of than different components on this worth vary,” Carlson says, “which regularly have poor English documentation, no code samples or peripheral libraries, or require vendor-provided IDEs and peculiar tooling.
“Backside line: the Puya PY32 ecosystem is simply plain boring — and that’s a very good factor.”
Carlson’s full write-up is accessible on his web site; he has additionally revealed a pattern venture on GitHub to function a quick-start for others adopting the identical chips.