Page 1 of 2
Using the internal (HSI) generator f103c8t6
Posted: Thu Jan 23, 2020 6:44 pm
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?
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 9:22 am
by stevestrong
I think it is enough to insert into board.h of your variant
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 9:52 am
by stm32_discover
Hi Steve, thanks,I'll try it
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 11:42 am
by stm32_discover
I just tried adding
but it didn't help, the processor doesn't work. I use Roger's core
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 12:47 pm
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
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 1:15 pm
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
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 1:19 pm
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?
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 1:21 pm
by stm32_discover
yep, the board is custom
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 1:23 pm
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.
Re: Using the internal (HSI) generator f103c8t6
Posted: Fri Jan 24, 2020 1:27 pm
by stm32_discover
ok, I'll try it