How many GPIO pins is the Blue Pill supposed to have?

Post here first, or if you can't find a relevant section!
Post Reply
Piter_de_Vries
Posts: 14
Joined: Sat Sep 17, 2022 4:12 pm

How many GPIO pins is the Blue Pill supposed to have?

Post by Piter_de_Vries »

When I count all the GPIO pins that are broken-out, I find only 35 GPIO pins but I see multiple source online say that there are 37. Are some of them not broken-out? Thanks.
by GonzoG » Fri Oct 07, 2022 12:01 am
PD0 and PD1 are used for external 8MHz crystal.
Go to full post
ag123
Posts: 1653
Joined: Thu Dec 19, 2019 5:30 am
Answers: 24

Re: How many GPIO pins is the Blue Pill supposed to have?

Post by ag123 »

things like PC13 goes to the LED, 2 pins goes to USB, some of them are at the swd header
another 1 or 2 pins is used at the 32 khz crystal
and possibly some may not be broken out
mainly, for gpios they need to have PAxx ... Pyxx naming

for more pins, 'usual' solutions are:
- get a bigger chip/board e.g RE, RG suffix series, VE, VG suffix series, or even ZE, ZG series
- use 'io extenders' chips
- use shift registers e.g. 74hc595
https://www.nexperia.com/products/analo ... CT595.html
- use multiplexers
- use buses - this is the most interesting, e.g. 74hc245?
https://www.nexperia.com/products/analo ... CT245.html
(74hc245 are 'cheap', i'd think mainly because it is widely stocked, often 'abused' as 'buffers'
https://www.aliexpress.com/wholesale?ca ... xt=74hc245
(e.g. share 8 pins between a few 74hc245, I think they can be 'tristated', in that way maybe you can 'enable' banks of 8 pins of 74hc245 by controlling the tristate), but of course this is more troublesome and not always possible.
buses are 'hard' as you need to arbitrate the bus access, e.g. round robin etc, more or less multiplexing.

i found something even more exoteric
74hc573 octal latch
https://www.nexperia.com/products/analo ... CT573.html
that makes it output with memory
dannyf
Posts: 446
Joined: Sat Jul 04, 2020 7:46 pm

Re: How many GPIO pins is the Blue Pill supposed to have?

Post by dannyf »

Or you can use another mcu as a slave. You get to design our own protocol.
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 26
Location: Prudnik, Poland

Re: How many GPIO pins is the Blue Pill supposed to have?

Post by GonzoG »

PD0 and PD1 are used for external 8MHz crystal.
Post Reply

Return to “General discussion”