summaryrefslogtreecommitdiffstats
path: root/libtoprammer/chips
diff options
context:
space:
mode:
authorMichael Buesch <m@bues.ch>2013-06-17 20:28:29 +0200
committerMichael Buesch <m@bues.ch>2013-06-17 20:28:29 +0200
commitc5cd29d59304fbfd9235c9c6986330427e8f49b2 (patch)
treea66c8dec08bc1fc206aa76378bd8553d8233de42 /libtoprammer/chips
parente3a6ef059209f9c08e234f11c6fb6b89a6ffed56 (diff)
downloadtoprammer-c5cd29d59304fbfd9235c9c6986330427e8f49b2.tar.xz
toprammer-c5cd29d59304fbfd9235c9c6986330427e8f49b2.zip
Fix PC increment on microchip02
Original patch by Pavel Štemberk <stemberk@gmail.com> Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'libtoprammer/chips')
-rw-r--r--libtoprammer/chips/microchip02/microchip02_common.py7
1 files changed, 2 insertions, 5 deletions
diff --git a/libtoprammer/chips/microchip02/microchip02_common.py b/libtoprammer/chips/microchip02/microchip02_common.py
index b31874d..6aa1e75 100644
--- a/libtoprammer/chips/microchip02/microchip02_common.py
+++ b/libtoprammer/chips/microchip02/microchip02_common.py
@@ -106,9 +106,7 @@ class Chip_Microchip02_common(Chip):
self.progressMeterInit("Reading flash", nrWords)
bufferedBytes = 0
for word in range(0, nrWords):
- self.__incrementPC(1)
self.__sendReadFlashInstr()
- #self.__busyWait()
self.top.cmdDelay(0.00002) #20us wait - inconsistent data if skipped
self.__readSDOBufferLow()
bufferedBytes += 1
@@ -118,6 +116,7 @@ class Chip_Microchip02_common(Chip):
image += self.top.cmdReadBufferReg(bufferedBytes)
self.progressMeter(word)
bufferedBytes = 0
+ self.__incrementPC(1)
image += self.top.cmdReadBufferReg(bufferedBytes)
self.progressMeterFinish()
self.__exitPM()
@@ -133,8 +132,6 @@ class Chip_Microchip02_common(Chip):
self.progressMeterInit("Writing flash", len(image) // 2)
for wordAddr in range(0, len(image) // 2):
self.progressMeter(wordAddr)
- #do not swap following two lines
- self.__incrementPC(1)
self.__sendInstr(self.CMD_LOAD_DATA_FOR_PGM)
WD = (byte2int(image[wordAddr * 2 + 1])<<8) | byte2int(image[wordAddr * 2 + 0])
if(WD != 0xfff):
@@ -143,7 +140,7 @@ class Chip_Microchip02_common(Chip):
self.__loadCommand(self.PROGCMD_SENDDATA)
self.top.hostDelay(0.000005)
self.__sendWriteFlashInstr()
-
+ self.__incrementPC(1)
self.progressMeterFinish()
self.__exitPM()
bues.ch cgit interface