2011-11-30 07:58 PM
Hi,all
I want to use the STM32L's RTC counter as system logic clock as I did using STM32F, but I found no way to do this. My application needs low power and high time resolution(about 100us). Any suggestions will be appreciated :) Thanks. #rtc-counter #stm32l-discovery2011-12-02 07:35 AM
I want to use the STM32L's RTC counter as system logic clock as I did using STM32F, but I found no way to do this. My application needs low power and high time resolution(about 100us). Any suggestions will be appreciated :)
Over what kind of periods? If the core is clocking over the periods you want, you could always look at the core's cycle counter. I haven't check it on the L1 series, but it's been part of the trace unit bolted to all ST's other M3 cores. As I recall you can deal with nearly a minute with around 14 ns resolution. Clearly depending on your system clock. // From http://forums.arm.com/index.php?showtopic=13949 volatile unsigned int *DWT_CYCCNT = (volatile unsigned int *)0xE0001004; //address of the register volatile unsigned int *DWT_CONTROL = (volatile unsigned int *)0xE0001000; //address of the register volatile unsigned int *SCB_DEMCR = (volatile unsigned int *)0xE000EDFC; //address of the register *SCB_DEMCR = *SCB_DEMCR | 0x01000000; *DWT_CYCCNT = 0; // reset the counter, read this register for clock ticks *DWT_CONTROL = *DWT_CONTROL | 1 ; // enable the counter