2005-03-17 03:07 AM
2005-03-13 08:18 PM
Hello,
i'm trying to understand the influence of clock speeds to the speed of GPIO-Pins, but have some difficulties. I am using the 711FR2 running with 16 MHz external clock. For testing, i modified the 'blinky'-example-projekt, running from Flash. My clock-configuration is: RCCU_MCLKConfig(RCCU_DEFAULT); RCCU_FCLKConfig(RCCU_RCLK_2); RCCU_PCLKConfig(RCCU_RCLK_4); RCCU_PLL1Config(RCCU_Mul_12, RCCU_Div_2); while (RCCU_FlagStatus(RCCU_PLL1_LOCK) == RESET); RCCU_RCLKSourceConfig(RCCU_PLL1_Output); So i believe MCLK is running on 48 MHz, PCLK (APB1) on 12 MHz and FCLK (APB2) on 24 MHz. now i made an XTI-interrupt that changes pin 2 on GPIO1: void XTI_IRQHandler(void) __arm { u8 n; for (n=0; n GPIO1->PD ^= 0x0004; GPIO1->PD ^= 0x0004; } XTI_PendingBitClear(XTI_InterruptLineValue()); } the result are 0,6 µs long pulses starting 4,2 µs after the triggering edge (this seems to be a bit slow?). Changing FCLK (XTI and GPIO are on APB2) to RCLK/4 (12 MHz) and even to RCLK/8 (6 MHz) makes no difference to the length of the pulses oder the delay between the edge und the pulses?! Changing MCLK to 24 MHz makes the pulses 0,7 µs long and the delay 6,1 µs. Here i expected the double time when using half frequency?! So i wonder if the device really does what i believe having configured. Did i forget any clock-settings? Has debug-mode (but without using breakpoints) that strong effect to device speed? regards, HKoch [ Diese Nachricht wurde editiert von : HKoch on 14-03-2005 09:54 ]2005-03-14 09:32 PM
Hi RISC!
is that a new version of the sw-library you are using? ''RCCU_PLL1Config(RCCU_PLL1_Mul_12, RCCU_Div_2)'' should be ''RCCU_PLL1Config(RCCU_Mul_12, RCCU_Div_2)'' with Rev. 1.3 Reading your example code, i recognize the APB2-Clock is configured by RCCU_PCLKConfig. The technical-training-PPT (I am sure i got it from the ST-Homepage but cannot find it there anymore?!) shows on page 23 a table where PCLK is related to APB1 an FCLK to APB2. That seems to be an error. Changing PCLK leads me to similar results as you posted above. Is that the maximum speed i can have on GPIO or can i reach more with some other methods? Thank you, HKoch2005-03-14 11:44 PM
Another common solution is to run time sensitive code from ram, leaving the main code in flash.
As internal ram is much faster than flash. Regards sjo2005-03-16 03:01 AM
Hello,
what will be the speed factor when running from RAM instead of FLASH with the same value for MCLK? Regards, HKoch2005-03-17 03:07 AM
Quote:
On 15-03-2005 at 12:41, RISC wrote: Hello HKoch, TheGPIO speed depend on what you want exactely: - Do you need a re-entrant IRQ handlers? (This may afect the delay) - Do you want to reduce the pulse length? (Use assembler and avoid the loop) I need fast response to interrupts, with each interrupt-Handler running only once at the same time. So i think ich do not need re-entrant interrupt-handlers. Searching both reference-manual and sw-lib-manual i did not find anything about re-entrant and not-re-entrant interrupt-handlers. Does it depend on IRQ-Priority? Or is it just using local or external variables? Pulse length on GPIO is not that important, because i will have to use BSPI und USB for communication and GPIO only for status-LEDs. I think GPIO will never reach the speed of the SPI (1,5MHz at the moment, possibly 2MHz later on....) Regards, HKoch