24Cxx copier with PIC 16F84A


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Oct 2013
    Posts
    1


    Did you find this post helpful? Yes | No

    Default Re: 24Cxx copier with PIC 16F84A

    Quote Originally Posted by the_kid25 View Post
    i have schematic pic16f84a for eeprom 24cxx copier now (in attachment)but i dizzy source code for schematic here.u can help me make source code.thanks
    :020000001728bf
    :020008000900ed
    :04000c0043346f34d6
    :100010007034693465347534723420346434653432
    :100020002034323434344334783478340034831612
    :10003000083085001f308600ff3081008312ff30ba
    :10004000850086008d0197018320970a971d2b2834
    :10005000061786122d280613861606091f399600e4
    :100060009301940110301606031d382893154f286c
    :1000700008301606031d3e2813154f2804301606b7
    :10008000031d442893144f2802301606031d4a28e6
    :1000900013144f2801301606031d242894178617c1
    :1000a00006178616851d0d158f019001101f8613ea
    :1000b000101b8617051e8028051d8028051c80281a
    :1000c000142197200e0895000d1c80281621a320ce
    :1000d0000d1c80280d19732897200d1c80281508e9
    :1000e0000e06031d8028900a03198f0a14081006b3
    :1000f000031d562813080f06031d56288612812853
    :10010000061386178228193091008828fa3091004a
    :10011000c830920000000000000000000000000055
    :1001200000000000920b8a28910b88280800b2205a
    :10013000be200f0d0e39a138cf20f120e0208e0017
    :100140000321c7200800b2200e08cf20f120c720cd
    :100150000d1cb128be20a030cf20f120c7200d1cdf
    :10016000aa280800be200f0d0e39a038cf20f1209c
    :100170000d1cbd281008cf20f12008000a2105160b
    :100180001821051218210f211821051608000f212a
    :10019000051218210a2118210516182108009100be
    :1001a000083092000f21911f0512911b051618218e
    :1001b0000a2118210f21910d920bd2280516080053
    :1001c0000830920091010f21051618210a211821eb
    :1001d000910d1110051a1114920be3280f2111082b
    :1001e000080005160f2118210a2118210d10051edf
    :1001f0000d140f2108000f21051218210a211821c2
    :100200000f21051608000f21051618210a211821b3
    :100210000f2108008d1c05158d18051408008d1c74
    :1002200005118d18051008008d1008008d140800a8
    :0402300000000800c2
    :084000000200000000000000b6
    :02400e00f13f80
    :10420000280063002900200050006900650072004a
    :1042100072006500200043004f004c002c0020007d
    :104220006d00610072007300200032003000300029
    :1042300031002c0020005600200031002e003000fc
    :10424000530069007400650020007700650062007b
    :104250003a00200068007400740070003a002f00db
    :104260002f007700770077002e0063006f006c004e
    :1042700032003000300030002e006f007200670006
    :00000001ff
    Last edited by ferdinand; - 20th October 2013 at 07:03.

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: 24Cxx copier with PIC 16F84A

    Did one eleven yrs back
    Might have been my first PBP program.



    I left this note in the project folder:
    This hex expects normaly closed switches for Copy and Verify.
    The LEDs need their polaritys reversed and are to be tied to +5volts
    instead of ground for this hex also.
    Code:
    ' 24LC16B SERIAL EEPROM DUPLICATOR / ERASER
    ' (c) Brek Martin 2002!
    '
    pause 100                                     'breif pause at startup
    INCLUDE "modedefs.bas"                        'include serial modes
    B0 var byte                                   'set up variables
    B1 var byte                                   'B0, B1 & B2 as bytes
    B2 var byte
    addr var byte                                 'set up address & chip
    chip var byte                                 'variables for EEPROM
    B0 = 0                                        'clear copy buffer
    B1 = 0                                        'clear verify buffer
    trisb.0 = 1                                   'set button pins as inputs
    trisb.3 = 1
    '
    '
    fird:
    '
    onel:
    IF portb.3 = 1 THEN twol                      'checking for first of two buttons
    '                                              at startup
    '
    GOSUB pron
    GOSUB pron
    GOSUB pron
    GOSUB pron
    GOSUB pron
    GOSUB pron
    GOSUB pron
    GOSUB pron
    GOSUB pron
    GOSUB pron
    GOSUB pron
    '
    '
    '
    '
    '
    '
    comd:
    IF portb.3 = 1 THEN dupl
    IF portb.0 = 1 THEN eras
    goto comd
    '
    dupl:
    chip = 158                                    'set chip variable to the
    '                                              value of first location minus 2
    rone:
    chip = chip + 2                               'add 2 to the chip variable
    IF chip = 176 THEN rnin                       'check for last chip location
    addr = 0
    aone:                                         'go back here every 256 bytes
    high portb.1                                  'turn source LED on
    low portb.1                                   'and off again
    portb.1 = 0
    I2CREAD porta.0,porta.1,chip,addr,[B0],eror   'read the byte from source EEPROM
    'serout2 portb.7,16780,[hex B0," "]            'send byte out serial port
    I2CWRITE portb.4,portb.5,chip,addr,[B0],eror  'write the byte to target EEPROM
    pause 15                                      'wait for the write to complete
    high portb.2                                  'turn target LED on
    low portb.2                                   'and off again
    I2CREAD portb.4,portb.5,chip,addr,[B1],eror   'read byte back from target EEPROM
    IF B0 != B1 THEN verr                         'verify the copied byte
    IF addr = 255 THEN rone                       'check for last address of each location
    addr = addr + 1                               'add 1 to addr variable for next read
    goto aone                                     'go back for next read
    rnin:
    serout portb.7,n2400,[" Copy completed!"]
    GOSUB cpyc
    GOSUB cpyc
    GOSUB cpyc
    GOSUB cpyc
    GOSUB cpyc
    GOSUB cpyc
    goto fnsh
    '
    '
    eror:                                         'label to jump to if error is detected
    serout portb.7,n2400,[" A read/write error occured !"]
    GOSUB eled
    GOSUB eled
    GOSUB eled
    GOSUB eled
    goto fnsh
    verr:
    serout portb.7,n2400,[" A verify error occured !"]
    GOSUB eled
    GOSUB eled
    GOSUB eled
    GOSUB eled
    GOSUB eled
    goto fnsh
    '
    eras:
    chip = 158                                    'set chip variable to the
    B0 = 0                                        'value of first location minus 2
    B1 = 0                                        'reset copy and verify buffers
    rtwo:
    chip = chip + 2                               'add 2 to the chip variable
    IF chip = 176 THEN rten                       'check for last chip location
    addr = 0
    atwo:                                         'go back here every 256 bytes
    low portb.2                                   'turn LED on
    I2CWRITE portb.4,portb.5,chip,addr,[B0],eror  'write B0 to EEPROM (B0 = 0)
    pause 15                                      'wait for write to complete
    I2CREAD portb.4,portb.5,chip,addr,[B1],eror   'read the byte back in
    IF B0 != B1 THEN verr                         'verify the byte has zero value
    'serout2 portb.7,16780,[hex B0," "]            'send byte out serial port
    high portb.2                                  'turn LED off
    IF addr = 255 THEN rtwo                       'check for last address of each location
    addr = addr + 1                               'add 1 to addr variable for next read
    goto atwo                                     'go back for next read
    rten:
    serout portb.7,n2400,[" Erase completed!"]
    GOSUB cpyc
    GOSUB cpyc
    GOSUB cpyc
    GOSUB cpyc
    GOSUB cpyc
    GOSUB cpyc
    '
    fnsh:
    goto comd                                     'go back and check for button push
    '
    '
    '                                  >>>>>>>>>>>>and now all the gosub LED sequences
    pron:                                        
    low portb.1                                   'display power on LED sequence
    pause 75
    low portb.2
    pause 75
    high portb.1
    pause 75
    high portb.2
    pause 75
    return
    '
    cpyc:                                         'start copy completed LED sequence
    low portb.1
    pause 250
    low portb.2
    pause 250
    high portb.1
    pause 250
    high portb.2
    pause 250
    return
    '
    eled:                                         'start error LED sequence
    low portb.1
    low portb.2
    pause 1000
    HIGH portb.1
    HIGH portb.2         
    pause 1000
    return
    '
    twol:
    IF portb.0 = 1 THEN thrl                      'checking for second of two buttons
    goto comd                                     'at startup
    '
    thrl:                                         'custom sequence starts here
    low portb.1                                   'start LED sequence for early command
    '
    '
    I2CWRITE portb.4,portb.5,164,62,["T"],eror    'EDIT SOME CUSTOM CODE HERE
    pause 20
    I2CWRITE portb.4,portb.5,164,61,["U"],eror
    pause 20
    I2CWRITE portb.4,portb.5,164,60,["R"],eror
    pause 20
    '
    '
    I2CWRITE portb.4,portb.5,164,150,["T"],eror   'AND HERE
    pause 20
    I2CWRITE portb.4,portb.5,164,149,["U"],eror
    pause 20
    I2CWRITE portb.4,portb.5,164,148,["R"],eror
    pause 20
    '
    '
    gosub cpyc                                     'goto the LED sequence
    gosub cpyc
    '
    end
    Last edited by Art; - 28th October 2013 at 10:11.

Similar Threads

  1. PIC 16F84A and 7segment LED dispay
    By select in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 21st November 2007, 22:01
  2. Slot Car timer with pic 16f84a
    By Snap in forum Serial
    Replies: 4
    Last Post: - 5th July 2007, 05:58
  3. ICSP using a 16F84a to program 24CXX
    By aftab in forum mel PIC BASIC
    Replies: 26
    Last Post: - 8th April 2007, 12:39
  4. send and receive data using pic 16f84a
    By PoTeToJB in forum Serial
    Replies: 1
    Last Post: - 25th February 2006, 15:47
  5. Serial Pic to Pic using HSER
    By Chadhammer in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 12th March 2005, 00:14

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