datasheetbank_Logo
전자부품 반도체 검색엔진( 무료 PDF 다운로드 ) - 데이터시트뱅크

AN665 데이터 시트보기 (PDF) - Microchip Technology

부품명
상세내역
일치하는 목록
AN665 Datasheet PDF : 17 Pages
First Prev 11 12 13 14 15 16 17
004A
004A 0686
004B 0A4A
00000038
004C 006F
004D
004D 0686
004E 0A54
004F 0913
0050 0914
0051 03EF
0052 0A4D
0053 0A4A
0054
0054 07EF
0055 0A4A
0056 0C40
0057 002F
0058
0058 0C38
0059 0031
005A 0A5D
005B
005B 0C36
005C 0031
005D
005D 02B1
005E 0643
005F 0A4A
0060 0686
0061 0A5D
0062 0C38
0063 0032
0064
0064 02B2
0065 0643
0066 0A4A
0067 0786
0068 0A64
0069 0211
006A 00B2
006B 032E
AN665
00247 ;*
Output Variables:
00248 ;*
BUFFER0..7
00249 ;**********************************************************************
00250 ;
00251 Receive
00252
btfsc HCSIN
; wait for a falling edge
00253
goto Receive
00254
00255 ; will accept sync pulses from 3.0 to 6.1 ms.
00256 ; more than 128 cycles but less than 256
00257 ; each cycle is 24 us @4MHz
00258 ;
00259 PREBIT
EQU
.56
00260
00261
clrf BITCOUNT
; init counter
00262 Rise
00263
btfsc HCSIN
; wait rising edge
00264
goto Rise2
00265
00266
call SubDelay10
; 24us per cycle
00267
call SubDelay9
;
00268
00269
incfsz BITCOUNT,F
; more than 6,0ms timeout
00270
goto Rise
; waiting loop
00271
goto Receive
; timeout restart
00272
00273 Rise2
00274
btfss BITCOUNT,7
; if bit7=1 ok
00275
goto Receive
; else less than 3.0 ms timeout
00276
00277 ;-------------------------------------------------------------------
00278 ; read folowing 8 bytes (ignore last 2 bit)
00279 ;
00280
movlw .64
; 8 bit per byte
00281
movwf BITCOUNT
;
00282
00283 FirstPreload
00284
movlw PREBIT
; first bit needs no balance
00285
movwf TIMEHI
00286
goto WHL
00287
00288 RNextBit
00289
movlw PREBIT-2
; preload counter
00290
movwf TIMEHI
; balance extra rrf time
00291
00292 WHL
00293
incf TIMEHI,F
; measure high period
00294
btfsc STATUS,Z
00295
goto Receive
; after 1.2ms (200*6) timeout
00296
btfsc HCSIN
; loop while High
00297
goto WHL
;
00298
00299
movlw PREBIT
; preload counter
00300
movwf TIMELO
00301
00302 WLL
00303
incf TIMELO,F
; measure low period
00304
btfsc STATUS,Z
00305
goto Receive
; after 1.2ms (200*6) timeout
00306
btfss HCSIN
; loop while Low
00307
goto WLL
00308
00309 ; shift in the new bit
00310
movf TIMEHI,W
00311
subwf TIMELO,F
; if TIMEHI > TIMELO Carry = 0
00312
rrf
BUFFER7,F
; insert bit in buffer
ã 1997 Microchip Technology Inc.
DS00665A-page 11

Share Link: 

datasheetbank.com [ Privacy Policy ] [ Request Datasheet ] [ Contact Us ]