I am curious about the function of STM32F103C8T6 'Pinmap'.

Post here first, or if you can't find a relevant section!
Post Reply
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

I am curious about the function of STM32F103C8T6 'Pinmap'.

Post by myksj1105 »

I am curious about the function of STM32F103C8T6 'Pinmap'.

hello. Nice to meet you.

Please look at the image.

Image

- Serial1 : PB_6, PB_7
- Serial1 : PA_9, PB_10

What do you mean?
If you use the 'Serial1' function above, are 'PB_6,7' and 'PA_9,10' executed at the same time? Why are the same features expressed on different pins? If, in the source code

Code: Select all

Serial1.begin(115200);
Serial1.println("TEST");
When the above source code is written, where is the output between 'PB_6,7' and 'PA_9,10'?

Similarly, where does SPI1 output to?
by GonzoG » Wed Jun 21, 2023 6:55 pm
myksj1105 wrote: Tue Jun 20, 2023 11:10 pm ...
By any chance, if you want to do Serial1 through 'PB6 and PB7',
How should I set it as source code?
can you give me an example? (You must be busy, sorry for asking.)
With STM32 core it's easy:

Code: Select all

Serial1.setTX(pin);
Serial1.setRx(pin);
You'll find it on STM32duino wiki:
https://github.com/stm32duino/Arduino_C ... 2/wiki/API
Go to full post
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: I am curious about the function of STM32F103C8T6 'Pinmap'.

Post by GonzoG »

On STM32 interfaces have alternate pins. It's done this way so you can choose which pins to use.
For example by default U(S)ART1 uses PA9 and PA10, but you change it to PB6 and PB7.
Same thing with SPI. By default SPI1 uses PA4-PA7, but if you need those pins as analog inputs, you can set SPI1 to use PA15, PB3-PB5.
Default and alternate functions for pins you'll find in MCU datasheet.
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: I am curious about the function of STM32F103C8T6 'Pinmap'.

Post by myksj1105 »

GonzoG wrote: Tue Jun 20, 2023 10:51 pm On STM32 interfaces have alternate pins. It's done this way so you can choose which pins to use.
For example by default U(S)ART1 uses PA9 and PA10, but you change it to PB6 and PB7.
Same thing with SPI. By default SPI1 uses PA4-PA7, but if you need those pins as analog inputs, you can set SPI1 to use PA15, PB3-PB5.
Default and alternate functions for pins you'll find in MCU datasheet.
@GonzoG

Thank you for your kind reply.

By any chance, if you want to do Serial1 through 'PB6 and PB7',
How should I set it as source code?
can you give me an example? (You must be busy, sorry for asking.)
GonzoG
Posts: 403
Joined: Wed Jan 15, 2020 11:30 am
Answers: 27
Location: Prudnik, Poland

Re: I am curious about the function of STM32F103C8T6 'Pinmap'.

Post by GonzoG »

myksj1105 wrote: Tue Jun 20, 2023 11:10 pm ...
By any chance, if you want to do Serial1 through 'PB6 and PB7',
How should I set it as source code?
can you give me an example? (You must be busy, sorry for asking.)
With STM32 core it's easy:

Code: Select all

Serial1.setTX(pin);
Serial1.setRx(pin);
You'll find it on STM32duino wiki:
https://github.com/stm32duino/Arduino_C ... 2/wiki/API
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: I am curious about the function of STM32F103C8T6 'Pinmap'.

Post by myksj1105 »

@GonzoG

Wow...

understood at once.
Thank you.
can be used sufficiently.
thank you
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: I am curious about the function of STM32F103C8T6 'Pinmap'.

Post by myksj1105 »

@GonzoG

Code: Select all

STM_PWM_v230624:47:11: error: 'class HardwareSerial' has no member named 'setTX'
   Serial1.setTX(PB6);   Serial1.setRx(PB7);           ^
STM_PWM_v230624:47:33: error: 'class HardwareSerial' has no member named 'setRx'
   Serial1.setTX(PB6);   Serial1.setRx(PB7);                                 ^
C:\Users\user\Desktop\STM_PWM_v230624\STM_PWM_v230624.ino: In function 'void loop()':
STM_PWM_v230624:91:18: error: return-statement with a value, in function returning 'void' [-fpermissive]
           return response;                  ^
exit status 1
'class HardwareSerial' has no member named 'setTX'

Code: Select all

Serial1.setTX(pin);
Serial1.setRx(pin);
not work.

Do I need to download a library or something? please answer about my question.
User avatar
fpiSTM
Posts: 1738
Joined: Wed Dec 11, 2019 7:11 pm
Answers: 91
Location: Le Mans
Contact:

Re: I am curious about the function of STM32F103C8T6 'Pinmap'.

Post by fpiSTM »

You do not use the STM32 core but this one : https://github.com/rogerclarkmelbourne/Arduino_STM32
That's why it does not build.
myksj1105
Posts: 54
Joined: Sun Jun 18, 2023 11:35 am

Re: I am curious about the function of STM32F103C8T6 'Pinmap'.

Post by myksj1105 »

@fpiSTM

@fpiSTM

I used the same core.

Image

By the way, the curious thing is that the pin map is different.
Please look at the image.
Why is the function of PINMAP different even though it is the same chip?
Post Reply

Return to “General discussion”