Page 1 of 1

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

Posted: Thu Oct 06, 2022 3:19 pm
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.

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

Posted: Thu Oct 06, 2022 3:44 pm
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

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

Posted: Thu Oct 06, 2022 10:01 pm
by dannyf
Or you can use another mcu as a slave. You get to design our own protocol.

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

Posted: Fri Oct 07, 2022 12:01 am
by GonzoG
PD0 and PD1 are used for external 8MHz crystal.