PDA

View Full Version : 24Cxx copier with PIC 16F84A



the_kid25
- 8th September 2009, 17:25
i need schematic copier for 24Cxx with microntroler PIC16F84A.share here please with source code for PIC16F84A.thaks for all

phoenix_1
- 8th September 2009, 17:38
i need schematic copier for 24Cxx with microntroler PIC16F84A.share here please with source code for PIC16F84A.thaks for all
Define variable as byte
Make loop from 0 to 255
Read first eeprom and put result to your variable
write that variable to second eeprom in same address
go to loop for full range of 256 location (24C02).
For 24C02 is from address 0 to address 255.
if loop come to end of count all is finished.
Use I2C command to read and write EEPROM and make different I2C address
for 1st and second EEPROM by hardware pin setup.
Regards Robert :rolleyes:

the_kid25
- 9th September 2009, 14:03
Define variable as byte
Make loop from 0 to 255
Read first eeprom and put result to your variable
write that variable to second eeprom in same address
go to loop for full range of 256 location (24C02).
For 24C02 is from address 0 to address 255.
if loop come to end of count all is finished.
Use I2C command to read and write EEPROM and make different I2C address
for 1st and second EEPROM by hardware pin setup.
Regards Robert :rolleyes:
what u have schematic please share here brother

mackrackit
- 9th September 2009, 19:03
Look at the data sheet and the PBP manual. Everything you need is there.

Good luck getting someone to do your school work for you.

the_kid25
- 9th September 2009, 19:41
Look at the data sheet and the PBP manual. Everything you need is there.

Good luck getting someone to do your school work for you.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

phoenix_1
- 9th September 2009, 21:23
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

Maybe u need to buy some good programator for EEPROM's ?

ferdinand
- 20th October 2013, 05:58
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

Art
- 28th October 2013, 09:05
Did one eleven yrs back :)
Might have been my first PBP program.

http://img.photobucket.com/albums/v186/ArtArt/Schematic_zps73848594.jpg

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.




' 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