Tell me more ×
Electrical Engineering Stack Exchange is a question and answer site for electronics and electrical engineering professionals, students, and enthusiasts. It's 100% free, no registration required.

I am working with an ARM Cortex M3 chip (reference manual available here). I'm trying to get the baud rate of my USART communications right. Reading pages 613 onwards, I understand that the value I should set for USARTDIV depends on the clock rate of AHB1 (since I am working with USART3, governed by the AHB1 clock).

Looking at pages 614 onwards, I see that the clock rate f_PCLK can take many different values (8MHz, 12Mhz, etc.). However, I cannot see anywhere where I can set the speed of that clock.

How can I measure/change/read the speak of the AHB1 clock?

share|improve this question

1 Answer

up vote 4 down vote accepted

Page 83 of the reference manual has a clock tree diagram. This will help you see where the clocks come from.

The PCLK is a peripheral clock and will depend on the clock source and the prescaler values. The AHB, APB and other prescaler values are set in the system_stm32f2xx.c file.

share|improve this answer
Thanks! Do you understand what the line __I uint8_t AHBPrescTable[16] = {0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 6, 7, 8, 9}; exactly means? – Randomblue Mar 20 '12 at 16:20
It's an array that is used to set the SystemCoreClock variable. Search for both AHBPrescTable and SystemCoreClock and you should be able to figure out what's going on. – Armandas Mar 20 '12 at 16:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.