NUCLEO-F103RB pinout and pin declaration

Post here first, or if you can't find a relevant section!
Post Reply
nektariosb
Posts: 3
Joined: Thu Mar 24, 2022 7:15 pm
Location: Greece

NUCLEO-F103RB pinout and pin declaration

Post by nektariosb »

Hello.

I am new here, and I am looking for some help about the pinout of the NUCLEO-F103RB.

I am writting code in Arduino IDE and I want to use some digital inputs and outputs.
But I dont know wich and also I dont know the names.
My project has an AD7606 adc in parallel mode (16bits),
so I need 16 inputs and some more for control signals
(a total of 19 inputs and 7 outputs).

While I was looking around I found these https://www.instructables.com/Quick-Sta ... duino-IDE/
where the guy remapped the pins (gave new easier names) and made a very simple header file
Image
Image

in the code he writes int a = pinMap(14);
and the library translates to:
int pinMap(int pin)
{
switch (pin)
{
case 1: return 2;
break;
case 2: return 3;
break;
case 3: return 4;
break;
etc. etc.

It look convenient but he made it for Nucleo-F401RE.

Do you think it is the same for NUCLEO-F103RB (it looks like the same)?

Thank you
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: NUCLEO-F103RB pinout and pin declaration

Post by GonzoG »

Why bother with such complications ??
Use Arduino style pin numbering (0-21: 0-15 for D0-D15, 16-21 for A0-A5) or general pin symbols (eg. PA1).
Pinouts for all Nucleo-64 boards are available on ST's page: https://www.st.com/resource/en/user_man ... ronics.pdf
nektariosb
Posts: 3
Joined: Thu Mar 24, 2022 7:15 pm
Location: Greece

Re: NUCLEO-F103RB pinout and pin declaration

Post by nektariosb »

@GonzoG that was truth, the general pin symbols (eg. PA1) was the easiest way.
Thank you! 8-)
Post Reply

Return to “General discussion”