数据搜索系统,热门电子元器件搜索
  Chinese  ▼
ALLDATASHEETCN.COM

X  

AN591 数据表(PDF) 3 Page - STMicroelectronics

部件名 AN591
功能描述  Input capture with ST62 auto-reload timer
PDF  5 Pages
Scroll/Zoom Zoom In 100%  Zoom Out
制造商  STMICROELECTRONICS [STMicroelectronics]
网页  http://www.st.com
标志 STMICROELECTRONICS - STMicroelectronics

AN591 数据表(HTML) 3 Page - STMicroelectronics

  AN591 Datasheet HTML 1Page - STMicroelectronics AN591 Datasheet HTML 2Page - STMicroelectronics AN591 Datasheet HTML 3Page - STMicroelectronics AN591 Datasheet HTML 4Page - STMicroelectronics AN591 Datasheet HTML 5Page - STMicroelectronics  
Zoom Inzoom in Zoom Outzoom out
 3 / 5 page
background image
AN591
Input capture with ST62 auto-reload timer
3/5
Programmable example
The following figure shows the evolution of the contents of TC and RC during capture
operation: a rising edge on TIMIN results in copying the latest value of TC into RC, and
clearing TC. Afterwards, TC increments at the selected clock rate until the next capture or
until it reaches 255. In the latter case, it wraps to 0. In capture mode, TC always counts from
0 to 255, it is never loaded from the RC register.
Figure 2.
TC and RC Evolution
;**************** accumulator *****************************
A
.def 0FFh,0FFh,0FFh ;Accumulator
;**************** RAM variable ****************************
period .def 084h,0FFh,0FFh ;elapsed time
;**************** A-R Timer Register Set ******************
RC. def 0D9h,0FFh,0FFh ;reload/capture register
CP. def 0DAh,0FFh,0FFh ;compare register
MC. def 0D5h,0FFh,0FFh ;mode control register
SC0. def 0D6h,0FFh,0FFh ;status/control register 0
SC1. def 0D7h,0FFh,0FFh ;status/control register 1
LR. def 0DBh,0FFh,0FFh ;load register
;==========================================================
ldi SC1,01000100b; clock source = CPU,
;prescaler ratio = 4,
;pull-up on TIMIN disabled,
;capture on rising edge of TIMIN
ldi MC, 11000010b;capture with reset, ints. disabled
;PWMOUT disabled, start timer
; .
; . normal program
; .
;now we want to know the elapsed time between last and
;next edge on TIMIN:
res 2, SC0 ;clear external event flag
wt_edge
jrr 2,SC0,wt_edge ;wait for edge on TIMIN, then
ld A,RC ;read elapsed time from reload/capt
ld period,A ;register into variable ”period”



Html Pages

1 2 3 4 5


数据表 下载

Go To PDF Page


链接网址



ALLDATASHEET是否为您带来帮助?  [ DONATE ] 

关于 Alldatasheet   |   广告服务   |   联系我们   |   隐私政策   |   数据表链接    |   链接交换   |   制造商名单
All Rights Reserved©Alldatasheet.com


Mirror Sites
English : Alldatasheet.com  |   English : Alldatasheet.net  |   Chinese : Alldatasheetcn.com  |   German : Alldatasheetde.com  |   Japanese : Alldatasheet.jp
Russian : Alldatasheetru.com  |   Korean : Alldatasheet.co.kr  |   Spanish : Alldatasheet.es  |   French : Alldatasheet.fr  |   Italian : Alldatasheetit.com
Portuguese : Alldatasheetpt.com  |   Polish : Alldatasheet.pl  |   Vietnamese : Alldatasheet.vn
Indian : Alldatasheet.in  |   Mexican : Alldatasheet.com.mx  |   British : Alldatasheet.co.uk  |   New Zealand : Alldatasheet.co.nz
Family Site : ic2ic.com  |   icmetro.com