This is a multi-part message in MIME format. ------=_NextPart_000_0004_01C36FD8.D634A7E0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello! I=B4m trying to use a F84 as master and send data to a 24C02 but I don=B4t have any good result! I=B4m wonder if anyone has any experience of that and want to help me out! Regards =C5ke Neehr -- http://www.piclist.com hint: The list server can filter out subtopics (like ads or off topics) for you. See http://www.piclist.com/#topics ------=_NextPart_000_0004_01C36FD8.D634A7E0 Content-Type: application/octet-stream; name="Ic2.asm" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="Ic2.asm" ; title "IC2.ASM" ; =8Fke Neehr ; 03 08 31 ; Test writing to eeprom LIST P=3D16F84, R=3DDEC errorlevel 0,-305 errorlevel-224 #include ; Registers sec equ 0x0C sec10 equ 0x0D min equ 0x0E min10 equ 0x0F hour equ 0x10 hour10 equ 0x11 temp equ 0x12 ticks equ 0x13 count equ 0x14 envar equ 0x15 flag equ 0x16 tck0 equ .16 __CONFIG _CP_OFF & _LP_OSC & _WDT_OFF & _PWRTE_ON=20 PAGE org 0x00=20 init bcf STATUS,RP0 movlw ticks+1 movwf FSR movlw envar-ticks-1 movwf ticks clrvar clrf INDF incf FSR, F decfsz ticks, F goto clrvar clrf hour10 clrf hour clrf min10 clrf min clrf sec10 clrf sec clrf temp clrf count clrf flag clrf STATUS clrf PORTA clrf PORTB clrw TRIS PORTA ; all outputs movlw 0x80 TRIS PORTB ; RB7 input rest outputs movlw 0x00 ; prescaler 1:2=20 OPTION clrf INTCON movlw tck0 movwf ticks =20 loop call clock =20 call check goto loop dlay40 movlw 0x6D ; 40 ms delay movwf count one decfsz count, F goto one clrf count return =20 inccmp macro reg, limit ; Increment reg, compare with limit incf reg, F movf reg, W sublw limit btfsc STATUS, C ; Return unless limit reached return ; else clrf reg ; zero reg endm clock decfsz ticks, F return movlw tck0 movwf ticks inccmp sec, 9 ; seconds up to 9 inccmp sec10, 5 ; 10s up to 5 inccmp min, 9 inccmp min10, 5 Inchr btfss hour10, 1 ; If hour10 < 2 goto Incht ; just increment hour inccmp hour, 3 ; 2x hours: Limit x to 3 clrf hour10 retlw 0 Incht inccmp hour, 9 ; Hours up to 9 incf hour10, F ; overflow to tens return check btfss INTCON, T0IF goto check bcf INTCON, T0IF btfss PORTB, 7 ; check if " 0" on PORTB, 7 goto nodwn btfss flag, 7 return bcf flag, 7 return nodwn btfsc flag, 7 ; if yes, start sending return bsf flag, 7 call dlay40 movlw 0xA0 ; ID code 10100000 call sendCHAR movlw 0x20 ; Adress 00010100 call sendCHAR movf hour10, W call sendASCII movlw 0x21 call sendCHAR movf hour, W call sendASCII movlw 0x22 call sendCHAR movlw ":" call sendCHAR movlw 0x23 call sendCHAR movf min10, W call sendASCII movlw 0x24 call sendCHAR movf min, W call sendASCII movlw 0x25 call sendCHAR movlw ":" call sendCHAR movlw 0x26 call sendCHAR movf sec10, W call sendASCII movlw 0x27 call sendCHAR movf sec, W call sendASCII return sendASCII addlw '0' sendCHAR movwf temp movlw 0x08 movwf count sloop rlf temp, F skpc bcf PORTB, 0 skpnc bsf PORTB, 0 nop bcf PORTB, 1 nop bsf PORTB, 1 decfsz count, F goto sloop clrf count return end ------=_NextPart_000_0004_01C36FD8.D634A7E0--