Electronic Components Datasheet Search |
|
AN560 Datasheet(PDF) 3 Page - Microchip Technology |
|
AN560 Datasheet(HTML) 3 Page - Microchip Technology |
3 / 22 page © 1994 Microchip Technology Inc. DS00560D-page 3 Using the 93LC56 and 93LC66 8 0061 0007 datout equ 7 ; data out line (port_b) 0062 0006 datin equ 6 ; data in line (port_b) 0063 0005 sclk equ 5 ; clock line (port_b) 0064 0004 chpsel equ 4 ; chip select line (port_b) 0065 ; 0066 ;************************************************************* 0067 0000 org 01ffh 0068 01FF 0A33 begin goto PWRUP ; set the reset vector 0069 0000 org 000h 0070 0000 0A33 goto PWRUP 0071 ; 0072 ;************************************************************** 0073 ; Start Bit Subroutine 0074 ; this routine generates a start bit 0075 ; (Chip select and DI high when clock goes high) 0076 ;************************************************************** 0077 BSTART 0078 0001 04C6 bcf port_b,datin ; set datain and chipselect lines 0079 0002 0486 bcf port_b,chpsel ; low just to check operation 0080 0003 04A6 bcf port_b,sclk ; make sure clock starts low too. 0081 0004 0000 nop 0082 ; 0083 0005 0586 bsf port_b,chpsel ; set chip select line high 0084 0006 05C6 bsf port_b,datin ; set data in line high 0085 0007 0000 nop 0086 0008 05A6 bsf port_b,sclk ; set the clock line high to 0087 ; generate the start bit 0088 0009 0000 nop 0089 000A 0000 nop 0090 000B 04A6 bcf port_b,sclk ; set clock low again 0091 000C 0800 retlw 0 0092 ; 0093 ;************************************************************** 0094 ; BITIN routine reads one bit of data from the 0095 ; serial EE device and stores it in ‘di’ 0096 ;************************************************************** 0097 BITIN 0098 000D 05EA bsf eeprom,di ; assume input bit is high 0099 000E 05A6 bsf port_b,sclk ; set clock line high 0100 000F 0000 nop ; 0101 0010 07E6 btfss port_b,datout ; read the data bit 0102 0011 04EA bcf eeprom,di ; input bit was low 16c5x/7x Cross-Assembler V4.12 Released Mon Jun 06 10:49:10 1994 Page 3 Line PC Opcode 0103 0012 04A6 bcf port_b,sclk ; set clock line low 0104 ; 0105 0013 0800 retlw 0 ; 0106 0107 ;**************************************************************** 0108 ; Receive data routine 0109 ; This routine reads one byte of data from the part 0110 ; into the ‘datai’ register. 0111 ;**************************************************************** 0112 RX 0113 0014 006D clrf datai ; clear input buffer 0114 0015 0C08 movlw .8 ; set # bits to 8 0115 0016 0031 movwf count 0116 0017 0403 bcf status,0 ; make sure carry bit is low 0117 0018 036D RXLP rlf datai ; rotate the buffer left 1 bit 0118 0019 090D call BITIN ; read 1 bit 0119 001A 040D bcf datai,0 ; assume the input bit was low 0120 001B 06EA btfsc eeprom,di ; check the bit 0121 001C 050D bsf datai,0 ; set high if neccessary 0122 001D 02F1 decfsz count ; 8 bits done? 0123 001E 0A18 goto RXLP ; no, do another 0124 001F 0800 retlw 0 8-101 |
Similar Part No. - AN560 |
|
Similar Description - AN560 |
|
|
Link URL |
Privacy Policy |
ALLDATASHEET.NET |
Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Contact us | Privacy Policy | Link Exchange | Manufacturer List 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 |