Page 1 of 2
What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Fri Mar 04, 2016 1:25 am
by jgriessen
The STM32F405RGT6 micro used in the pyboard is deluxe for some apps at $7.54 for qty 500. I'm wanting to make some flyback switcher supply code for solar cells power converting for low power. Who knows the low cost one to use?
Maybe the STM32F411RCT6, STM32F401RCT6 with 64K RAM? They cost ~$4 in 500's.
I need some input A2Ds, and want to sleep and wake with low drain and very quickly, so the esp8266 seems too few inputs or I'd use it without running the radio...
John Griessen
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Fri Mar 04, 2016 1:50 am
by jgriessen
The NXP MK20DX256VLH7 used in teensy is ~$4 in 500's and that port sounds usable for my app, (even without SPI, I2C) at first.
It has 40 IO's,
24 16 bit A2Ds!
runs at 1.7V,
64k RAM, 256k flash
So, I need to look at the teensy port...
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Fri Mar 04, 2016 5:28 pm
by Damien
The STM32F411 is fully supported (see PYBLITEv1.0). The STM32F401 also works with stmhal/ code.
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Sat Mar 05, 2016 2:24 am
by jgriessen
Thanks. The F411 seems a good choice. It being double+ the price of esp8266 and
with F405 being double- the price of the F411, it could fill out the range and be popular.
John
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Sat Mar 05, 2016 11:43 am
by SpotlightKid
So, if one wanted to build a firmware for the Nucleo-F411RE board, I suppose one just has to mix and match the stuff from stmhal/board/PYBLITEV1 and stmhal/board/STM32F401NUCLEO, right? Or has somebody already done this?
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Sun Mar 06, 2016 4:31 am
by dhylands
I put together a PR to add a board definition for the NUCLEO-F411RE board:
https://github.com/micropython/micropython/pull/1870
It also needs
https://github.com/micropython/micropython/pull/1867 in order to build properly.
I was able to flash an image built with that and get a REPL on /dev/ttyACM0 (which is usb serial connected to the SWD, which in turns connects to UART2 on the 411.
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Sun Mar 06, 2016 4:39 am
by SpotlightKid
Great, thanks!
Why not set the CPU to 96 Mhz like the pyboard lite?
Also, I thought the Nucleo-F411RE does not have a HSE but runs from the 16 Mhz HSI?
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Sun Mar 06, 2016 6:20 am
by dhylands
Just an oversight.
Do you have the settings used to get 96 MHz ?
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Sun Mar 06, 2016 6:34 am
by SpotlightKid
It seems that there are different revisions of the Nucleo board with different clock sources. Section 5.6.1 from the user manual (UM1724) has more info. Apparently newer boards use a clock signal from the ST-LINK MCU as HSE at 8 Mhz.
So this should work, I think:
Code: Select all
#define MICROPY_HW_CLK_PLLM (8)
#define MICROPY_HW_CLK_PLLN (192)
#define MICROPY_HW_CLK_PLLP (RCC_PLLP_DIV2)
#define MICROPY_HW_CLK_PLLQ (4)
Re: What is lowest cost micro to micropy with? (control looping A2D, timers)
Posted: Sun Mar 06, 2016 6:46 am
by dhylands
Yep - that worked. I confirmed it sets the frequency to 96 MHz so I updated the PR.
Thanks