Reputation: 47
in the Armv7-M,is say Systick:
The timer is clocked by a reference clock. Whether the reference clock is the processor clock or an external clock source is implementation defined.
1.whether has a clock source inside the CPU? because it say processor clock not mcu clock
if has ,then how fast it is
2.above leads to another confuse :the HSI the I
which means inside the mcu outside the cpu or inside the cpu
Upvotes: 0
Views: 363
Reputation: 71506
You need to understand that armv7-m is an architecture specification from arm related to arm products. Then there are arm products that you can buy for example the cortex-m4. Then there are chip companies like st that make a wide array of stm32 products (using various arm products for the core processor ip but the rest of the chip is st IP or IP that st purchased from other vendors (not arm)). Arm docs are strictly specific to arm products (the cortex-m4 for example).
What this is saying that if you look at the register and bits specified you see
CLKSOURCE, bit[2] Indicates the SysTick clock source:
0 SysTick uses the IMPLEMENTATION DEFINED external reference clock.
1 SysTick uses the processor clock.
If no external clock is provided, this bit reads as 1 and ignores writes
This implies and means that ARM has provided, obviously, a processor clock input for the cortex-m4 IP. But also there is an additional processor clock input for systick that can be used instead of the processor clock. This probably has an additional strap to the IP that indicates if the chip vendor has wired up this clock input covering the general comment at the end of that description. Giving the chip vendor options.
Arm ends there now you go into the chip implementation from some chip vendor that has purchased and included this IP in their product. Some ARM BASED product. "external" in this case would imply the the chip vendor and not arm, does not necessarily imply outside of the chip. Just outside the IP.
LSI/HSI is not related to ARM at all, it is probably specific to one chip vendor and specific family of products or a specific product. The use cases I have seen for those "terms" is where MCUs very often come with an "internal" clock. This is not crystal based this is an unstable R/C circuit that is kinda close to some frequency but varies with temperature, etc. Even if "calibrated" by the chip vendor per chip, it is still not very accurate. Because some MCUs have a real time clock that often wants to have a higher precision clock source, which for cost means a low speed crystal or oscillator that is affordable in a higher accuracy. Where the same accuracy for the main oscillator can be cost prohibitive. So some of these MCU designs may have not only an external system clock option for a crystal based solution outside of the MCU chip itself. But may also provide an additional external clock solution for the low speed clock tree, the RTC or other peripherals.
The I in the HSI you are probably asking about is High Speed Internal. Some r/c based INTERNAL (as in inside the mcu) clock reference used as the default SYSTEM clock source for all or almost all of the clock tree within the chip. Being R/C based (resistor/capacitor). So yes I in HSI probably means internal for the CHIP you are looking at.
This question is on a programming site not electrical engineering, you can google R/C oscillator to learn more. Some will also know about R/C filters. Capacitors can be thought of as tiny rechargeable batteries that charge slowly but that can discharge quickly. The R is resistor and it resists, it controls the rate of a charge, so for an R/C filter the combination of a specific capacitor and specific resistor can limit the rate of a signals change, creating a filter (passive low pass filter, allowing lower frequency signals through and filtering out higher frequency). Now create an unstable circuit around this filter using feedback, etc. And you are limiting the speed of that unstable circuits oscillation. With experience and proper components you can get it close to a specific frequency and that is what is used in most MCUs as most MCUs you buy today can be used without an external crystal for cost reasons (not accurate, but for a lot of use cases, good enough). You may find that for example using an internal clock source the uart may not "work" all the time when connected to other systems like your host computer for debugging, because the clock is not accurate enough all the time.
Upvotes: 1
Reputation: 1525
For the core peripherals of the MCU you need an STM document called "Programming manual", you can search the internet as "STM32xxxx programming manual", and it will show you a PDF for your specific line of the MCUs (F7, F4, F0 etc.). There you can find core peripherals - NVIC, SysTick and a few more. That part of the manual acts pretty much as reference manual, but for the core peripherals - you see a list of registers, and what bits in them do.
SysTick is one of the smallest peripheral with 4 registers (their names vary between MCUs, but they do exactly the same thing - reload value, counter, control, calibration - not in this order), and there is a clock source selection bit. It can either be clocked by the core clock (set clock source bit), which is always an option, or by another clock, depending on your specific MCU (clock source bit reset), the programming manual for your MCU will specify what exactly the other clock option for your specific MCU is.
"Processor clock" is synonymous to "core clock" (at least in this context), and "MCU clock" is too vague, because there are a lot of clocks inside the MCU (AHB clock, APBx clocks, PLLs for some specific peripherals, LSI, HSI, etc., all run at their own frequencies). Colloquially, "MCU clock" can refer to "processor clock".
STM32s typically have 4 possible clock sources (with the exception of externally provided clock signal):
LSI - Low Speed Internal (typically 32kHz or 40kHz)
HSI - High Speed Internal - Your MCU boots with it (typically 8MHz or 16MHz)
LSE - Low Speed External (typically 32.768kHz for RTC)
HSE - High Speed External (typically 8MHz-25MHz XTAL)
Internal clock sources are outside the CPU core itself, but they're inside the MCU.
Refer to RCC section of the reference manual for details regarding your specific MCU's clock configuration.
Upvotes: 1
Reputation: 5470
In the ARMv7M ARM B3.3.3 it says that the SysTick is clocked by either the processor core clock or an implementation defined clock, depending on the value of the the CLKSOURCE bit in the SYST_CSR register.
In STM32 the implementation defined clock is the AHB (host bus) clock divided by eight.
Both of these can come from a wide range of sources including HSI or HSE with different speeds. See eg: figure 16 in RM0090.
Upvotes: 1