Line 44... |
Line 44... |
#### EPCS code starts here ##################################################################
|
#### EPCS code starts here ##################################################################
|
|
|
|
|
#### global funcs ####
|
#### global funcs ####
|
def usage(s):
|
def usage(s):
|
print "Artec's Altera EPCS programming utility ver. 0.2 for USB Dongle"
|
print "Artec's Altera EPCS programming utility ver. 0.2.1 for USB Dongle"
|
print "Use with Altera ByteBlaster II programmer or compatible clone on LPT1"
|
print "Use with Altera ByteBlaster II programmer or compatible clone on LPT1"
|
print "like X-Blaster http://www.customcircuitsolutions.com/cable.html"
|
print "like X-Blaster http://www.customcircuitsolutions.com/cable.html or"
|
|
print "http://fpgaguy.110mb.com/"
|
print "Usage:"
|
print "Usage:"
|
print "Query : ",s," -q"
|
print "Query : ",s," -q"
|
print "Write file : ",s," [-v] <file>"
|
print "Write file : ",s," [-v] <file>"
|
print "Readback file : ",s," [-v] -r <file>"
|
print "Readback file : ",s," [-v] -r <file>"
|
print "Options:"
|
print "Options:"
|
Line 159... |
Line 160... |
self.pport.setData(0xFF)
|
self.pport.setData(0xFF)
|
self._data = 0xFF
|
self._data = 0xFF
|
|
|
|
|
def close(self):
|
def close(self):
|
self.pport.setData(0xFF)
|
epcs.pport.setData(0xFF)
|
self.pport.setAutoFeed(0) #disable BB II tristate buffers to drive
|
epcs.pport.setAutoFeed(1) #disable BB II tristate buffers to drive
|
|
epcs.clearPPDataBit(3) #enable Cyclon chip
|
|
epcs.clearPPDataBit(2) #enable Cyclon chip
|
|
|
def setPPDataBit(self,bit_no):
|
def setPPDataBit(self,bit_no):
|
self._data = self._data|(1<<bit_no)
|
self._data = self._data|(1<<bit_no)
|
self.pport.setData(self._data)
|
self.pport.setData(self._data)
|
#print "set bit %i setData(0x%2x)"%(bit_no,self._data)
|
#print "set bit %i setData(0x%2x)"%(bit_no,self._data)
|
Line 496... |
Line 498... |
except IOError:
|
except IOError:
|
print "IO Error on file open"
|
print "IO Error on file open"
|
sys.exit()
|
sys.exit()
|
|
|
epcs.close()
|
epcs.close()
|
|
time.sleep(0.5)
|
|
|
|
|
No newline at end of file
|
No newline at end of file
|