| 数据搜索系统,热门电子元器件搜索 |
|
HCS300 数据表(PDF) 11 Page - Microchip Technology |
|
|
|||||||||||||||||||||||||||||
HCS300 数据表(HTML) 11 Page - Microchip Technology |
|
11 / 17 page ![]() ã 1997 Microchip Technology Inc. DS00665A-page 11 AN665 00247 ;* Output Variables: 00248 ;* BUFFER0..7 00249 ;********************************************************************** 00250 ; 004A 00251 Receive 004A 0686 00252 btfsc HCSIN ; wait for a falling edge 004B 0A4A 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 ; 00000038 00259 PREBIT EQU .56 00260 004C 006F 00261 clrf BITCOUNT ; init counter 004D 00262 Rise 004D 0686 00263 btfsc HCSIN ; wait rising edge 004E 0A54 00264 goto Rise2 00265 004F 0913 00266 call SubDelay10 ; 24us per cycle 0050 0914 00267 call SubDelay9 ; 00268 0051 03EF 00269 incfsz BITCOUNT,F ; more than 6,0ms timeout 0052 0A4D 00270 goto Rise ; waiting loop 0053 0A4A 00271 goto Receive ; timeout restart 00272 0054 00273 Rise2 0054 07EF 00274 btfss BITCOUNT,7 ; if bit7=1 ok 0055 0A4A 00275 goto Receive ; else less than 3.0 ms timeout 00276 00277 ;------------------------------------------------------------------- 00278 ; read folowing 8 bytes (ignore last 2 bit) 00279 ; 0056 0C40 00280 movlw .64 ; 8 bit per byte 0057 002F 00281 movwf BITCOUNT ; 00282 0058 00283 FirstPreload 0058 0C38 00284 movlw PREBIT ; first bit needs no balance 0059 0031 00285 movwf TIMEHI 005A 0A5D 00286 goto WHL 00287 005B 00288 RNextBit 005B 0C36 00289 movlw PREBIT-2 ; preload counter 005C 0031 00290 movwf TIMEHI ; balance extra rrf time 00291 005D 00292 WHL 005D 02B1 00293 incf TIMEHI,F ; measure high period 005E 0643 00294 btfsc STATUS,Z 005F 0A4A 00295 goto Receive ; after 1.2ms (200*6) timeout 0060 0686 00296 btfsc HCSIN ; loop while High 0061 0A5D 00297 goto WHL ; 00298 0062 0C38 00299 movlw PREBIT ; preload counter 0063 0032 00300 movwf TIMELO 00301 0064 00302 WLL 0064 02B2 00303 incf TIMELO,F ; measure low period 0065 0643 00304 btfsc STATUS,Z 0066 0A4A 00305 goto Receive ; after 1.2ms (200*6) timeout 0067 0786 00306 btfss HCSIN ; loop while Low 0068 0A64 00307 goto WLL 00308 00309 ; shift in the new bit 0069 0211 00310 movf TIMEHI,W 006A 00B2 00311 subwf TIMELO,F ; if TIMEHI > TIMELO Carry = 0 006B 032E 00312 rrf BUFFER7,F ; insert bit in buffer |
|
|
链接网址 |
| ALLDATASHEET是否为您带来帮助? [ DONATE ] |
关于 Alldatasheet | 广告服务 | 联系我们 | 隐私政策 | 数据表链接 | 链接交换 | 制造商名单 All Rights Reserved©Alldatasheet.com |
| 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 |