What is lowest cost micro to micropy with? (control looping A2D, timers)

Discussion and questions about boards that can run MicroPython but don't have a dedicated forum.
Target audience: Everyone interested in running MicroPython on other hardware.
User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by jgriessen » Fri Mar 04, 2016 1:25 am

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
John Griessen blog.kitmatic.com

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by jgriessen » Fri Mar 04, 2016 1:50 am

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...
John Griessen blog.kitmatic.com

Damien
Site Admin
Posts: 647
Joined: Mon Dec 09, 2013 5:02 pm

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by Damien » Fri Mar 04, 2016 5:28 pm

The STM32F411 is fully supported (see PYBLITEv1.0). The STM32F401 also works with stmhal/ code.

User avatar
jgriessen
Posts: 191
Joined: Mon Sep 29, 2014 4:20 pm
Contact:

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by jgriessen » Sat Mar 05, 2016 2:24 am

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
John Griessen blog.kitmatic.com

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by SpotlightKid » Sat Mar 05, 2016 11:43 am

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?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by dhylands » Sun Mar 06, 2016 4:31 am

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.

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by SpotlightKid » Sun Mar 06, 2016 4:39 am

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?

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by dhylands » Sun Mar 06, 2016 6:20 am

Just an oversight.

Do you have the settings used to get 96 MHz ?

SpotlightKid
Posts: 463
Joined: Wed Apr 08, 2015 5:19 am

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by SpotlightKid » Sun Mar 06, 2016 6:34 am

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)

User avatar
dhylands
Posts: 3821
Joined: Mon Jan 06, 2014 6:08 pm
Location: Peachland, BC, Canada
Contact:

Re: What is lowest cost micro to micropy with? (control looping A2D, timers)

Post by dhylands » Sun Mar 06, 2016 6:46 am

Yep - that worked. I confirmed it sets the frequency to 96 MHz so I updated the PR.

Thanks

Post Reply