#!/usr/bin/env python # # Create a map of valid addresses. RA4 on the serial_bridge should # be connected to the WR pin on the controller bus. # from devices import SerialBridge b = SerialBridge() f = open("valid.addresses", "w") for addr in xrange(0x10000): count = b.busWrite([0]*32, addr)[0] if count: f.write("%d\n" % addr) print "%d ******" % addr else: print "%d" % addr ### The End ###
#!/usr/bin/env python3 # # Create a map of valid addresses. RA4 on the serial_bridge should # be connected to the /WE pin on the controller bus. # from devices import SerialBridge b = SerialBridge() f = open("valid.addresses", "w") for addr in range(0x10000): count = int.from_bytes(b.busWrite(bytes([0]) * 32, addr)[0], byteorder='big') if count: f.write("%d\n" % addr) print("{} ******".format(addr)) else: print("{}".format(addr)) ### The End ###
#!/usr/bin/env python3 # # Using the valid.addresses file created by find_valid_addresses, # generate another map of just the addresses that generate a pulse # on a particular address line. This creates files that will be # used to generate a mapping from resulting address to the codes that # can generate it. # from devices import SerialBridge import sys b = SerialBridge() addrs = map(int, open("valid.addresses").readlines()) f = open(sys.argv[1], "w") for addr in addrs: count = int.from_bytes(b.busWrite(bytes([0])*32, addr)[0], byteorder='big') if count: f.write("%d\n" % addr) print("{} ******".format(addr)) else: print("{}".format(addr)) ### The End ###
#!/usr/bin/env python # # Using the valid.addresses file created by find_valid_addresses, # generate another map of just the addresses that generate a pulse # on a particular address line. This creates files that will be # used to generate a mapping from resulting address to the codes that # can generate it. # from devices import SerialBridge import sys b = SerialBridge() addrs = map(int, open("valid.addresses").readlines()) f = open(sys.argv[1], "w") for addr in addrs: count = b.busWrite([0] * 32, addr)[0] if count: f.write("%d\n" % addr) print "%d ******" % addr else: print "%d" % addr ### The End ###