DatasheetQ Logo
Electronic component search and free download site. Transistors,MosFET ,Diode,Integrated circuits

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

부품명
상세내역
제조사
AN560
Microchip
Microchip Technology Microchip
AN560 Datasheet PDF : 22 Pages
First Prev 11 12 13 14 15 16 17 18 19 20 Next Last
Using the 93LC56 and 93LC66
16c5x/7x Cross-Assembler V4.12 Released Mon Jun 06 10:49:00 1994 Page 1
Line PC Opcode
0001
LIST P=16C54,c=132
0002
;****************************************************************
0003
;
3-Wire Byte Write with Data Poll Program (107 bytes)
0004
;
0005
;
This program demonstrates how to interface a
0006
;
Microchip PIC16C54 to a 93LC56 or 93LC66 Serial EE
0007
;
device. This program will execute the erase/write enable
0008
;
command, write to 8 consecutive addresses, and then
0009
;
use the ‘data polling’ method to determine when the
0010
;
write cycle is complete. The program then executes
0011
;
the erase/write disable command. This sequence will
0012
;
repeat forever.
0013
;
0014
;
When writing to a 3-wire serial EE device, the
0015
;
internally timed write cycle will begin after
0016
;
the opcode, address and data are sent to the
0017
;
device. There are two ways to make sure that the
0018
;
cycle is complete before you send it another command.
0019
;
The simplest method is to simply wait for the maximum
0020
;
write cycle time, which can be obtained from the data book.
0021
;
A more efficient method is “Data polling.” This is
0022
;
done by toggling the chip select line low and then
0023
;
back high after the opcode, address and data are sent.
0024
;
The chip select line must be low for at least 250ns
0025
;
before bringing it high again. The device will pull
0026
;
the data out line low at that point, and set it high
0027
;
when the write cycle is complete. The user can then check
0028
;
or “poll” the dataout line until it goes high before
0029
;
sending the next command.
0030
;
0031
;
As an option, the user can connect a LED to pin 18
0032
;
on the PIC16C54 (use about a 1K resistor in series) as a
0033
;
timeout indicator. This LED will come on if the
0034
;
data polling is unsuccessful and the device being
0035
;
programmed does not respond. This can be tested by
0036
;
simply running the program with no part in the socket.
0037
;
0038
;
This program communicates to the serial EE in the
0039
;
x16 mode, and ASSUMES THE USER HAS SET THE ORG PIN
0040
;
ON THE DEVICE TO Vcc.
0041
;
0042
;
Timing is based on using the PIC16C54 in ‘XT’ mode
0043
;
using a 4Mhz crystal. Clock speeds to the serial EE
0044
0045
;
will be approximately 50 kHz for this setup.
;
8
0046
;
PIC16C54 to Serial EE Connections:
0047
;
0048
;
PIC16C54
Serial EE
0049
;
——————
——————
0050
;
Pin 10 (RB4) —> Chip Select
0051
;
Pin 11 (RB5) —> Clock
16c5x/7x Cross-Assembler V4.12 Released Mon Jun 06 10:49:00 1994 Page 2
Line PC Opcode
0052
0053
0054
0055
0056
0057
0058
0059
0060
0005
0006
;
Pin 12 (RB6) —> Data In
;
Pin 13 (RB7) —> Data Out
;
ORG=Vcc
;
;************************************************************
;
Register Assignments
;************************************************************
port_a equ
5h
; port 5 (port_a)
port_b equ
6h
; port 6 (port b) used comm lines to serial EE
© 1994 Microchip Technology Inc.
8-109
DS00560D-page 11

Share Link: 

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