File tree Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Expand file tree Collapse file tree 1 file changed +20
-8
lines changed Original file line number Diff line number Diff line change 18
18
print (" www.dragaosemchama.com.br" )
19
19
print (" github.com/robsoncouto/eprom\n " )
20
20
21
+ #Default value, 1MB chip:
22
+ romsize = 1 * 1024 * 1024
23
+ numsectors = int (romsize / 128 ) # I am sending data in 128 byte chunks
21
24
22
25
23
26
while True :
27
30
print (" 1-Read eprom " )
28
31
print (" 2-burn eprom " )
29
32
print (" 3-about this script " )
30
- print (" 4-quit \n " )
33
+ print (" 4-blank check " )
34
+ print (" 5-select chip size " )
35
+ print (" " )
36
+ print (" 6-quit \n " )
31
37
32
38
option = int (input ("Please insert a number:" ))
33
- romsize = 1 * 1024 * 1024
34
- numsectors = int (romsize / 128 ) # I am sending data in 128 byte chunks
35
- block = 0
39
+
36
40
if (option == 1 ):
37
41
name = input ("What the name of the file?" )
38
42
88
92
if response != CHK :
89
93
print ("wrong checksum, sending chunk again\n " )
90
94
f .close ()
91
- if (option == 4 ):
92
- print ("See ya!" )
93
- break
94
95
95
96
if (option == 3 ):
96
97
97
98
print ("\n A more detailed write up about this project is available at www.dragaosemchama.com.br" )
98
99
print ("This script goes together with a Arduino sketch, both are used to read and program" )
99
100
print ("eproms on the cheap." )
100
101
print ("Written by Robson Couto\n " )
101
- if (option == 5 ):
102
+ if (option == 4 ):
102
103
ser .flushInput ()
103
104
ser .write (b"\x55 " )
104
105
ser .write (bytes ("r" ,"ASCII" ))
118
119
else :
119
120
print ("\n The chip seems to contain data\n " )
120
121
print ("Done\n " )
122
+ if (option == 5 ):
123
+ print ("Current eprom size:" ,romsize / (1024 * 1024 ),"MB\n " )
124
+ megs = float (input ("Please insert the size of the eprom in Megabytes" ))
125
+ romsize = megs * 1024 * 1024
126
+ numsectors = int (romsize / 128 ) # I am sending data in 128 byte chunks
127
+ print ("Eprom size changed to " ,romsize / (1024 * 1024 ),"MB\n " )
128
+
129
+
130
+ if (option == 6 ):
131
+ print ("See ya!" )
132
+ break
You can’t perform that action at this time.
0 commit comments