2012-05-15 02:57 AM
Hi everyone,
I am using STM32F4 Discovery evaluation board and Atollic TrueStudio. My problem is a fast I/O handling i want to generate signal frequency at 84 MHz. I'm getting ~15 MHz if I use while (1) { GPIOD->BSRRH = GPIO_Pin_13; GPIOD->BSRRL = GPIO_Pin_13; } How to achieve 84 MHz? Do I need to initialize the timer and pwm? Thanks #i/o-handling2012-05-15 04:14 AM
I am using STM32F4 Discovery evaluation board and Atollic TrueStudio. My problem is a fast I/O handling i want to generate signal frequency at 84 MHz. I'm getting ~15 MHz if I use
while (1) {
GPIOD->BSRRH = GPIO_Pin_13;
GPIOD->BSRRL = GPIO_Pin_13;
}
How to achieve 84 MHz? Do I need to initialize the timer and pwm? Seeing as how the APB access is going to take at least 4 cycle apiece writing to the GPIO pin is not going to be an efficient way to toggle the pin. For 84 MHz, you'd want to look at the MCO pins and configuration. Other frequencies can be generated via the timers, and will depend on your ability to factor the prescaler and period. ie integer multiples.
2012-05-15 08:51 AM
2012-05-16 06:17 AM
''How to achieve 84 MHz? Do I need to initialize the timer and pwm?''
Yes, pls use Timer. GPIOs switching is not a good idea. Moreover, you will not have time to execute other instructions if the code is only doing GPIO toggle. btw, 84Mhz is specif value. Why do you need this freq ?
2012-05-21 12:39 AM