diff --git a/README.md b/README.md index 8a0cf5a..feec732 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,5 @@ Flash a binary file to the EEPROM: ![Breadboard Diagram](at28c_programmer_bb.png) +See the [circuit pinout table](circuit_table.csv) as well. diff --git a/at28c_programmer.py b/at28c_programmer.py index b648303..4acdfaf 100644 --- a/at28c_programmer.py +++ b/at28c_programmer.py @@ -37,6 +37,8 @@ def main(): if (args.offset): addr = args.offset[0] + else: + args.offset = [0] # Set offset to zero if args.read: print("Reading EEPROM") @@ -59,8 +61,9 @@ def main(): contents = file.read() print("Input file size: " + str(len(contents))) - - print("Limiting to first " + str(args.limit[0]) + " bytes") + print(args) + if args.limit: + print("Limiting to first " + str(args.limit[0]) + " bytes") if args.write: for b in contents: @@ -83,7 +86,7 @@ def main(): print( str(addr - args.offset[0]) + " / " + str(len(contents))) - if args.limit[0] is not None and addr >= args.limit[0] + args.offset[0]: + if args.limit and args.limit[0] is not None and addr >= args.limit[0] + args.offset[0]: break elif args.clear: diff --git a/circuit_table.csv b/circuit_table.csv new file mode 100644 index 0000000..8ed9878 --- /dev/null +++ b/circuit_table.csv @@ -0,0 +1,29 @@ +EEPROM,Arduino +1,40 +2,38 +3,33 +4,32 +5,31 +6,30 +7,29 +8,28 +9,27 +10,26 +11,46 +12,47 +13,48 +14,GND +15,49 +16,50 +17,51 +18,52 +19,53 +20,7 +21,36 +22,8 +23,37 +24,35 +25,34 +26,39 +27,9 +28,5V