Page 1 of 1

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

Posted: Tue Jun 20, 2023 7:58 pm
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?

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

Posted: Tue Jun 20, 2023 10:51 pm
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.

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

Posted: Tue Jun 20, 2023 11:10 pm
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.)

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

Posted: Wed Jun 21, 2023 6:55 pm
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

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

Posted: Thu Jun 22, 2023 5:30 am
by myksj1105
@GonzoG

Wow...

understood at once.
Thank you.
can be used sufficiently.
thank you

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

Posted: Sun Jun 25, 2023 12:16 am
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.

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

Posted: Sun Jun 25, 2023 5:42 am
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.

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

Posted: Sun Jun 25, 2023 10:06 am
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?