參數(shù)資料
型號: ST72651R4
英文描述: ST7 - LOW-POWER. FULL-SPEED USB 8-BIT MCU WITH 32K FLASH. 5K RAM. FLASH CARD I/F. TIMER. PWM. ADC. I2C
中文描述: ST7的-低功耗。全速USB 8位32K快閃微控制器。 5K內(nèi)存。閃存卡的I /樓計時器。脈寬調(diào)制。 ADC的。的I2C
文件頁數(shù): 150/166頁
文件大?。?/td> 2089K
代理商: ST72651R4
ST7265x
84/166
16-BIT TIMER (Cont’d)
11.4.3.2 Output Compare
In this section, the index,
i, may be 1 or 2 because
there are 2 output compare functions in the 16-bit
timer.
This function can be used to control an output
waveform or indicate when a period of time has
elapsed.
When a match is found between the Output Com-
pare register and the free running counter, the out-
put compare function:
– Assigns pins with a programmable value if the
OCIE bit is set
– Sets a flag in the status register
– Generates an interrupt if enabled
Two 16-bit registers Output Compare Register 1
(OC1R) and Output Compare Register 2 (OC2R)
contain the value to be compared to the counter
register each timer clock cycle.
These registers are readable and writable and are
not affected by the timer hardware. A reset event
changes the OCiR value to 8000h.
Timing resolution is one count of the free running
counter: (
fCPU/CC[1:0]).
Procedure:
To use the output compare function, select the fol-
lowing in the CR2 register:
– Set the OC
iE bit if an output is needed then the
OCMP
i pin is dedicated to the output compare i
signal.
– Select the timer clock (CC[1:0]) (see Table 27
And select the following in the CR1 register:
– Select the OLVL
i bit to applied to the OCMPi pins
after the match occurs.
– Set the OCIE bit to generate an interrupt if it is
needed.
When a match is found between OCRi register
and CR register:
– OCF
i bit is set.
– The OCMP
i pin takes OLVLi bit value (OCMPi
pin latch is forced low during reset).
– A timer interrupt is generated if the OCIE bit is
set in the CR2 register and the I bits are cleared
in the CC register (CC).
The OCiR register value required for a specific tim-
ing application can be calculated using the follow-
ing formula:
Where:
t
= Output compare period (in seconds)
fCPU
= CPU clock frequency (in hertz)
PRESC = Timer prescaler factor (2, 4 or 8 de-
pending on CC[1:0] bits, see Table 27
If the timer clock is an external clock, the formula
is:
Where:
t
= Output compare period (in seconds)
fEXT
= External timer clock frequency (in hertz)
Clearing the output compare interrupt request (i.e.
clearing the OCF
i bit) is done by:
1. Reading the SR register while the OCF
i bit is
set.
2. An access (read or write) to the OC
iLR register.
The following procedure is recommended to pre-
vent the OCF
i bit from being set between the time
it is read and the write to the OCiR register:
– Write to the OC
iHR register (further compares
are inhibited).
– Read the SR register (first step of the clearance
of the OCF
i bit, which may be already set).
– Write to the OC
iLR register (enables the output
compare function and clears the OCF
i bit).
MS Byte
LS Byte
OC
iROCiHR
OC
iLR
OCiR =
t * fCPU
PRESC
OCiR = t
* fEXT
相關(guān)PDF資料
PDF描述
ST72651R6 SODIMM MEMORY MODULE, 64MB, INDUSTRIAL TEMP
ST72651R6T1 ST7 - LOW-POWER. FULL-SPEED USB 8-BIT MCU WITH 32K FLASH. 5K RAM. FLASH CARD I/F. TIMER. PWM. ADC. I2C
ST72652R4T1 ST7 - LOW-POWER. FULL-SPEED USB 8-BIT MCU WITH 32K FLASH. 5K RAM. FLASH CARD I/F. TIMER. PWM. ADC. I2C
ST7271J1B1 8-BIT MICROCONTROLLER
ST7271N1B1 8-BIT MICROCONTROLLER
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
ST7265X-EVAL/MS 制造商:STMicroelectronics 功能描述:ST6 EVAL BD - Bulk
ST7265X-EVAL/PFD 制造商:STMicroelectronics 功能描述:USB FLASH EVAL - Bulk
ST7266 制造商:6940 功能描述:ST7266
ST7267C8T1L 制造商:STMicroelectronics 功能描述:
ST72681/R12 制造商:STMicroelectronics 功能描述:CONTROLLER FOR HIGH-PERFORMANCE BUS-POWERED USB 2.0 FLASH DR - Trays