This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C2A81E.A7A6B1C0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit As usual I made a stupid mistake and did not attach the code. Sorry, Royce -- http://www.piclist.com hint: The PICList is archived three different ways. See http://www.piclist.com/#archives for details. ------=_NextPart_000_0004_01C2A81E.A7A6B1C0 Content-Type: application/octet-stream; name="Eeprom28.asm" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Eeprom28.asm" ; EEPROM test EEPROM28.ASM ; 19 November 2002. R.G. Simmons LIST P=3D16f628, n =3D 55, st =3D OFF include P16F628.inc ; XT oscillator configuration __CONFIG _XT_OSC & _WDT_OFF & _PWRTE_OFF & _LVP_OFF d1 equ 0x20 d2 equ 0x21 d3 equ 0x22 d1val equ 0x23 org 0x000 ; Reset vector is at 0x000 main bsf STATUS,RP0 ; switch to bank 1 movlw 0x00 ; load DDR info movwf TRISA ; set data direction movwf TRISB ; all portb bits are outputs bcf STATUS,RP0 ; switch to bank 0 movwf PORTA ; Clear register movwf PORTB ; Set register initeeprom bsf STATUS,RP0 ; Bank 1 clrf EEADR showloop bsf STATUS,RP0 ; Bank 1 bsf EECON1,RD movf EEDATA,W btfsc STATUS,Z goto initeeprom bcf STATUS,RP0 ; switch to bank 0 movwf PORTB bsf STATUS,RP0 ; Bank 1 incf EEADR,F bcf STATUS,RP0 ; switch to bank 0 movlw 0x02 ; Load value for delay call dlyn ; Delay for reading goto showloop ;=3D=3D=3D=3D1 Second delay=3D=3D=3D=3D=3D=3D=3D=3D ;Basically, this routine runs loops within loops to "kill" clock cycles. sec movlw 0x3a ; 58 movwf d1 delay_00 movlw 0x4a movwf d2 delay_01 movlw 0x4c movwf d3 delay_02 decfsz d3, f goto delay_02 ; 228 decfsz d2, f goto delay_01 ; 222 decfsz d1, f goto delay_00 ; 3,977 cycles movlw 0x1C movwf d1 delay_10 movlw 0x2e movwf d2 delay_11 decfsz d2, f goto delay_11 decfsz d1, f goto delay_10 ; 46 cycles movlw 0x0f movwf d1 Delay_20 decfsz d1, f goto Delay_20 return ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D dlyn movwf d1val ; Move delay value to a variable dly1 call sec ; Call 1 second delay d1val times decfsz d1val,f ; Does d1val =3D 0? goto dly1 ; No return ; Yes, return to main program ;=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D ; EEPROM data org 0x2100 de 0x01,0x03,0x07,0x0F,0x1F,0x3F,0x7F,0xFF,0x00 end =1A ------=_NextPart_000_0004_01C2A81E.A7A6B1C0--