Noob Help please STM32F767 Nucleo board

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.
Post Reply
vikingsraven
Posts: 2
Joined: Fri Jan 14, 2022 3:56 pm

Noob Help please STM32F767 Nucleo board

Post by vikingsraven » Fri Jan 14, 2022 4:18 pm

HI,
been playing with Micropython for a bit now with ESP 32 and love the ease of use.
Having a few issues trying to get the ports on the Nucleo board to switch on, im probably (most definitely!) doing something wrong.
so im just trying to switch an led for now real basic stuff.

Code: Select all

>>> g = pyb.Pin(pyb.Pin.cpu.A0 ,pyb.Pin.OUT_OD)
>>> g.value(1)
what i believe this is doing
using A0 and a output with open Drain
then setting it to on!
the csv show A0 mapped to PA3 on the stm which is correct
i know its going to be something daft and apologies for that up front. But i cant see what im doing wrong!
any help will be appreciated.

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

Re: Noob Help please STM32F767 Nucleo board

Post by dhylands » Fri Jan 14, 2022 5:49 pm

The entry mapping A0 to PA3 is mapping board pin A0 to cpu pin A3.

You're using pyb.Pin.cpu.A0. You need to use either pyb.Pin.board.A0 or pyb.Pin.cpu.A3.

I also noticed you're using OUT_OD which means that when you set the value to 0 then the pin will be driven low. When you set the value to 1, it stops driving the pin and needs something external to drive the signal high (like a pullup resistor).

If you don't have an external pullup resistor then you should be using OUT_PP which will drive high as well as driving low.

vikingsraven
Posts: 2
Joined: Fri Jan 14, 2022 3:56 pm

Re: Noob Help please STM32F767 Nucleo board

Post by vikingsraven » Sat Jan 15, 2022 11:45 am

@dhylands
thanks for that, now it makes sense.
I can also use the umachine pin function with A0 and that works.
Thanks again

Post Reply