Black Pill miss alignment between PB12 ~ PB15 and PB_12 ~ PB_15

Post here first, or if you can't find a relevant section!
Post Reply
heretop
Posts: 39
Joined: Sun Jun 20, 2021 2:09 pm

Black Pill miss alignment between PB12 ~ PB15 and PB_12 ~ PB_15

Post by heretop »

There is miss alignment between PB12 ~ PB15 and PB_12 ~ PB_15 for black pill.
Value for PB12 ~ PB15 is 27 ~30
Value for PB_12 ~ PB_15 is 28 ~ 31
It can be test by

Code: Select all

void setup(void) {
  Serial1.begin(9600);
}

void loop() {
  Serial1.print(PB12);
  Serial.print("\t");
  Serial1.print(PB13);
  Serial.print("\t");
  Serial1.print(PB14);
  Serial.print("\t");
  Serial1.println(PB15);
  Serial1.print(PB_12);
  Serial.print("\t");
  Serial1.print(PB_13);
  Serial.print("\t");
  Serial1.print(PB_14);
  Serial.print("\t");
  Serial1.println(PB_15);
  Serial1.println(PB_11);
  delay(1000);
}
The result shown here
Capture.PNG
Capture.PNG (10.74 KiB) Viewed 2418 times
I also print out the PB_11, however Black Pill FC411CE does not have PB11 on the board as shown in the picture below.
Image

I try to directly call the 'PB11', but it got error here

Code: Select all

test_pin:20:19: error: 'PB11' was not declared in this scope; did you mean 'PB_11'?
   20 |   Serial1.println(PB11);
      |                   ^~~~
      |                   PB_11
exit status 1
'PB11' was not declared in this scope; did you mean 'PB_11'?
So 'PB_11' here might be the one cause the problem. Moreover the later pin will probably also been affected, haven't tested yet.

My computer development environment is: Windows 10 19043.1165, arduino IDE 1.8.16, core 2.0.0, upload method SWD through ST-LINK
Capture2.PNG
Capture2.PNG (9.05 KiB) Viewed 2418 times
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: Black Pill miss alignment between PB12 ~ PB15 and PB_12 ~ PB_15

Post by fpiSTM »

There is no issue.
PB12 is the pin number while PB_12 is the pin name which is a combination of GPIO Port and pin.
For PB11(pin number) as it is not available physically on the board, it is simply not defined.
Post Reply

Return to “General discussion”