We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
Hello all,
the way we calculate 1 machine cycle period in 8051 clock = 12MHz then 1m/c = 1/ (12MHz / 12) = 1 usec
In case of ARM7, I have peripheral clock for timer = 12Mhz (after doing all the calculations of PLL) can you guide me the time period of 1 machine cycle in case of ARM7. does it mean 1 m/c = (1/12Mhz) = 83 nsec
Please guide..
Thanks and regards.
Hello all, Please guide me. Thank you
Nobody uses the term 'machine cycle' in connection with ARM CPU's. It's irrelevant and confusing, as you have demonstrated. Instead, people tend to use terms line 'CPU clock cycle', 'peripheral bus clock cycle' and so on.
Hello Mike, Thanks for reply. you are right. but does that mean peripheral clock cycle = 1/12MHz = 83nsec I want to generate timer clock = 5 msec I can use the formula to generate 5msec but I want to know whether one timer tick = 83nsec as peripheral clock = 12Mhz for timer. Is it right? thanks
This kind of information would be in the datasheet and/or user manual for your MCU. I can't read them for you since you did not say which MCU you are using.
Hello Mike, I am using lpc2387. and timer is running at 12Mhz. and it is not mentioned in datasheet about machine cycle. thanks
a similar example I think you are looking for can be found in the STM32F2-F4 demonstration Builder project.
It offers this and an ISR timer for the F2 device the clock is 120Mhz
void USB_OTG_BSP_uDelay (const uint32_t usec) { #ifdef USE_ACCURATE_TIME BSP_Delay(usec,TIM_USEC_DELAY); #else __IO uint32_t count = 0; const uint32_t utime = (120 * usec / 7); do { if ( ++count > utime ) { return ; } } while (1); #endif }