aboutsummaryrefslogtreecommitdiff
path: root/write_prog_eeprom.py
diff options
context:
space:
mode:
authorBenedict <benedict@0xb8000.de>2018-04-16 10:23:49 +0200
committerBenedict <benedict@0xb8000.de>2018-04-26 11:19:01 +0200
commita34ee32c743b35170777038a4c3ebbabf5686b43 (patch)
tree1df2053d6dd64e64626b542532fa0a42dbbaea18 /write_prog_eeprom.py
parent831920937a1541d6c15b357d3e0336c3291d8084 (diff)
eeprom: control logic: define instructions layout and write out script
Diffstat (limited to 'write_prog_eeprom.py')
-rw-r--r--write_prog_eeprom.py39
1 files changed, 39 insertions, 0 deletions
diff --git a/write_prog_eeprom.py b/write_prog_eeprom.py
new file mode 100644
index 0000000..a7440cf
--- /dev/null
+++ b/write_prog_eeprom.py
@@ -0,0 +1,39 @@
+## This file write different programms to the EEPROM AT28C
+
+## programm start at 0x00
+
+import test_prog
+import fibonacci_prog
+
+
+import eeprom_pi as ep
+import sys
+
+prog = None
+
+if len(sys.argv) == 2:
+ if sys.argv[1] == "test":
+ prog = test_prog.prog
+
+
+if prog == None:
+ print("error: please specify a valid programm.")
+ print("valid programms are: test")
+ exit()
+
+## start at addres 0x0
+address = 0x0
+inst_nr = 0
+
+ep.init_board()
+
+for instruction in prog:
+ print("%s: %s" % (hex(address+inst_nr), hex(instruction)))
+ ep.write_data_at(address+inst_nr, instruction)
+ inst_nr += 1
+
+trash = raw_input("please unplug the power from the EEPORM and press any key to continue")
+
+ep.cleanup()
+
+