Interfacing Piccard with PIC16f628a?


Results 1 to 6 of 6

Threaded View

  1. #2
    Join Date
    Jan 2010
    Location
    morocco
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    im still trying to sort it out.if someone has any idea how to do it plz help,

    PIC16F628A
    Code:
    @ DEVICE XT_OSC, LVP_OFF, MCLR_OFF, WDT_OFF ,BOD_OFF,CPD_OFF,PWRT_OFF
    include "modedefs.bas" 
    DEFINE INT_OSC  8 
    OPTION_REG .7 = 0
    cmcon = 7	    		'disable portA comparators
    intcon = 0		'disable interrupts
    vrcon = 0
    PORTA = %00000
    TRISA = %00000
    
    START:
    TRISB = %00101001
    IF PORTB.5 = 0 THEN S
    IF PORTB.0 = 0 THEN  SS
    GOTO START
    S:
    TRISB = %00100001
    T2CON = %00000100 
    SEROUT2 PORTB.2,17197,[ 01]
    PAUSE  10
    GOTO START
    SS:
    TRISB = %00100001
    SEROUT2 PORTB.2,17197,[ 02]
    PAUSE  10
    GOTO START
    END
    PICCARD(16F84+24C16)
    Code:
    @ DEVICE XT_OSC, WDT_OFF
    include "modedefs.bas"
    define osc 8 
    PORTA = %00000
    TRISA = %00000
    PORTB = %00000001
    TRISB = %00000001
    CLK VAR PORTB.5
    DAT VAR PORTB.4
    B0 VAR BYTE
    B0 = 0
    G VAR BYTE
    K VAR BYTE
    MAIN:
    SERIN2 PORTB.0,16780,[WAIT(J),DEC2 B0]
    IF B0 = 01 THEN RD
    IF B0 = 02 THEN WR
    GOTO MAIN
    WR:
    FOR G = 0 TO 63
    i2cwrite  DAT,CLK,$a0,G,[b0]
    NEXT G
    RETURN
    RD:
    for G = 0 to 63
    i2cread DAT,CLK,$a0,G,[B0]
    PAUSE 10
    RETURN
    END
    im trying to write data to piccard external eeptom and read it useing pic16f628 connected to pic card, well plz is there any better way todo it i want to write and read derect data to the external eeprom without writing a code in piccard?
    Last edited by MR2010; - 5th May 2010 at 04:16.
    A Fancy Having a Third Rate Actor as President Of His Country........

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts