ST7232AK1B1 Datasheet

  • ST7232AK1B1

  • 8-BIT MCU WITH 8K FLASH/ROM, ADC, 4 TIMERS, SPI, SCI INTERFA...

  • 1290.53KB

  • 154页

  • STMICROELECTRONICS   STMICROELECTRONICS

扫码查看芯片数据手册

上传产品规格书

PDF预览

ST7232A
16-BIT TIMER
(Cont鈥檇)
10.3.3.4 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.
OCiR
MS Byte
OCiHR
LS Byte
OCiLR
鈥?The OCMPi 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 CR1 register and the I bit is cleared in
the CC register (CC).
The OC
i
R register value required for a specific tim-
ing application can be calculated using the follow-
ing formula:
鈭?/div>
OCiR =
鈭唗
*
f
CPU
PRESC
Where:
鈭?/div>
t
= Output compare period (in seconds)
f
CPU
= CPU clock frequency (in hertz)
PRESC
= Timer prescaler factor (2, 4 or 8 de-
pending on CC[1:0] bits, see
Table 16
Clock Control Bits)
If the timer clock is an external clock, the formula
is:
These registers are readable and writable and are
not affected by the timer hardware. A reset event
changes the OC
i
R value to 8000h.
Timing resolution is one count of the free running
counter: (
f
CPU/
CC[1:0]
).
Procedure:
To use the output compare function, select the fol-
lowing in the CR2 register:
鈥?Set the OCiE bit if an output is needed then the
OCMPi pin is dedicated to the output compare
i
signal.
鈥?Select the timer clock (CC[1:0]) (see
Table 16
Clock Control Bits).
And select the following in the CR1 register:
鈥?Select the OLVLi 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:
鈥?OCFi bit is set.
鈭?/div>
OCiR =
鈭唗
*
f
EXT
Where:
鈭?/div>
t
= Output compare period (in seconds)
f
EXT
= External timer clock frequency (in hertz)
Clearing the output compare interrupt request (i.e.
clearing the OCFi bit) is done by:
1. Reading the SR register while the OCFi bit is
set.
2. An access (read or write) to the OCiLR register.
The following procedure is recommended to pre-
vent the OCFi bit from being set between the time
it is read and the write to the OC
i
R register:
鈥?Write to the OCiHR register (further compares
are inhibited).
鈥?Read the SR register (first step of the clearance
of the OCFi bit, which may be already set).
鈥?Write to the OCiLR register (enables the output
compare function and clears the OCFi bit).
60/154
1

ST7232AK1B1相关型号PDF文件下载

  • 型号
    版本
    描述
    厂商
    下载
  • 英文版
    8-BIT MCU FOR CAN WITH 32K ROM, 1K RAM, EEPROM, ADC, WDG, PW...
    STMICROELECTRONICS
  • 英文版
    8-BIT MCU FOR CAN WITH 32K ROM, 1K RAM, EEPROM,ADC, WDG, PWM...
    STMicro
  • 英文版
    LOW SPEED USB 8-BIT MCU FAMILY WITH UP TO 8K FLASH/ROM AND S...
    STMICROELECTRONICS
  • 英文版
    ST7 - LOW SPEED USB 8-BIT MCU WITH 3 ENDPOINTS, FLASH MEMORY...
    STMicroelectronics
  • 英文版
    LOW SPEED USB 8-BIT MCU WITH 3 ENDPOINTS, FLASH OR ROM MEMOR...
    STMicroelectronics
  • 英文版
    LOW SPEED USB 8-BIT MCU FAMILY with up to 16K MEMORY, up to ...
    STMICROELECTRONICS
  • 英文版
    LOW SPEED USB 8-BIT MCU FAMILY with up to 16K MEMORY,
    STMicro
  • 英文版
    ST7 - LOW-POWER. FULL-SPEED USB 8-BIT MCU WITH 32K FLASH. 5K...
    ETC
  • 英文版
    ST7 - LOW-POWER, FULL-SPEED USB 8-BIT MCU WITH 32K FLASH, 5K...
    STMicroelectronics
  • 英文版
    USB 2.0 HIGH SPEED MASS STORAGE MICROCONTROLLER
    ST
  • 英文版
    8-BIT HCMOS MCUs WITH EEPROM AND TV/MONITOR DEDICATED FUNCTI...
    STMICROELECTRONICS
  • 英文版
    8-BIT HCMOS MCUs WITH EEPROM AND TV/MONITOR DEDICATED FUNCTI...
    STMICROELECTRON...
  • 英文版
    8-BIT MCU WITH 24K ROM, EEPROM,ADC,PWM/BRM DACs,SYNC PROCESS...
    STMICROELECTRONICS
  • 英文版
    8-BIT MCU WITH 24K ROM, EEPROM,ADC,PWM/BRM DACs,SYNC PROCESS...
    STMICROELECTRON...
  • 英文版
    8-BIT USB MCU FOR MONITORS WITH UP TO 60K ROM, 2K RAM, ADC, ...
    STMICROELECTRONICS
  • 英文版
    8-BIT USB MCU FOR MONITORS WITH UP TO 60K ROM, 2K RAM, ADC, ...
    STMICROELECTRON...
  • 英文版
    ROM FROM EPROM
    STMICROELECTRONICS
  • 英文版
    8-BIT MCU WITH 4 TO 8K ROM/OTP/EPROM, 256 BYTES RAM, ADC, WD...
    STMICROELECTRONICS
  • 英文版
    8-BIT MCU WITH 4 TO 8K ROM/OTP/EPROM, 256 BYTES RAM, ADC, WD...
    STMICROELECTRON...
  • 英文版
    8-BIT MICROCONTROLLER (MCU) WITH 8 TO 16 K ROM/OTP/EPROM. 38...
    ETC

扫码下载APP,
一键连接广大的电子世界。

在线人工客服

买家服务:
卖家服务:

0571-85317607

客服在线时间周一至周五
9:00-17:30

关注官方微信号,
第一时间获取资讯。

建议反馈

联系人:

联系方式:

按住滑块,拖拽到最右边
>>
感谢您向阿库提出的宝贵意见,您的参与是维库提升服务的动力!意见一经采纳,将有感恩红包奉上哦!