Using the internal (HSI) generator f103c8t6
-
- Posts: 7
- Joined: Thu Jan 23, 2020 12:00 pm
Using the internal (HSI) generator f103c8t6
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?
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: Using the internal (HSI) generator f103c8t6
I think it is enough to insert into board.h of your variant
Code: Select all
#define USE_HSI_CLOCK 1
-
- Posts: 7
- Joined: Thu Jan 23, 2020 12:00 pm
Re: Using the internal (HSI) generator f103c8t6
Hi Steve, thanks,I'll try it
-
- Posts: 7
- Joined: Thu Jan 23, 2020 12:00 pm
Re: Using the internal (HSI) generator f103c8t6
I just tried adding
but it didn't help, the processor doesn't work. I use Roger's core
Code: Select all
#define USE_HSI_CLOCK 1
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: Using the internal (HSI) generator f103c8t6
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:
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
-
- Posts: 7
- Joined: Thu Jan 23, 2020 12:00 pm
Re: Using the internal (HSI) generator f103c8t6
I use a processor without usb. Programming via st-link v2
Here is a simple sketch. But didn't work
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);
}
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: Using the internal (HSI) generator f103c8t6
I will make a test in the evening with a bluepill.
Have you tried a bluepill board? Or do you use a custom board?
Have you tried a bluepill board? Or do you use a custom board?
-
- Posts: 7
- Joined: Thu Jan 23, 2020 12:00 pm
Re: Using the internal (HSI) generator f103c8t6
yep, the board is custom
-
- Posts: 505
- Joined: Fri Dec 27, 2019 4:53 pm
- Location: Munich, Germany
- Contact:
Re: Using the internal (HSI) generator f103c8t6
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.
First try a bluepill board, and if it works there, then you have to search for an eventual hardware error on your custom board.
-
- Posts: 7
- Joined: Thu Jan 23, 2020 12:00 pm
Re: Using the internal (HSI) generator f103c8t6
ok, I'll try it