Using the internal (HSI) generator f103c8t6

Post here all questions related to LibMaple core if you can't find a relevant section!
stm32_discover
Posts: 7
Joined: Thu Jan 23, 2020 12:00 pm

Using the internal (HSI) generator f103c8t6

Post by stm32_discover »

Hello everyone, coul'd you please tell me how to initialize the internal clock generator when using generic f103c8t6 in arduino ide 1.8.10?
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Using the internal (HSI) generator f103c8t6

Post by stevestrong »

I think it is enough to insert into board.h of your variant

Code: Select all

#define USE_HSI_CLOCK 1
stm32_discover
Posts: 7
Joined: Thu Jan 23, 2020 12:00 pm

Re: Using the internal (HSI) generator f103c8t6

Post by stm32_discover »

Hi Steve, thanks,I'll try it
stm32_discover
Posts: 7
Joined: Thu Jan 23, 2020 12:00 pm

Re: Using the internal (HSI) generator f103c8t6

Post by stm32_discover »

I just tried adding

Code: Select all

#define USE_HSI_CLOCK 1
but it didn't help, the processor doesn't work. I use Roger's core
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Using the internal (HSI) generator f103c8t6

Post by stevestrong »

How do you determine whether the processor works or not?
Have you tried a simple blinky sketch?
Be aware, that when using HSI in the current software configuration, the USB will not work, so you will not have USB Serial.

EDIT
if you want to have USB serial, then you have to limit the CPU speed to 48MHz.
In this case you have to set/define F_CPU = 48000000, and change line 62 to:

Code: Select all

#define BOARD_RCC_PLLMUL RCC_PLLMUL_12
stm32_discover
Posts: 7
Joined: Thu Jan 23, 2020 12:00 pm

Re: Using the internal (HSI) generator f103c8t6

Post by stm32_discover »

I use a processor without usb. Programming via st-link v2

Code: Select all

#define USE_HSI_CLOCK 1

void setup() {
  // put your setup code here, to run once:
pinMode(PA0,OUTPUT);
pinMode(PA1,OUTPUT);
}

void loop() {
  // put your main code here, to run repeatedly:
digitalWrite(PA0,HIGH);
digitalWrite(PA1,HIGH);
delay(1000);
digitalWrite(PA0,LOW);
digitalWrite(PA1,LOW);
delay(1000);
}
Here is a simple sketch. But didn't work
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Using the internal (HSI) generator f103c8t6

Post by stevestrong »

I will make a test in the evening with a bluepill.
Have you tried a bluepill board? Or do you use a custom board?
stm32_discover
Posts: 7
Joined: Thu Jan 23, 2020 12:00 pm

Re: Using the internal (HSI) generator f103c8t6

Post by stm32_discover »

yep, the board is custom
stevestrong
Posts: 502
Joined: Fri Dec 27, 2019 4:53 pm
Answers: 8
Location: Munich, Germany
Contact:

Re: Using the internal (HSI) generator f103c8t6

Post by stevestrong »

Well, then I cannot guess what it can be wrong on that.
First try a bluepill board, and if it works there, then you have to search for an eventual hardware error on your custom board.
stm32_discover
Posts: 7
Joined: Thu Jan 23, 2020 12:00 pm

Re: Using the internal (HSI) generator f103c8t6

Post by stm32_discover »

ok, I'll try it
Post Reply

Return to “General discussion”