cancel
Showing results for 
Search instead for 
Did you mean: 

Nucleo board 64 F070 Crystal output Problem

thannara123
Senior

Hi 'I am using STM32 Nulceo Board Nucleo-F070RB .

I tried some projects but the output of the project is not as expected ,shows some wrong calculation out .

So I checked everything ,And found out the Crystal frequancy is not correct .

I checked the Master Clock Output But here i am not getting the clock frequency ,

May i get the accurate frequency there ?

I  tried the internal HSI also But nothing gain 

 

When I select HSI is 8MHZ i am getting in MCO out is 1.724KHz  is it board problem ?

what wrong i am with ,   

please help me 

10 REPLIES 10
AScha.3
Chief III

Hi,

>And found out the Crystal frequancy is not correct

How you know ? 

+

Show your clock tree , so i can see something ... !

If you feel a post has answered your question, please click "Accept as Solution".
thannara123
Senior

Screenshot 2024-04-27 at 9.09.37 PM.png

see the clock tree I am checking on logic 2 logic analyzer 

thannara123
Senior

When I try TIM1 to generate a siganl 

Here Timer Clk is 8MHZ no prescalar 

ARR is 1 

so it will be the half of the signal will be timer output ie,4Mhz but here i am getting 11.08 khz 

void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim)

{ if (htim->Instance == TIM1)

HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_8); // this pin is used as output signal 

 

} }

 

Screenshot 2024-04-27 at 9.26.11 PM.png

 

at diffrent ARR value nothing happen 11.08khz is the out .is this cub ide bug ? or what is the problem ?

Ok, you want the cpu run at only 8 MHz ? why ?

+

>HAL_GPIO_TogglePin(GPIOC, GPIO_PIN_8); // this pin is used as output signal

This is just toggle the pin in software - has nothing to do with any timer !

 

MCO is set to HSI - not pllclk .

------------

so for 40MHz set clock tree:

AScha3_0-1714234408649.png

+

To do some timer output, set any output active : or all ->

AScha3_1-1714236333906.png

here my setting, as example:

AScha3_2-1714236390687.png

 

 

If you feel a post has answered your question, please click "Accept as Solution".
thannara123
Senior

Hi 

I think Nuleao Board is faulty , when i just try a single channel PWM 

TIM15->CCR1 = 50;

HAL_TIM_PWM_Start(&htim15,TIM_CHANNEL_1);

it dosent shows the 50 duty cycle square wave . 

shows some of 30 % off and 70% On 

:slightly_frowning_face:

Hi,

>TIM15->CCR1 = 50;

and what you set : Counter Period (AutoReload Register)  ?

If you feel a post has answered your question, please click "Accept as Solution".
thannara123
Senior

I set the value of duty cycle to 50%

There is no "xx%" setting.

If you want 50% , at CCR1 = 50 , you have to set  the Counter Period  to 100 cycles (100 - 1  = 99 , in ARR register , Counter Period (AutoReload Register)).

Did you ?

If you feel a post has answered your question, please click "Accept as Solution".
thannara123
Senior

The Counter Period decide is the full period of the timer output ? isnt it ?