Page 129 - Making PIC Microcontroller Instruments and Controllers
P. 129
soct(Et us-i cRowtRE DEYtcEs I i 9
A
T
u5 l
A 5 C S 1 S l v d d !
c 3 c l t 2 7 P E c8
c 4 D 1 1 3 6 O R G I ] ] l 0.1
c 5 D 0 5 v s s
1 4 -
Vl".ri,-SeePnOU
llFiiiii€:?i*lli l4icrowire sEEPRoM. (Wilng and
This microEngineeing Labs program (Program 7.3)-to read and write Microwire
SEEPROM devices {an bc lbund on their Web site. Use the latest version.
i:!(itliatOlli!:t: Program to read rrom and write to Microwife SEEPRoMS
SEEPROI'I 93LC55A
1 1 s r o o 6 r d ' . d l . 6 , - a - L D D O v
Read irst 16 locacions back and send to LCD repeatedLy
\ o e : , o s D o o v . w i - b y . 6 . z - d " d d - . ,
DEFINE LCD_DREG PORTD def,ne LcD registers and bits
DEFIIIE IJCD_DBIT 4
DEFIIIE IJCD_RSREG PORTE
DEFIAIE IJCD_RSBIT O
DEFIAIE LCD_ERTG PORTE
DEFIAIE IJCD_EBIT 1
IIICLUDE \!'ODEDEFS . BAS"
CS VTR PORTA.s chip select pin
CLR VAR PORTC.3
DI VAR PORTC.4
DO VAR PORTC.s
ADDR VAR BYTE
BO VAR BYTE
LOW CS chip select inactive
set PoRTA and PoRTE to digrrtaL
LOVT PORTE.2 LCD R/lr,i line low (ld)
PAUSE 100 uair for LCD to start up
GOSI'B EEWRITEEII enable SEEPROM writes
FOR A.DDR - 0 tO 15
B O = A D D R + 1 O O B0 is data for SEEPRoM
GOSI'B ESI,{RIEE write to SEEPROM
PAUSE 10
(Coktiku..t)