Interfacing Piccard with PIC16f628a?


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2010
    Location
    morocco
    Posts
    16

    Default Interfacing Piccard with PIC16f628a?

    Im writing this project for use picard(goldcard pic16f84+external eeprom 24c16) as a key of the door lock.so i need help how to read and write data on the piccard external eeprom 24c16?
    Attached Images Attached Images   
    Last edited by MR2010; - 3rd May 2010 at 04:11.
    A Fancy Having a Third Rate Actor as President Of His Country........

  2. #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 05:16.
    A Fancy Having a Third Rate Actor as President Of His Country........

  3. #3
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    This takes me back. I remember doing this at University ten years ago... (everybody at the Halls of Residence was watching free Satellite Pay-TV)!

    1. You create an EEPROM LOADER program for the PIC.

    2. You then run that program to transfer your Data into the EEPROM.

    3. You then load the PIC with your applications program.

    The card is then programmed and ready to run. This was a three-stage process (if you got the card with a 16F8xx PIC, you could actually do it in one hit because it had the Program Codespace to embed your EEPROM Data into it, but that just wasn't possible with the F84 card).

  4. #4
    Join Date
    Jan 2010
    Location
    morocco
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Thank you Melanie for helps, i know how to program it useing infinity or phonex programer that stoped 6years ago they were watchin tps and d+ and tv cabo sat channels over here but its gone early, well i just thought i can write a code for this bloody card so i can read and write its external eeprom useing pic16f628a,
    A Fancy Having a Third Rate Actor as President Of His Country........

  5. #5
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Just use something like Pheonix to put a simple Comms program into the F84 for PortB.7 (not PortB.0 as in your code at Post #2 above) to talk to your F628, then it's just dialogue between the two to determine what you want to do... ie put Data into the EEPROM, or read back/compare etc.

    Start by simply sending ONE character from your F628, receiving it on the F84 card, and sending it back a few milliseconds later. Once you have managed reliable communications between the two, you can then build on that and add features.

  6. #6
    Join Date
    Jan 2010
    Location
    morocco
    Posts
    16


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Melanie View Post
    Just use something like Pheonix to put a simple Comms program into the F84 to talk to your F628. Then it's just dialogue between the two to determine what you want to do... ie put Data into the EEPROM, or read back/compare etc.
    ok ty Melanie i will try this and see wat will happen,
    A Fancy Having a Third Rate Actor as President Of His Country........

Members who have read this thread : 1

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