summaryrefslogtreecommitdiffstats
path: root/libtoprammer/chips/microchip8
diff options
context:
space:
mode:
authorPavel Štemberk <stemberk@gmail.com>2013-10-04 20:33:11 +0200
committerMichael Buesch <m@bues.ch>2013-10-04 20:33:11 +0200
commitd48a15b628b517aab47beefed4552da329cb0070 (patch)
tree0e3fd710526f6aab7c833d013bf6ec07d9589a45 /libtoprammer/chips/microchip8
parent90632de5833a2b3e706a7ee55ad9c4258cebefd2 (diff)
downloadtoprammer-d48a15b628b517aab47beefed4552da329cb0070.tar.xz
toprammer-d48a15b628b517aab47beefed4552da329cb0070.zip
Add more Microchip implementations
Signed-off-by: Michael Buesch <m@bues.ch>
Diffstat (limited to 'libtoprammer/chips/microchip8')
-rw-r--r--libtoprammer/chips/microchip8/__init__.py32
-rw-r--r--libtoprammer/chips/microchip8/makeSip6.py93
-rw-r--r--libtoprammer/chips/microchip8/microchip8_18_common.py394
-rw-r--r--libtoprammer/chips/microchip8/microchip8_18f1220family.py61
-rw-r--r--libtoprammer/chips/microchip8/microchip8_18f2221family.py73
-rw-r--r--libtoprammer/chips/microchip8/microchip8_18f97j60family.py103
-rw-r--r--libtoprammer/chips/microchip8/microchip8_common.py512
-rw-r--r--libtoprammer/chips/microchip8/microchip8_singlePMarea.py78
-rw-r--r--libtoprammer/chips/microchip8/microchip8_splittedPMarea.py132
-rw-r--r--libtoprammer/chips/microchip8/microchip8_splittedPMarea_hasResetPC.py72
-rw-r--r--libtoprammer/chips/microchip8/pic10f200dip8.py71
-rw-r--r--libtoprammer/chips/microchip8/pic10f202dip8.py71
-rw-r--r--libtoprammer/chips/microchip8/pic10f320dip8.py71
-rw-r--r--libtoprammer/chips/microchip8/pic10f322dip8.py71
-rw-r--r--libtoprammer/chips/microchip8/pic12f1822dip8.py91
-rw-r--r--libtoprammer/chips/microchip8/pic12f508dip8.py67
-rw-r--r--libtoprammer/chips/microchip8/pic12f629dip8.py81
-rw-r--r--libtoprammer/chips/microchip8/pic16f1823dip14.py91
-rw-r--r--libtoprammer/chips/microchip8/pic16f1824dip14.py90
-rw-r--r--libtoprammer/chips/microchip8/pic16f1825dip14.py88
-rw-r--r--libtoprammer/chips/microchip8/pic16f1826dip18.py88
-rw-r--r--libtoprammer/chips/microchip8/pic16f1827dip18.py88
-rw-r--r--libtoprammer/chips/microchip8/pic16f1828dip20.py88
-rw-r--r--libtoprammer/chips/microchip8/pic16f1829dip20.py88
-rw-r--r--libtoprammer/chips/microchip8/pic16f1933dip28.py90
-rw-r--r--libtoprammer/chips/microchip8/pic16f1934dip40.py90
-rw-r--r--libtoprammer/chips/microchip8/pic16f1936dip28.py90
-rw-r--r--libtoprammer/chips/microchip8/pic16f1937dip40.py90
-rw-r--r--libtoprammer/chips/microchip8/pic16f1938dip28.py90
-rw-r--r--libtoprammer/chips/microchip8/pic16f1939dip40.py90
-rw-r--r--libtoprammer/chips/microchip8/pic16f59dip40.py70
-rw-r--r--libtoprammer/chips/microchip8/pic16f630dip14.py81
-rw-r--r--libtoprammer/chips/microchip8/pic16f84adip18.py97
-rw-r--r--libtoprammer/chips/microchip8/pic16lf1902dip28.py87
-rw-r--r--libtoprammer/chips/microchip8/pic16lf1903dip28.py87
-rw-r--r--libtoprammer/chips/microchip8/pic16lf1904dip40.py87
-rw-r--r--libtoprammer/chips/microchip8/pic16lf1906dip28.py87
-rw-r--r--libtoprammer/chips/microchip8/pic16lf1907dip40.py87
-rw-r--r--libtoprammer/chips/microchip8/pic18f1220dip18.py179
-rw-r--r--libtoprammer/chips/microchip8/pic18f2320dip28.py179
-rw-r--r--libtoprammer/chips/microchip8/pic18f2321dip28.py179
-rw-r--r--libtoprammer/chips/microchip8/pic18f67j60sip6.py111
42 files changed, 4565 insertions, 0 deletions
diff --git a/libtoprammer/chips/microchip8/__init__.py b/libtoprammer/chips/microchip8/__init__.py
new file mode 100644
index 0000000..dabb5cb
--- /dev/null
+++ b/libtoprammer/chips/microchip8/__init__.py
@@ -0,0 +1,32 @@
+from pic10f200dip8 import *
+from pic10f202dip8 import *
+from pic10f320dip8 import *
+from pic10f322dip8 import *
+from pic12f1822dip8 import *
+from pic12f508dip8 import *
+from pic12f629dip8 import *
+from pic16f630dip14 import *
+from pic16f1824dip14 import *
+from pic16f1825dip14 import *
+from pic16f1826dip18 import *
+from pic16f1827dip18 import *
+from pic16f1828dip20 import *
+from pic16f1829dip20 import *
+from pic16lf1902dip28 import *
+from pic16lf1903dip28 import *
+from pic16lf1904dip40 import *
+from pic16lf1906dip28 import *
+from pic16lf1907dip40 import *
+from pic16f1933dip28 import *
+from pic16f1934dip40 import *
+from pic16f1936dip28 import *
+from pic16f1937dip40 import *
+from pic16f1938dip28 import *
+from pic16f1939dip40 import *
+from pic16f59dip40 import *
+from pic16f84adip18 import *
+from pic18f1220dip18 import *
+from pic18f2320dip28 import *
+from pic18f2321dip28 import *
+#from pic18f67j60sip6 import *
+#do not edit the text below this line
diff --git a/libtoprammer/chips/microchip8/makeSip6.py b/libtoprammer/chips/microchip8/makeSip6.py
new file mode 100644
index 0000000..e7f549f
--- /dev/null
+++ b/libtoprammer/chips/microchip8/makeSip6.py
@@ -0,0 +1,93 @@
+#!/usr/bin/env python
+
+"""
+# TOP2049 Open Source programming suite
+#
+# Commandline utility
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+import re
+import sys
+import os
+
+def clear():
+ inputFileName = '__init__.py'
+ tmpFileName = 'tmp'
+ fin = open(inputFileName)
+ ftmp = open(tmpFileName, 'w')
+ isToBeRemoved = False
+ for line in fin:
+ if isToBeRemoved:
+ matchObj = re.match('.*(pic\w+).*', line)
+ if matchObj:
+ print('removing file {}'.format(matchObj.group(1)))
+ os.remove('{}.py'.format(matchObj.group(1)))
+ else:
+ ftmp.write(line)
+ matchObj = re.match('#do not edit the text below this line.*', line)
+ if matchObj:
+ isToBeRemoved = True
+ fin.close()
+ ftmp.close()
+ os.rename(tmpFileName, inputFileName)
+
+def substitute(input, oldSocket, newSocket):
+ input = re.sub('(^\s*packages).*', lambda m:'{} = (("DIP10", ""), ),'.format(m.group(1)), input)
+ input = re.sub('(^\s*chipPackage).*', lambda m:'{} = "DIP10",'.format(m.group(1)), input)
+ input = re.sub('(^\s*chipPinVCC).*', lambda m:'{} = 9,'.format(m.group(1)), input)
+ input = re.sub('(^\s*chipPinsVPP).*', lambda m:'{} = 10,'.format(m.group(1)), input)
+ input = re.sub('(^\s*chipPinGND).*', lambda m:'{} = 8,'.format(m.group(1)), input)
+ input = re.sub('(^\s*runtimeID).*', lambda m:'{} = (0xDE05, 0x01),'.format(m.group(1)), input)
+ input = re.sub('(^\s*description).+"(.*)".*', lambda m:'{} = "{} - ICD",'.format(m.group(1), m.group(2)), input)
+ input = re.sub('(^\s*bitfile).*', lambda m:'{} = "microchip01sip6",'.format(m.group(1)), input)
+ input = re.sub("{}".format(oldSocket), "{}".format(newSocket), input)
+ return input
+
+
+def makeSip():
+ inputFileName = '__init__.py'
+ fin = open(inputFileName)
+ # from pic16f1824dip14 import *
+ dMCU = {}
+ for line in fin:
+ matchObj = re.match('#do not edit the text below this line.*', line)
+ if matchObj:
+ break
+ matchObj = re.match('.*(pic[0-9]+l?f\w+)(dip[0-9a]+).*', line)
+ print('matched {} - {}'.format(matchObj.group(1), matchObj.group(2)))
+ dMCU.setdefault(matchObj.group(1), matchObj.group(2))
+ fin.close()
+ finit = open("init", "a")
+ for item in dMCU.items():
+ fin = open("{}{}.py".format(item[0], item[1]))
+ fout = open("{}sip6.py".format(item[0]), 'w')
+ for line in fin:
+ fout.write(substitute(line, "{}".format(item[1]), "sip6"))
+ fout.close()
+ fin.close()
+ finit.write("from {}sip6 import *\n".format(item[0]))
+ finit.close()
+ print ('{} - {}'.format(item[0], item[1]))
+
+def main(argv):
+ clear()
+ # makeSip()
+
+if __name__ == "__main__":
+ xit(main(sys.argv))
diff --git a/libtoprammer/chips/microchip8/microchip8_18_common.py b/libtoprammer/chips/microchip8/microchip8_18_common.py
new file mode 100644
index 0000000..3e743c9
--- /dev/null
+++ b/libtoprammer/chips/microchip8/microchip8_18_common.py
@@ -0,0 +1,394 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip8_18_common - basic file for 8bit PIC18 MCU
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from libtoprammer.chip import *
+
+class Chip_Microchip8_18_common(Chip):
+
+ STAT_BUSY = 0x01
+ STAT_SDIO = 0x02
+
+
+ PCMDBIT_4BITINSTR = 0
+ PCMDBIT_SENDDATA = 1
+ PCMDBIT_READDATA = 2
+ PCMDBIT_KEEPCLKHIGH = 7
+
+ CMD_CORE_INSTRUCTION = 0x0
+ CMD_SHIFT_OUT_TABLAT = 0x2
+ CMD_TR = 0x8
+ CMD_TRI = 0x9
+ CMD_TRD = 0xA
+ CMD_ITR = 0xB
+ CMD_TW = 0xC
+ CMD_TWII = 0xD
+ CMD_TWDD = 0xE
+ CMD_TW_START_PROG = 0xF
+
+
+ # EEPROM access: default on, if does not exist override it
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ # default delays - can be overridden
+ delayP2A = 400e-9 # Serial clock low time
+ delayP5 = 2.2e-6 # Delay between 4-bit command and command operand
+ delayP5A = 2.2e-6 # Delay between 4-bit command operand and next 4-bit command
+ delayP6 = 2.2e-6 # Delay between last SCK fall of command byte to first SCK rise of read data word
+ delayP9 = 1e-3 # SCK High time (minimum programming time)
+ delayP10 = 30e-6 # SCK Low time after programming (high-voltage discharge time)
+ delayP11 = 0.01 # Delay to allow self-timed data write or bulk erase to occur
+ delayP12 = 0.000002 # Input data hold time from nMCLR/Vpp rise
+ delayP13 = 0.0000001 # Vdd rise setup time to nMCLR/Vpp rise
+ delayP14 = 0.00000001 # Data out Valid from SCK rise
+ delayP15 = 0.000002 # PGM rise setup time to nMCLR/Vpp rise
+
+ userIDLocationSize = 8
+ userIDLocationAddr = 0x200000
+
+ deviceIDAddr = 0x3FFFFE
+ configWordAddr = 0x300000
+ deviceIDLength = 2
+ voltageVDD = 5
+ voltageVPP = 12
+
+ def __init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes
+ ):
+ Chip.__init__(self,
+ chipPackage=chipPackage,
+ chipPinVCC=chipPinVCC,
+ chipPinsVPP=chipPinsVPP,
+ chipPinGND=chipPinGND)
+ self.signature = signature
+ self.flashPageSize = flashPageSize # Flash page size, in words
+ self.flashPages = flashPages # Nr of flash pages
+ self.eepromPageSize = eepromPageSize # EEPROM page size, in bytes
+ self.eepromPages = eepromPages # Nr of EEPROM pages
+ self.fuseBytes = fuseBytes # Nr of fuse bytes
+ self.isInPmMode = False
+ self.BufferedBytes = 0
+ self.Image = ""
+ self.programMemoryByteAddressRange = [(0, self.flashPageSize)]
+ self.configWordByteAddressRange = [(self.configWordAddr, self.configWordAddr + self.fuseBytes)]
+ self.userIDLocationByteAddressRange = [(self.userIDLocationAddr, self.userIDLocationAddr + self.userIDLocationSize)]
+
+ def enterPM(self, force=False):
+ if self.isInPmMode and not force:
+ return
+ "Enter HV programming mode. Vdd first entry mode"
+ self.applyVCC(False)
+ self.applyVPP(False)
+ self.applyGND(False)
+ self.setPins(0, 0)
+ self.top.cmdSetVCCVoltage(self.voltageVDD)
+ self.top.cmdSetVPPVoltage(self.voltageVPP)
+ self.applyGND(True)
+ self.applyVCC(True)
+ self.top.hostDelay(10 * self.delayP13)
+ self.applyVPP(True)
+ self.top.hostDelay(102 * self.delayP12)
+ self.setTopProgrammerDelays()
+ self.isInPmMode = True
+
+ def readUserIdLocation(self):
+ return self.readSequentialBlock(self.userIDLocationAddr, self.userIDLocationSize, "Reading User ID Locations")
+
+ def readFuse(self):
+ return self.readSequentialBlock(self.configWordAddr, self.fuseBytes, "Reading Config Words")
+
+ def readSignature(self):
+ return self.readSequentialBlock(self.deviceIDAddr, self.deviceIDLength, "Reading Signature")
+
+ def readProgmem(self):
+ nrBytes = self.flashPages * self.flashPageSize
+ return self.readSequentialBlock(0, nrBytes, "Reading flash")
+
+ def readSequentialBlock(self, startAddr, nBytes, infoText):
+ self.enterPM()
+ self.progressMeterInit(infoText, nBytes)
+ self.BufferedBytes = 0
+ self.Image = ""
+ self.executeCode(self.getCodeAddrToTBLPTR(startAddr))
+ for byteAddr in range(0, nBytes):
+ self.send4bitReadInstruction(self.CMD_TRI)
+ self.progressMeter(byteAddr)
+ self.progressMeterFinish()
+ self.flushBufferToImage()
+ return self.Image
+
+ def writeSequentialBlock(self, startAddr, image, size, infoText):
+ if len(image) > size:
+ self.throwError("Invalid flash image size %d (expected <=%d)" % \
+ (len(image), self.userIDLocationSize))
+ self.enterPM()
+ self.executeCode((0x8EA6, 0x9CA6))
+ self.progressMeterInit(infoText, len(image) / 8)
+ for blockAddr in range(0, len(image), self.writeBufferSize):
+ #print("addr:{:x}".format(startAddr+blockAddr))
+ self.executeCode(self.getCodeAddrToTBLPTR(startAddr+blockAddr))
+ #for code in self.getCodeAddrToTBLPTR(startAddr+blockAddr):
+ # print("({:x}, ".format(code))
+ print(")\n")
+ self.writeNbytes(image[blockAddr:], self.writeBufferSize)
+ #self.executeCode((0x0, 0x0))
+ self.progressMeter(blockAddr)
+ self.progressMeterFinish()
+
+ def readEEPROM(self):
+ nrBytes = self.eepromPages * self.eepromPageSize
+ self.enterPM()
+ self.progressMeterInit("Reading EEPROM", nrBytes)
+ self.BufferedBytes = 0
+ self.Image = ""
+ self.executeCode((0x9EA6, 0x9CA6))
+ for byteAddr in range(0, nrBytes):
+ # print("set addr to {:x}\n".format(byteAddr))
+ self.setEEPROMAddr(byteAddr)
+ self.executeCode((0x80A6, 0x50A8, 0x6EF5))
+ self.send4bitReadInstruction(self.CMD_SHIFT_OUT_TABLAT)
+ self.progressMeter(byteAddr)
+ self.progressMeterFinish()
+ self.flushBufferToImage()
+ return self.Image
+
+ def writeEEPROM(self, image):
+ nrBytes = self.eepromPages * self.eepromPageSize
+ if len(image) > nrBytes:
+ self.throwError("Invalid flash image size {:d} (expected <={:d})".format(len(image), nrBytes))
+ self.enterPM()
+ self.progressMeterInit("Writing eeprom", len(image))
+ self.executeCode((0x9EA6, 0x9CA6))
+ for addr in range(0, len(image)):
+ self.progressMeter(addr)
+ #print("writing {:x} value to addr {:x}\n".format(byte2int(image[addr]), addr))
+ self.setEEPROMAddr(addr)
+ self.executeCode((0x0E00 | (byte2int(image[addr]) & 0xFF), 0x6EA8))
+ self.executeCode((0x84A6, 0x0E55, 0x6EA7, 0x0EAA, 0x6EA7))
+ self.executeCode((0x82A6, 0x0, 0x0))
+ self.top.hostDelay(self.delayP11 + self.delayP10)
+ self.executeCode((0x94A6,))
+ self.progressMeterFinish()
+
+ def writeNbytes(self, image, N):
+ if N % 2:
+ self.throwError("N should be even, not %d" % N)
+ isEmpty = True
+ #N = (pN, len(image))[len(image) < pN]
+ for idx in range(0, N):
+ if idx == len(image):
+ image += '\xFF'
+ elif image[idx] != '\xFF':
+ isEmpty = False
+ if(not isEmpty):
+ for wordAddr in range(0, N-2, 2):
+ self.send4bitWriteInstruction(self.CMD_TWII, byte2int(image[wordAddr]) | (byte2int(image[wordAddr + 1]) << 8))
+ self.send4bitWriteInstruction(self.CMD_TW_START_PROG, byte2int(image[N-2]) | (byte2int(image[N-1]) << 8))
+ self.top.cmdFPGAWrite(0x12, 0x81)
+ self.top.hostDelay(self.delayP9)
+ self.setPins(0)
+ self.top.cmdDelay(self.delayP10)
+ for i in range(0,4):
+ self.sendCommand(1)
+
+ def writeUserIdLocation(self, image):
+ self.writeSequentialBlock(self.userIDLocationAddr, image, self.userIDLocationSize, "Writing User ID Locations")
+
+ def checkSignature(self):
+ signature = self.readSignature()
+ if signature != self.signature:
+ msg = "Unexpected device signature. " + \
+ "Want %02X%02X%02X, but got %02X%02X%02X" % \
+ (byte2int(self.signature[0]), byte2int(self.signature[1]),
+ byte2int(self.signature[2]),
+ byte2int(signature[0]), byte2int(signature[1]),
+ byte2int(signature[2]))
+ if self.top.getForceLevel() >= 1:
+ self.printWarning(msg)
+ else:
+ self.throwError(msg)
+
+ def writeProgmem(self, image):
+ nrBytes = self.flashPages * self.flashPageSize
+ if len(image) > nrBytes:
+ self.throwError("Invalid flash image size %d (expected <=%d)" % \
+ (len(image), nrBytes))
+ self.writeSequentialBlock(0, image, nrBytes, "Writing flash")
+
+ def writeFuse(self, image):
+ self.enterPM()
+ if len(image) > self.fuseBytes:
+ self.throwError("Invalid Fuses image size %d (expected less than %d)" % \
+ (len(image), self.fuseBytes))
+ self.executeCode((0x8EA6, 0x8CA6, 0xEF00, 0xF800))
+ for fuseAddr in range(0,len(image)):
+ self.executeCode(self.getCodeAddrToTBLPTR(self.configWordAddr+fuseAddr))
+ if(fuseAddr & 0x01):
+ byte = byte2int(image[fuseAddr]) << 8
+ else:
+ byte = byte2int(image[fuseAddr])
+ self.send4bitWriteInstruction(self.CMD_TW_START_PROG, byte)
+ self.top.cmdFPGAWrite(0x12, 0x81)
+ #self.setPins(1)
+ self.top.hostDelay(self.delayP9)
+ self.setPins(0)
+ self.top.cmdDelay(self.delayP10)
+ for i in range(0,4):
+ self.sendCommand(1)
+ #self.executeCode((0x2AF6,))
+ self.writeSequentialBlock(self.configWordAddr, image, self.fuseBytes, "Writing fuses")
+ self.progressMeterInit("Writing fuses", 0)
+
+ def exitPM(self):
+ "Exit programming mode. Vdd last exit mode"
+ self.top.flushCommands()
+ self.setPins(0, 0)
+ self.applyVPP(False)
+ self.applyVCC(False)
+ self.applyGND(False)
+ self.isInPmMode = False
+
+# ready for 18F below
+ def send4bitReadInstruction(self, pInstruction):
+ def incBbAndCheckFillImage():
+ self.BufferedBytes += 1
+ if self.BufferedBytes == self.top.getBufferRegSize():
+ self.flushBufferToImage()
+ # self.sendCommand(1,0,1,pInstruction)
+ self.sendCommand(1, 0, 1, pInstruction)
+ # self.busyWait()
+ self.readSDOBufferHigh()
+ incBbAndCheckFillImage()
+
+ def send4bitWriteInstruction(self, pInstruction, pDataPayload):
+ # self.busyWait()
+ self.setSDI(pDataPayload)
+ #print("sending {:x}\n".format(pDataPayload))
+ self.sendCommand(1, 1, 0, pInstruction)
+ self.top.flushCommands()
+
+ def sendCommand(self, bit4bitInstr=1, bitSendData=0, bitReadData=0, cmd4bit=0, bitKeepClkHigh=0):
+ '''
+ `define CMDBIT_4BITINSTR 0
+ `define CMDBIT_SENDDATA 1
+ `define CMDBIT_READDATA 2
+ `define CMDBIT_KEEPCLKHIGH 7
+ '''
+ command = (cmd4bit & 0x0F) << 3
+ if bit4bitInstr:
+ command |= 2 ** self.PCMDBIT_4BITINSTR
+ if bitSendData:
+ command |= 2 ** self.PCMDBIT_SENDDATA
+ if bitReadData:
+ command |= 2 ** self.PCMDBIT_READDATA
+ if bitKeepClkHigh:
+ command |= 2 ** self.PCMDBIT_KEEPCLKHIGH
+ # print("cmd sending {:x}\n".format(command))
+ self.top.cmdFPGAWrite(0x12, command)
+ if(bitSendData or bitReadData):
+ self.top.cmdDelay(2 * 20 * 2 * self.delayP2A)
+ else:
+ self.top.cmdDelay(2 * 4 * 2 * self.delayP2A)
+
+ def setTopProgrammerDelays(self):
+ #print("tdel5:{:d}".format(int(math.ceil(self.delayP2A / 42e-9))))
+ #print("tdly:{:d}".format(int(math.ceil(self.delayP5 / 42e-9))))
+ self.top.cmdFPGAWrite(0x10, int(math.ceil(self.delayP2A / 42e-9)))
+ self.top.cmdFPGAWrite(0x11, int(math.ceil(self.delayP5 / 42e-9)))
+
+ def setSDI8(self, sdi):
+ self.top.cmdFPGAWrite(0x16, sdi & 0xFF)
+
+ def setSDI(self, sdi):
+ '''
+ 16 -set 16 bit sdi value
+ '''
+ for addr in (0x16, 0x17):
+ self.top.cmdFPGAWrite(addr, sdi & 0xFF)
+ sdi = sdi >> 8
+
+ def flushBufferToImage(self):
+ # print ("storing {:d} bytes to image".format(self.BufferedBytes))
+ if self.BufferedBytes > 0:
+ self.Image += self.top.cmdReadBufferReg(self.BufferedBytes)
+ self.BufferedBytes = 0
+
+ def sendInstruction(self, instr):
+ self.setSDI(instr)
+ self.sendCommand(1, 1) # send 4 times positive edge
+ # self.top.flushCommands()
+
+ def executeCode(self, code):
+ for instr in code:
+ self.sendInstruction(instr)
+
+ def setPins(self, ICSPCLK=0, SDIOVALUE=0, SDIODRIVEN=1):
+ '''
+ 16 - setPins
+ '''
+ data = 0
+ if ICSPCLK:
+ data |= 1
+ if SDIODRIVEN:
+ data |= 2
+ if SDIOVALUE:
+ data |= 4
+ self.top.cmdFPGAWrite(0x15, data)
+
+ def getStatusFlags(self):
+ '''
+ [0] - BUSY
+ [1] - SDO
+ '''
+ self.flushBufferToImage()
+ self.top.cmdFPGARead(0x12)
+ stat = self.top.cmdReadBufferReg()
+ return byte2int(stat[0])
+
+ def readSDOBufferHigh(self):
+ self.top.cmdFPGARead(0x14)
+
+ def readSDOBufferLow(self):
+ self.top.cmdFPGARead(0x15)
+
+ def rawSDIOState(self):
+ return bool(self.getStatusFlags() & self.STAT_SDIO)
+
+ def isBusy(self):
+ return bool(self.getStatusFlags() & self.STAT_BUSY)
+
+ def busyWait(self):
+ for i in range(0, 100):
+ if not self.isBusy():
+ return
+ self.top.hostDelay(0.000001)
+ self.throwError("Timeout in busywait.")
+
+ def getCodeAddrToTBLPTR(self, addr):
+ ub = (addr >> 16) & 0xFF
+ hb = (addr >> 8) & 0xFF
+ lb = addr & 0xFF
+ return ((0x0E00 | ub), 0x6EF8, (0x0E00 | hb), 0x6EF7, (0x0E00 | lb), 0x6EF6)
diff --git a/libtoprammer/chips/microchip8/microchip8_18f1220family.py b/libtoprammer/chips/microchip8/microchip8_18f1220family.py
new file mode 100644
index 0000000..eb77386
--- /dev/null
+++ b/libtoprammer/chips/microchip8/microchip8_18f1220family.py
@@ -0,0 +1,61 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip8 - 18f1220 family - 8bit PIC MCU
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from libtoprammer.chips.microchip8.microchip8_18_common import *
+
+class microchip8_18f1220family(Chip_Microchip8_18_common):
+
+ voltageVDD = 4.5
+ voltageVPP = 9
+
+ writeBufferSize = 8
+ eraseBufferSize = 64
+
+ def __init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes
+ ):
+ Chip_Microchip8_18_common.__init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes)
+
+ def erase(self):
+ self.progressMeterInit("Erasing chip", 0)
+ self.enterPM(True)
+ self.executeCode(self.getCodeAddrToTBLPTR(0x3C0004))
+ self.send4bitWriteInstruction(self.CMD_TW, 0x0080)
+ self.executeCode((0x0000,))
+ self.sendCommand(1)
+ self.top.cmdDelay(self.delayP11 + self.delayP10)
+ for i in range(0,4):
+ self.sendCommand(1)
+ self.top.flushCommands()
+ self.progressMeterFinish()
+
+ def setEEPROMAddr(self, addr):
+ self.executeCode((0x0E00 | (addr & 0xFF), 0x6EA9))
diff --git a/libtoprammer/chips/microchip8/microchip8_18f2221family.py b/libtoprammer/chips/microchip8/microchip8_18f2221family.py
new file mode 100644
index 0000000..dca8dfd
--- /dev/null
+++ b/libtoprammer/chips/microchip8/microchip8_18f2221family.py
@@ -0,0 +1,73 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip8 - 18f2221 family - 8bit PIC MCU
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from libtoprammer.chips.microchip8.microchip8_18_common import *
+
+class microchip8_18f2221family(Chip_Microchip8_18_common):
+
+ voltageVDD = 5
+ voltageVPP = 11
+
+ delayP2A = 0.0000008 # Serial clock low time
+ delayP5 = 0.0000015 # Delay between 4-bit command and command operand
+
+ def __init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes
+ ):
+ Chip_Microchip8_18_common.__init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes)
+
+ def erase(self):
+ self.progressMeterInit("Erasing chip", 0)
+ self.enterPM(True)
+ self.executeCode(self.getCodeAddrToTBLPTR(0x3C0005))
+ self.send4bitWriteInstruction(self.CMD_TW, 0x3F3F)
+ self.executeCode(self.getCodeAddrToTBLPTR(0x3C0004))
+ self.send4bitWriteInstruction(self.CMD_TW, 0x8F8F)
+ self.executeCode((0x0000,))
+ self.sendCommand(1)
+ self.top.hostDelay(self.delayP11 + self.delayP10)
+ for i in range(0,4):
+ self.sendCommand(1)
+ self.top.flushCommands()
+ self.progressMeterFinish()
+
+ def eraseRow(self, rowAddr):
+ self.executeCode((0x8EA6, 0x9CA6, 0x84A6))
+ self.executeCode(self.getCodeAddrToTBLPTR(rowAddr))
+ self.executeCode((0x88A6, 0x82A6))
+ self.sendCommand(1, 0, 0, 0x0, 1)
+ self.top.hostDelay(self.delayP9)
+ self.setPins(0)
+ self.top.hostDelay(self.delayP10)
+
+ def setEEPROMAddr(self, addr):
+ self.executeCode((0x0E00 | (addr & 0xFF), 0x6EA9, (0x0E00 | ((addr >> 8) & 0xFF)), 0x6EAA))
+
diff --git a/libtoprammer/chips/microchip8/microchip8_18f97j60family.py b/libtoprammer/chips/microchip8/microchip8_18f97j60family.py
new file mode 100644
index 0000000..8270792
--- /dev/null
+++ b/libtoprammer/chips/microchip8/microchip8_18f97j60family.py
@@ -0,0 +1,103 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip8 - 18f97j60 family - 8bit PIC MCU
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from libtoprammer.chips.microchip8.microchip8_18_common import *
+
+class microchip8_18f97j60family(Chip_Microchip8_18_common):
+
+ voltageVDD = 3
+ voltageVPP = 3
+
+ delayP5A = 0.000000040 # Delay between 4-bit command operand and next 4-bit command
+ delayP9 = 0.0034 # SCK High time (minimum programming time)
+ delayP10 = 0.000005 # SCK Low time after programming (high-voltage discharge time)
+ delayP11 = 0.475 # Delay to allow self-timed data write or bulk erase to occur
+ delayP12 = 0.0004 # Input data hold time from nMCLR/Vpp rise
+ delayP19 = 0.000001 # Delay from first nMCLR fall to first PGC rise for key sequence on PGD
+ delayP20 = 0.00000004 # Delay from last PGC fall for key sequence on PGD to second nMCLR rise
+
+ def __init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes
+ ):
+ Chip_Microchip8_18_common.__init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes)
+
+ def enterPM(self, force=False):
+ if self.isInPmMode and not force:
+ return
+ "Enter HV programming mode. Vdd first entry mode"
+ self.applyVCC(False)
+ self.applyVPP(False)
+ self.applyGND(False)
+ self.setPins(0, 0)
+ #self.top.cmdSetVCCVoltage(self.voltageVDD)
+ self.top.cmdSetVPPVoltage(self.voltageVPP)
+ self.applyGND(True)
+ self.applyVCC(True)
+ self.top.hostDelay(self.delayP13)
+ self.applyVPP(True)
+ self.applyVPP(False)
+ self.top.hostDelay(self.delayP19)
+ self.setTopProgrammerDelays()
+ #program entry code
+ #print("sending enterpm")
+ self.top.cmdFPGAWrite(0x18,0xFF)
+ self.top.hostDelay(self.delayP20)
+ self.applyVPP(True)
+ self.top.hostDelay(self.delayP12)
+
+ self.isInPmMode = True
+
+ def erase(self):
+ self.progressMeterInit("Erasing chip", 0)
+ self.enterPM(True)
+ self.executeCode(self.getCodeAddrToTBLPTR(0x3C0004))
+ self.send4bitWriteInstruction(self.CMD_TW, 0x0080)
+ self.executeCode((0x0000,))
+ self.sendCommand(1)
+ self.top.hostDelay(self.delayP11 + self.delayP10)
+ for i in range(0,4):
+ self.sendCommand(1)
+ self.top.flushCommands()
+ self.progressMeterFinish()
+
+ def writeSequentialBlock(self, startAddr, image, size, infoText):
+ if len(image) > size:
+ self.throwError("Invalid flash image size %d (expected <=%d)" % \
+ (len(image), self.userIDLocationSize))
+ self.enterPM()
+ self.executeCode((0x8EA6, 0x9CA6))
+ self.progressMeterInit(infoText, len(image) / 8)
+ self.executeCode(self.getCodeAddrToTBLPTR(startAddr))
+ for blockAddr in range(0, len(image), 8):
+ self.write8bytes(image[blockAddr:])
+ self.progressMeter(blockAddr)
+ self.progressMeterFinish()
+ self.exitPM() \ No newline at end of file
diff --git a/libtoprammer/chips/microchip8/microchip8_common.py b/libtoprammer/chips/microchip8/microchip8_common.py
new file mode 100644
index 0000000..0a53d5a
--- /dev/null
+++ b/libtoprammer/chips/microchip8/microchip8_common.py
@@ -0,0 +1,512 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip8 common - basic file for 8bit PIC MCU
+#
+# Copyright (c) 2012 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from libtoprammer.chip import *
+import math
+
+class Chip_Microchip8_common(Chip):
+ CMD_LOAD_DATA_FOR_PGM = 0x02
+ CMD_LOAD_DATA_FOR_DM = 0x03
+ CMD_READ_DATA_FROM_PGM = 0x04
+ CMD_READ_DATA_FROM_DM = 0x05
+ CMD_INCREMENT_ADDRESS = 0x06
+ CMD_BULK_ERASE_PGM = 0x09
+ CMD_BULK_ERASE_DM = 0x0B
+
+ PCMDBIT_4BITINSTR = 0
+ PCMDBIT_SENDDATA = 1
+ PCMDBIT_READDATA = 2
+
+ STAT_BUSY = 0x01
+ STAT_SDIO = 0x02
+
+ # EEPROM access: default off, if exists override it
+ SUPPORT_EEPROMREAD = (0 << 4)
+ SUPPORT_EEPROMWRITE = (0 << 5)
+
+ # default delays - can be overridden
+ delayTdly5 = 0.00000015
+ delayTdis = 0.0001
+ delayTprog = 0.001
+ delayTdly = 0.000001
+ delayTera = 0.01
+
+
+ def __init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes
+ ):
+ Chip.__init__(self,
+ chipPackage=chipPackage,
+ chipPinVCC=chipPinVCC,
+ chipPinsVPP=chipPinsVPP,
+ chipPinGND=chipPinGND)
+ self.signature = signature
+ self.flashPageSize = flashPageSize # Flash page size, in words
+ self.flashPages = flashPages # Nr of flash pages
+ self.eepromPageSize = eepromPageSize # EEPROM page size, in bytes
+ self.eepromPages = eepromPages # Nr of EEPROM pages
+ self.fuseBytes = fuseBytes # Nr of fuse bytes
+ self.PC = 0
+ self.isInPmMode = False
+
+ # if(eepromPageSize == 0):
+ # self.SUPPORT_EEPROMREAD = (0 << 4)
+ # self.SUPPORT_EEPROMWRITE = (0 << 5)
+
+ def erase(self):
+ if(hasattr(self, 'osccalAddr')):
+ self.__erase(keepOSCCAL=True)
+ else:
+ self.__erase(keepOSCCAL=False)
+
+ def __erase(self, keepConfigWord=False, keepUserIDLocation=False, keepOSCCAL=False, keepEEPROM=False):
+ OSCCAL = 0xfff
+ self.enterPM()
+ if(keepOSCCAL):
+ self.progressMeterInit("Reading OSCCAL)", 0)
+ self.setPC(self.osccalAddr)
+ self.sendReadFlashInstr()
+ self.top.cmdDelay(self.delayTdly)
+ self.readSDOBufferLow()
+ self.readSDOBufferHigh()
+ OSCCAL = self.top.cmdReadBufferReg16()
+ self.progressMeterFinish()
+ if(hasattr(self, 'osccalBackupAddr') and OSCCAL == 0xfff):
+ self.progressMeterInit("OSCCAL value lost, restoring from backup location ...", 0)
+ print("OSCCAL value lost, restoring from backup location ...")
+ self.setPC(self.osccalBackupAddr - self.osccalAddr)
+ self.sendReadFlashInstr()
+ self.top.cmdDelay(self.delayTdly)
+ self.readSDOBufferLow()
+ self.readSDOBufferHigh()
+ OSCCAL = self.top.cmdReadBufferReg16()
+ self.progressMeterFinish()
+ # print ("osccal: %x\n" % OSCCAL)
+ if(keepConfigWord):
+ self.progressMeterInit("Reading ConfigWord for backup", 0)
+ CW = self.getConfigWord()
+ self.progressMeterFinish()
+ # erase User ID Location and backup osccal Tooo
+ # erase User ID Location and backup osccal Tooo
+ if(not keepUserIDLocation):
+ self.enterConfigArea()
+ self.setPC(self.userIDLocationAddr)
+ self.progressMeterInit("Erasing chip", 0)
+ self.bulkErasePGM()
+ self.progressMeterFinish()
+ # OSCCAL=0x3454
+ # OSCCAL=0x0C0A
+ if(keepOSCCAL and OSCCAL != 0xfff):
+ self.exitPM()
+ self.enterPM()
+ self.progressMeterInit("Writing osccal, value %x" % OSCCAL, 0)
+ print("Writing osccal, value %x" % OSCCAL)
+ self.setPC(self.osccalAddr)
+ # print("PC is set to %x" % self.PC)
+ self.send6bitWriteInstruction(self.CMD_LOAD_DATA_FOR_PGM, OSCCAL)
+ self.top.cmdDelay(self.delayTdly)
+ self.sendWriteFlashInstr()
+ self.progressMeterFinish()
+ if(keepConfigWord):
+ self.progressMeterInit("Writing ConfigWord, value %x" % CW, 0)
+ self.writeConfigWord(CW)
+ self.progressMeterFinish()
+ if((not keepEEPROM) and self.SUPPORT_EEPROMWRITE):
+ self.progressMeterInit("Erasing EEPROM", 0)
+ self.bulkEraseDM()
+ self.progressMeterFinish()
+ self.exitPM()
+
+ def bulkErasePGM(self):
+ self.sendCommand(0, 0, 0, self.CMD_BULK_ERASE_PGM)
+ self.top.cmdDelay(self.delayTera) # Tera
+
+ def bulkEraseDM(self):
+ self.sendCommand(0, 0, 0, self.CMD_BULK_ERASE_DM)
+ self.top.cmdDelay(self.delayTera) # Tera
+
+ def readProgmem(self):
+ nrWords = self.flashPages * self.flashPageSize
+ image = ""
+ self.enterPM()
+ self.setPC(0)
+ self.progressMeterInit("Reading flash", nrWords)
+ bufferedBytes = 0
+ for word in range(0, nrWords):
+ self.sendReadFlashInstr()
+ # self.top.cmdDelay(0.00002) #20us wait - inconsistent data if skipped
+ self.top.cmdDelay(self.delayTdly)
+
+ self.readSDOBufferLow()
+ bufferedBytes += 1
+ self.readSDOBufferHigh()
+ bufferedBytes += 1
+ if bufferedBytes == self.top.getBufferRegSize():
+ image += self.top.cmdReadBufferReg(bufferedBytes)
+ self.progressMeter(word)
+ bufferedBytes = 0
+ self.incrementPC(1)
+ image += self.top.cmdReadBufferReg(bufferedBytes)
+ self.progressMeterFinish()
+ # self.exitPM()
+ return image
+
+ def readEEPROM(self):
+ nrWords = self.eepromPages * self.eepromPageSize
+ image = ""
+ self.enterPM()
+ self.progressMeterInit("Reading eeprom", nrWords)
+ bufferedBytes = 0
+ for word in range(0, nrWords):
+ self.sendReadEEPROMInstr()
+ self.top.cmdDelay(self.delayTdly) # 20us wait - inconsistent data if skipped
+ self.readSDOBufferLow()
+ bufferedBytes += 1
+ if bufferedBytes == self.top.getBufferRegSize():
+ image += self.top.cmdReadBufferReg(bufferedBytes)
+ self.progressMeter(word)
+ bufferedBytes = 0
+ self.incrementPC(1)
+ image += self.top.cmdReadBufferReg(bufferedBytes)
+ self.progressMeterFinish()
+ # self.exitPM()
+ return image
+
+ def writeEEPROM(self, image):
+ nrWords = self.eepromPages * self.eepromPageSize
+ if len(image) > nrWords:
+ self.throwError("Invalid flash image size %d (expected <=%d)" % len(image))
+ self.enterPM()
+ self.progressMeterInit("Writing eeprom", nrWords)
+ bufferedBytes = 0
+ for addr in range(0, len(image)):
+ self.progressMeter(addr)
+ byte = byte2int(image[addr])
+ if byte != 0xff:
+ self.send6bitWriteInstruction(self.CMD_LOAD_DATA_FOR_DM, byte)
+ self.top.cmdDelay(self.delayTdly)
+ self.sendWriteFlashInstrDM()
+ self.incrementPC(1)
+ self.progressMeterFinish()
+ # self.exitPM()
+
+ def writeProgmem(self, image):
+ nrWords = self.flashPages * self.flashPageSize
+ if len(image) > nrWords * 2 or len(image) % 2 != 0:
+ self.throwError("Invalid flash image size %d (expected <=%d and word aligned)" % \
+ (len(image), nrWords * 2))
+ self.progressMeterInit("Writing flash", len(image) // 2)
+ self.enterPM()
+ self.setPC(0)
+ for wordAddr in range(0, len(image) // 2):
+ self.progressMeter(wordAddr)
+ # do not swap following two lines
+ WD = (byte2int(image[wordAddr * 2 + 1]) << 8) | byte2int(image[wordAddr * 2 + 0])
+ if(WD != (ord(self.defaultWord[1]) << 8) + ord(self.defaultWord[0])):
+ self.send6bitWriteInstruction(self.CMD_LOAD_DATA_FOR_PGM, WD)
+ self.top.cmdDelay(self.delayTdly)
+ self.sendWriteFlashInstr()
+ self.incrementPC(1)
+ self.progressMeterFinish()
+ # self.exitPM()
+
+ def readFuse(self):
+ self.enterPM()
+ fuses = []
+ self.progressMeterInit("Reading fuses (configuration word)", 0)
+ for CW in self.getConfigWord():
+ fuses.append(int2byte(CW & 0x00ff))
+ fuses.append(int2byte((CW >> 8) & 0x00ff))
+ self.progressMeterFinish()
+ return b"".join(fuses)
+
+ def readUserIdLocation(self):
+ self.enterPM()
+ self.enterConfigArea()
+ self.setPC(self.userIDLocationAddr)
+ self.progressMeterInit("Reading User ID Location", 0)
+ for i in range(0, self.userIDLocationSize):
+ self.sendReadFlashInstr()
+ self.top.hostDelay(self.delayTdly)
+ self.readSDOBufferLow()
+ self.readSDOBufferHigh()
+ self.incrementPC(1)
+ # self.exitPM()
+ self.progressMeterFinish()
+ return self.top.cmdReadBufferReg()[0:2 * self.userIDLocationSize]
+
+ def writeUserIdLocation(self, image):
+ if len(image) > self.userIDLocationSize * 2 or len(image) % 2 != 0:
+ self.throwError("Invalid flash image size %d (expected <=%d and word aligned)" % \
+ (len(image), self.userIDLocationSize * 2))
+ self.enterPM()
+ self.enterConfigArea()
+ self.setPC(self.userIDLocationAddr)
+ self.progressMeterInit("Writing User ID Location", (len(image) // 2) - 1)
+ for word in range(0, (len(image) // 2)):
+ self.progressMeter(word)
+ # do not swap following two lines
+ WD = (byte2int(image[word * 2 + 1]) << 8) | byte2int(image[word * 2 + 0])
+ if(WD != (ord(self.defaultWord[1]) << 8) + ord(self.defaultWord[0])):
+ self.send6bitWriteInstruction(self.CMD_LOAD_DATA_FOR_PGM, WD)
+ self.sendWriteFlashInstr()
+ self.incrementPC(1)
+ self.top.hostDelay(self.delayTdly)
+ self.sendWriteFlashInstr()
+ self.progressMeterFinish()
+ # self.exitPM()
+
+ def getConfigWordSize(self):
+ return self.fuseBytes // 2
+
+ def getConfigWord(self):
+ self.enterPM()
+ self.enterConfigArea()
+ self.setPC(self.configWordAddr)
+ retVal = []
+ for i in range(0, self.getConfigWordSize()):
+ self.sendReadFlashInstr()
+ self.top.cmdDelay(self.delayTdly)
+ self.readSDOBufferLow()
+ self.readSDOBufferHigh()
+ self.incrementPC(1)
+ retVal.append(self.top.cmdReadBufferReg16())
+
+ return retVal
+
+ def writeFuse(self, image):
+ if len(image) != 2 * self.getConfigWordSize():
+ self.throwError("Invalid Fuses image size %d (expected %d)" % \
+ (len(image), 2 * self.getConfigWordSize()))
+ self.progressMeterInit("Writing fuses", 0)
+ # print "image1:%x,,%x,,%x" % (byte2int(image[0]),byte2int(image[1]),byte2int(image[1])<<8)
+ CW = []
+ for tBytes in zip(image[::2], image[1::2]):
+ CW.append((byte2int(tBytes[1]) << 8) | byte2int(tBytes[0]))
+ self.writeConfigWord(CW)
+ self.progressMeterFinish()
+
+ def writeConfigWord(self, listConfigWord16):
+ # Externally timed writes are not supported
+ # for Configuration and Calibration bits. Any
+ # externally timed write to the Configuration
+ # or Calibration Word will have no effect on
+ # the targeted word.
+ self.enterPM()
+ self.enterConfigArea()
+ self.setPC(self.configWordAddr)
+ for configWord16 in listConfigWord16:
+ # print "write CW {:x}".format(configWord16)
+ self.send6bitWriteInstruction(self.CMD_LOAD_DATA_FOR_PGM, configWord16)
+ self.top.cmdDelay(self.delayTdly)
+ self.sendWriteFlashInstrCW()
+ self.incrementPC(1)
+ self.top.flushCommands()
+
+
+
+ def enterPM(self):
+ if self.isInPmMode and self.isInsideProgramMemoryArea:
+ self.resetPC()
+ return
+ self.PC = self.initPcValue
+ self.isInsideProgramMemoryArea = True
+ "Enter HV programming mode. Vdd first entry mode"
+ self.applyVCC(False)
+ self.applyVPP(False)
+ self.applyGND(False)
+ self.setPins(0, 0)
+ self.top.cmdSetVCCVoltage(self.voltageVDD)
+ self.top.cmdSetVPPVoltage(self.voltageVPP)
+ # self.top.cmdEnableZifPullups(True)
+ self.applyGND(True)
+
+ self.applyVCC(True)
+ # self.top.cmdDelay(0.000005)
+
+ for i in range(0, 2):
+ self.applyVPP(True)
+ # self.top.cmdDelay(0.000005)
+ self.applyVPP(False)
+ # self.top.cmdDelay(0.000031)
+ self.applyVPP(True)
+ # self.top.cmdEnableZifPullups(True)
+
+ # self.top.cmdDelay(0.000005) #least 5us is required to reach Vdd first entry PM
+ self.setTopProgrammerDelays()
+ self.isInPmMode = True
+
+ def checkSignature(self):
+ signature = self.readSignature()
+ if signature != self.signature:
+ msg = "Unexpected device signature. " + \
+ "Want %02X%02X%02X, but got %02X%02X%02X" % \
+ (byte2int(self.signature[0]), byte2int(self.signature[1]),
+ byte2int(self.signature[2]),
+ byte2int(signature[0]), byte2int(signature[1]),
+ byte2int(signature[2]))
+ if self.top.getForceLevel() >= 1:
+ self.printWarning(msg)
+ else:
+ self.throwError(msg)
+
+ def exitPM(self):
+ "Exit HV programming mode. Vdd last exit mode"
+ self.top.flushCommands()
+ self.setPins(0, 0)
+ self.applyVPP(False)
+ self.applyGND(False)
+ self.top.hostDelay(self.delayTdly)
+ self.applyVCC(False)
+ self.isInPmMode = False
+
+ def sendReadFlashInstr(self):
+ '''
+ '''
+ self.sendCommand(0, 0, 1, self.CMD_READ_DATA_FROM_PGM)
+
+ def sendWriteFlashInstr(self):
+ '''
+ to be overriden
+ '''
+ pass
+
+ def sendReadEEPROMInstr(self):
+ '''
+ '''
+ self.sendCommand(0, 0, 1, self.CMD_READ_DATA_FROM_DM)
+
+ def send6bitReadInstruction(self, pInstruction):
+ def incBbAndCheckFillImage():
+ self.BufferedBytes += 1
+ if self.BufferedBytes == self.top.getBufferRegSize():
+ self.flushBufferToImage()
+ # self.sendCommand(1,0,1,pInstruction)
+ self.sendCommand(0, 0, 1, pInstruction)
+ # self.busyWait()
+ self.readSDOBufferHigh()
+ incBbAndCheckFillImage()
+
+ def send6bitWriteInstruction(self, pInstruction, pDataPayload):
+ # self.busyWait()
+ self.setSDI(pDataPayload)
+ # print("sending {:x}\n".format(pDataPayload))
+ self.sendCommand(0, 1, 0, pInstruction)
+ self.top.flushCommands()
+
+ def setSDI(self, sdi):
+ '''
+ set 14 bit sdi value
+ '''
+ self.top.cmdFPGAWrite(0x13, sdi & 0xFF)
+ self.top.cmdFPGAWrite(0x14, (sdi >> 8) & 0x3F)
+
+ def sendCommand(self, bit4bitInstr=0, bitSendData=0, bitReadData=0, cmd4bit=0):
+ '''
+ `define CMDBIT_4BITINSTR 0
+ `define CMDBIT_SENDDATA 1
+ `define CMDBIT_READDATA 2
+ '''
+ command = (cmd4bit & 0x1F) << 3
+ if bit4bitInstr:
+ command |= 2 ** self.PCMDBIT_4BITINSTR
+ if bitSendData:
+ command |= 2 ** self.PCMDBIT_SENDDATA
+ if bitReadData:
+ command |= 2 ** self.PCMDBIT_READDATA
+ # print("cmd sending {:x}\n".format(command))
+ self.top.cmdFPGAWrite(0x12, command)
+
+ def setTopProgrammerDelays(self):
+ #print("tdel5:{:d}".format(int(math.ceil(self.delayTdly5 / 42e-9))))
+ #print("tdly:{:d}".format(int(math.ceil(self.delayTdly / 42e-9))))
+ self.top.cmdFPGAWrite(0x10, int(math.ceil(self.delayTdly5 / 42e-9)))
+ self.top.cmdFPGAWrite(0x11, int(math.ceil(self.delayTdly / 42e-9)))
+
+# def runCommandSync(self, command):
+# self.loadCommand(command)
+# self.busyWait()
+ def resetPC(self):
+ '''can be overriden'''
+ self.setPC(self.initPcValue)
+
+ def setPC(self, address):
+ '''to be overriden'''
+ pass
+
+ def incrementPC(self, count):
+ '''to be overriden'''
+ pass
+
+ def enterConfigArea(self, wordLatched=0):
+ '''to be overriden'''
+ pass
+
+ def setPins(self, ICSPCLK=0, SDIOVALUE=0, SDIODRIVEN=1):
+ '''
+ setPins
+ '''
+ data = 0
+ if ICSPCLK:
+ data |= 1
+ if SDIODRIVEN:
+ data |= 2
+ if SDIOVALUE:
+ data |= 4
+ self.top.cmdFPGAWrite(0x15, data)
+
+ def getStatusFlags(self):
+ '''
+ '''
+ self.top.cmdFPGARead(0x12)
+ stat = self.top.cmdReadBufferReg()
+ return byte2int(stat[0])
+
+ def readSDOBufferHigh(self):
+ self.top.cmdFPGARead(0x10)
+
+ def readSDOBufferLow(self):
+ self.top.cmdFPGARead(0x13)
+
+ def rawSDIOState(self):
+ return bool(self.getStatusFlags() & self.STAT_SDIO)
+
+ def busy(self):
+ return bool(self.getStatusFlags() & self.STAT_BUSY)
+
+# def busyWait(self):
+# for i in range(0, 100):
+# if not self.busy():
+# return
+# self.top.hostDelay(0.01)
+# self.throwError("Timeout in busywait.")
+
+# def waitHighSDIO(self):
+# for i in range(0, 100):
+# if self.rawSDOState():
+# return
+# self.top.hostDelay(0.01)
+# self.throwError("Timeout waiting for SDO.")
diff --git a/libtoprammer/chips/microchip8/microchip8_singlePMarea.py b/libtoprammer/chips/microchip8/microchip8_singlePMarea.py
new file mode 100644
index 0000000..bd720c0
--- /dev/null
+++ b/libtoprammer/chips/microchip8/microchip8_singlePMarea.py
@@ -0,0 +1,78 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# pic8_singlePMarea - file for older 8bit PIC MCUs
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from libtoprammer.chips.microchip8.microchip8_common import *
+
+class microchip8_singlePMarea(Chip_Microchip8_common):
+ CMD_BEGIN_PROGRAMMING = 0x08
+ CMD_END_PROGRAMMING = 0x0E
+
+ userIDLocationSize = 4
+ SUPPORT_SIGREAD = (0 << 1)
+
+ voltageVDD = 5
+ voltageVPP = 13
+ defaultWord = [b'\xFF', b'\x0F']
+
+ def __init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes
+ ):
+ Chip_Microchip8_common.__init__(self, chipPackage, chipPinVCC, chipPinsVPP, chipPinGND, signature, flashPageSize, flashPages, eepromPageSize, eepromPages, fuseBytes)
+ self.initPcValue = self.logicalFlashSize - 1
+ self.configWordAddr = self.logicalFlashSize - 1
+ self.osccalAddr = self.flashPageSize - 1
+ self.userIDLocationAddr = self.flashPageSize
+ self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize
+ self.programMemoryByteAddressRange = [(0, 2 * self.flashPageSize)]
+ self.configWordByteAddressRange = [(2 * self.configWordAddr, 2 * self.configWordAddr + 1), (2 * 0xFFF, 2 * 0xFFF + 1)]
+ self.userIDLocationByteAddressRange = [(2 * self.userIDLocationAddr, 2 * (self.userIDLocationAddr + self.userIDLocationSize) - 1)]
+
+ def setPC(self, address):
+ while(self.PC != address):
+ self.incrementPC(1)
+
+ def incrementPC(self, count):
+ for address in range(0, count):
+ self.sendCommand(0, 0, 0, self.CMD_INCREMENT_ADDRESS)
+ self.PC += 1
+ if (self.PC == self.logicalFlashSize):
+ self.PC = 0
+
+ def sendWriteFlashInstr(self):
+ '''
+ '''
+ # self.loadCommand(self.PROGCMD_SENDDATA)
+ # self.top.hostDelay(0.000005)
+ self.sendCommand(0, 0, 0, self.CMD_BEGIN_PROGRAMMING)
+ self.top.cmdDelay(self.delayTprog) # 025) #Tprog
+ self.sendCommand(0, 0, 0, self.CMD_END_PROGRAMMING)
+ self.top.cmdDelay(self.delayTdis) # Tdis
+
+ def sendWriteFlashInstrDM(self):
+ self.sendWriteFlashInstr()
+
+ def sendWriteFlashInstrCW(self):
+ self.sendWriteFlashInstr()
diff --git a/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py b/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py
new file mode 100644
index 0000000..dd3902f
--- /dev/null
+++ b/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py
@@ -0,0 +1,132 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# pic8_splittedPMarea - file for newer 8bit PIC MCUs
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from libtoprammer.chips.microchip8.microchip8_common import *
+
+class microchip8_splittedPMarea(Chip_Microchip8_common):
+ CMD_LOAD_CONFIGURATION = 0x00
+
+ logicalFlashProgramMemorySize = 0x2000
+ logicalFlashConfigurationMemorySize = 0x2000
+
+ CMD_BEGIN_INTERNALLY_TIMED_PROGRAMMING = 0x08
+ CMD_BEGIN_EXTERNALLY_TIMED_PROGRAMMING = 0x18
+ CMD_END_EXTERNALLY_TIMED_PROGRAMMING = 0x0A
+ CMD_ROW_ERASE_PGM = 0x11
+
+ delayTinternalProgDM = 0.005
+ delayTinternalProgPM = 0.0025
+ # overriding:
+ delayTdis = 0.0003
+ delayTprog = 0.0021
+ delayTdly = 0.0000015
+ delayTera = 0.005
+
+ defaultWord = [b'\xFF', b'\x3F']
+
+ def __init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes
+ ):
+ Chip_Microchip8_common.__init__(self, chipPackage, chipPinVCC, chipPinsVPP, chipPinGND, signature, flashPageSize, flashPages, eepromPageSize, eepromPages, fuseBytes)
+ self.isInsideProgramMemoryArea = True
+ self.initPcValue = 0
+ self.userIDLocationAddr = self.logicalFlashProgramMemorySize
+ self.deviceIDAddr = self.logicalFlashProgramMemorySize + 0x06
+ self.configWordAddr = self.logicalFlashProgramMemorySize + 0x07
+ self.programMemoryByteAddressRange = [(0, 2 * self.flashPageSize)]
+ self.configWordByteAddressRange = [(2 * self.configWordAddr, 2 * self.configWordAddr + 1)]
+ self.userIDLocationByteAddressRange = [(2 * self.userIDLocationAddr, 2 * (self.userIDLocationAddr + self.userIDLocationSize) - 1)]
+
+ def incrementPC(self, count):
+ for address in range(0, count):
+ self.sendCommand(0, 0, 0, self.CMD_INCREMENT_ADDRESS)
+ self.PC += 1
+ if(self.isInsideProgramMemoryArea):
+ if (self.PC == self.logicalFlashProgramMemorySize):
+ self.PC = 0
+ else:
+ if (self.PC == self.logicalFlashConfigurationMemorySize):
+ self.PC = self.logicalFlashProgramMemorySize
+
+ def enterConfigArea(self, wordLatched=0):
+ self.send6bitWriteInstruction(self.CMD_LOAD_CONFIGURATION, wordLatched)
+ self.PC = self.logicalFlashProgramMemorySize
+ self.isInsideProgramMemoryArea = False
+
+ def setPC(self, address):
+ if(self.isInsideProgramMemoryArea):
+ if(address >= self.logicalFlashProgramMemorySize):
+ raise(TOPException('Cannot set PC to address inside PM {:x}'.format(address)))
+ else:
+ if(address < self.logicalFlashProgramMemorySize):
+ raise(TOPException('Cannot set PC to address outside PM {:x}'.format(address)))
+ while(self.PC != address):
+ self.incrementPC(1)
+
+ def readSignature(self):
+ self.progressMeterInit("Reading signature", 0)
+ self.enterPM()
+ self.enterConfigArea()
+ self.setPC(self.deviceIDAddr)
+ idSize = 1
+ for i in range(0, idSize):
+ self.sendReadFlashInstr()
+ self.top.hostDelay(0.00002)
+ self.readSDOBufferLow()
+ self.readSDOBufferHigh()
+ self.incrementPC(1)
+ self.progressMeterFinish()
+ return self.top.cmdReadBufferReg()[0:2 * idSize]
+
+ def sendWriteFlashInstrExternallyTimed(self):
+ '''
+ '''
+ self.sendCommand(0, 0, 0, self.CMD_BEGIN_EXTERNALLY_TIMED_PROGRAMMING)
+ self.top.hostDelay(self.delayTprog)
+ self.sendCommand(0, 0, 0, self.CMD_END_EXTERNALLY_TIMED_PROGRAMMING)
+ self.top.hostDelay(self.delayTdis)
+
+ def sendWriteFlashInstrPM(self):
+ '''
+ '''
+ self.sendCommand(0, 0, 0, self.CMD_BEGIN_INTERNALLY_TIMED_PROGRAMMING)
+ self.top.hostDelay(self.delayTinternalProgPM)
+
+ def sendWriteFlashInstrCW(self):
+ '''
+ '''
+ self.sendCommand(0, 0, 0, self.CMD_BEGIN_INTERNALLY_TIMED_PROGRAMMING)
+ self.top.hostDelay(self.delayTinternalProgDM)
+
+ def sendWriteFlashInstr(self):
+ '''
+ '''
+ self.sendWriteFlashInstrPM()
+
+ def sendWriteFlashInstrDM(self):
+ '''
+ '''
+ self.sendWriteFlashInstrExternallyTimed()
diff --git a/libtoprammer/chips/microchip8/microchip8_splittedPMarea_hasResetPC.py b/libtoprammer/chips/microchip8/microchip8_splittedPMarea_hasResetPC.py
new file mode 100644
index 0000000..b7bd991
--- /dev/null
+++ b/libtoprammer/chips/microchip8/microchip8_splittedPMarea_hasResetPC.py
@@ -0,0 +1,72 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# pic8_splittedPMarea - file for newer 8bit PIC MCUs
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from libtoprammer.chips.microchip8.microchip8_splittedPMarea import *
+
+class microchip8_splittedPMarea_hasResetPC(microchip8_splittedPMarea):
+
+ CMD_RESET_ADDRESS = 0x16
+
+ userIDLocationSize = 4
+ voltageVDD = 3
+ voltageVPP = 8.5
+
+ logicalFlashProgramMemorySize = 0x8000
+ logicalFlashConfigurationMemorySize = 0x8000
+
+ def __init__(self,
+ chipPackage, chipPinVCC, chipPinsVPP, chipPinGND,
+ signature,
+ flashPageSize, flashPages,
+ eepromPageSize, eepromPages,
+ fuseBytes
+ ):
+ microchip8_splittedPMarea.__init__(self, chipPackage, chipPinVCC, chipPinsVPP, chipPinGND, signature, flashPageSize, flashPages, eepromPageSize, eepromPages, fuseBytes)
+
+ def setPC(self, address):
+ if(self.isInsideProgramMemoryArea):
+ if(address >= self.logicalFlashProgramMemorySize):
+ raise(TOPException('Cannot set PC to address inside PM {:x}'.format(address)))
+ if(address < self.PC):
+ self.resetPC()
+ self.setPC(address)
+ else:
+ if(address < self.logicalFlashProgramMemorySize):
+ raise(TOPException('Cannot set PC to address outside PM {:x}'.format(address)))
+ if(address < self.PC):
+ self.resetPC()
+ self.enterConfigArea()
+ self.setPC(address)
+ while(self.PC != address):
+ self.incrementPC(1)
+
+ def resetPC(self):
+ if hasattr(self, 'osccalAddr'):
+ if not hasattr(self, 'CMD_RESET_ADDRESS'):
+ print("reset instruction is not supported")
+ self.exitPM()
+ self.enterPM()
+ else:
+ self.sendCommand(0, 0, 0, self.CMD_RESET_ADDRESS)
+ self.PC = 0
+ self.isInsideProgramMemoryArea = True
+
diff --git a/libtoprammer/chips/microchip8/pic10f200dip8.py b/libtoprammer/chips/microchip8/pic10f200dip8.py
new file mode 100644
index 0000000..71dba66
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic10f200dip8.py
@@ -0,0 +1,71 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC10F200, PIC10F204 and PIC10f220 DIP8
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_singlePMarea import *
+
+class Chip_Pic10F200dip8(microchip8_singlePMarea):
+
+ # CONFIGURATION WORD FOR PIC10F200/202/204/206
+ # X X X X X X X MCLRE /CP WDT X X
+ logicalFlashSize = 0x200
+
+ def __init__(self):
+ microchip8_singlePMarea.__init__(self,
+ chipPackage="DIP8",
+ chipPinVCC=2,
+ chipPinsVPP=8,
+ chipPinGND=7,
+ signature="\x09\x18\x24\x35",
+ flashPageSize=0x100,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=2
+ )
+
+
+fuseDesc = (
+ BitDescription(0, "Unused"),
+ BitDescription(1, "Unused"),
+ BitDescription(2, "WDTE"),
+ BitDescription(3, "!CP"),
+ BitDescription(4, "MCLRE"),
+ BitDescription(5, "Unused"),
+ BitDescription(6, "Unused"),
+ BitDescription(7, "Unused"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "Unused"),
+ BitDescription(10, "Unused"),
+ BitDescription(11, "Unused"),
+)
+
+ChipDescription(
+ Chip_Pic10F200dip8,
+ bitfile="pic10fxxxdip8",
+ chipID="pic10f200dip8",
+ runtimeID=(0xDE01, 0x01),
+ chipVendors="Microchip",
+ description="PIC10F200, PIC10F204, PIC10F220",
+ packages=(("DIP8", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic10f202dip8.py b/libtoprammer/chips/microchip8/pic10f202dip8.py
new file mode 100644
index 0000000..c875729
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic10f202dip8.py
@@ -0,0 +1,71 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC10F202, PIC10F206 and PIC10f222 DIP8
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_singlePMarea import *
+
+class Chip_Pic10F202dip8(microchip8_singlePMarea):
+
+ # CONFIGURATION WORD FOR PIC10F200/202/204/206
+ # X X X X X X X MCLRE /CP WDT X X
+ logicalFlashSize = 0x400
+
+ def __init__(self):
+ microchip8_singlePMarea.__init__(self,
+ chipPackage="DIP8",
+ chipPinVCC=2,
+ chipPinsVPP=8,
+ chipPinGND=7,
+ signature="\x09\x18\x24\x35",
+ flashPageSize=0x200,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=2
+ )
+
+
+fuseDesc = (
+ BitDescription(0, "Unused"),
+ BitDescription(1, "Unused"),
+ BitDescription(2, "WDTE"),
+ BitDescription(3, "!CP"),
+ BitDescription(4, "MCLRE"),
+ BitDescription(5, "Unused"),
+ BitDescription(6, "Unused"),
+ BitDescription(7, "Unused"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "Unused"),
+ BitDescription(10, "Unused"),
+ BitDescription(11, "Unused"),
+)
+
+ChipDescription(
+ Chip_Pic10F202dip8,
+ bitfile="pic10fxxxdip8",
+ chipID="pic10f202dip8",
+ runtimeID=(0xDE01, 0x01),
+ chipVendors="Microchip",
+ description="PIC10F202, PIC10F206, PIC10F222",
+ packages=(("DIP8", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic10f320dip8.py b/libtoprammer/chips/microchip8/pic10f320dip8.py
new file mode 100644
index 0000000..69c73dc
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic10f320dip8.py
@@ -0,0 +1,71 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC10F320 DIP8
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic10F320dip8(microchip8_splittedPMarea_hasResetPC):
+
+ logicalFlashProgramMemorySize = 0x2000
+ logicalFlashConfigurationMemorySize = 0x2000
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP8",
+ chipPinVCC=2,
+ chipPinsVPP=8,
+ chipPinGND=7,
+ signature="\xA1\x29",
+ flashPageSize=0x100,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=2
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC, 1=CLKIN, 0=internal"),
+ BitDescription(1, "BOREN[0]"),
+ BitDescription(2, "BOREN[1]"),
+ BitDescription(3, "WDTE[0]"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=RA3 is nMCLR, weak pull-up enabled"),
+ BitDescription(7, "nCP"),
+ BitDescription(8, "LVP"),
+ BitDescription(9, "LPBOREN"),
+ BitDescription(10, "BORV"),
+ BitDescription(11, "WRT[0]"),
+ BitDescription(12, "WRT[1] 11=write protection off"),
+ BitDescription(13, "Unused"),
+)
+
+ChipDescription(
+ Chip_Pic10F320dip8,
+ bitfile="pic10fxxxdip8",
+ chipID="pic10f320dip8",
+ runtimeID=(0xDE01, 0x01),
+ chipVendors="Microchip",
+ description="PIC10F320, PIC10LF320",
+ packages=(("DIP8", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic10f322dip8.py b/libtoprammer/chips/microchip8/pic10f322dip8.py
new file mode 100644
index 0000000..9ad7d96
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic10f322dip8.py
@@ -0,0 +1,71 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC10F322 DIP8
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic10F322dip8(microchip8_splittedPMarea_hasResetPC):
+
+ logicalFlashProgramMemorySize = 0x2000
+ logicalFlashConfigurationMemorySize = 0x2000
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP8",
+ chipPinVCC=2,
+ chipPinsVPP=8,
+ chipPinGND=7,
+ signature="\x82\x29",
+ flashPageSize=0x200,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=2
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC, 1=CLKIN, 0=internal"),
+ BitDescription(1, "BOREN[0]"),
+ BitDescription(2, "BOREN[1]"),
+ BitDescription(3, "WDTE[0]"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=RA3 is nMCLR, weak pull-up enabled"),
+ BitDescription(7, "nCP"),
+ BitDescription(8, "LVP"),
+ BitDescription(9, "LPBOREN"),
+ BitDescription(10, "BORV"),
+ BitDescription(11, "WRT[0]"),
+ BitDescription(12, "WRT[1] 11=write protection off"),
+ BitDescription(13, "Unused"),
+)
+
+ChipDescription(
+ Chip_Pic10F322dip8,
+ bitfile="pic10fxxxdip8",
+ chipID="pic10f322dip8",
+ runtimeID=(0xDE01, 0x01),
+ chipVendors="Microchip",
+ description="PIC10F322, PIC10LF322",
+ packages=(("DIP8", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic12f1822dip8.py b/libtoprammer/chips/microchip8/pic12f1822dip8.py
new file mode 100644
index 0000000..a5667bb
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic12f1822dip8.py
@@ -0,0 +1,91 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC12F1822 DIP8
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic12F1822dip8(microchip8_splittedPMarea_hasResetPC):
+
+ rowSize = 16
+ nLatches = 16
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP8",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=8,
+ signature="\x08\x27",
+ flashPageSize=0x800,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+)
+
+ChipDescription(
+ Chip_Pic12F1822dip8,
+ bitfile="microchip01dip8",
+ chipID="pic12f1822dip8",
+ runtimeID=(0xDE02, 0x01),
+ chipVendors="Microchip",
+ description="PIC12F1822, PIC12LF1822",
+ packages=(("DIP8", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic12f508dip8.py b/libtoprammer/chips/microchip8/pic12f508dip8.py
new file mode 100644
index 0000000..2779b58
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic12f508dip8.py
@@ -0,0 +1,67 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC12F508 DIP8
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_singlePMarea import *
+
+class Chip_Pic12F508dip8(microchip8_singlePMarea):
+
+ logicalFlashSize = 0x400
+
+ def __init__(self):
+ microchip8_singlePMarea.__init__(self,
+ chipPackage="DIP8",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=8,
+ signature="",
+ flashPageSize=0x200,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=2
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0] 00=LP, 01=XT, 10=INTOSC, 11=EXTRC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "WDTE"),
+ BitDescription(3, "!CP"),
+ BitDescription(4, "MCLRE"),
+ BitDescription(5, "Unused"),
+ BitDescription(6, "Unused"),
+ BitDescription(7, "Unused"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "Unused"),
+ BitDescription(10, "Unused"),
+ BitDescription(11, "Unused"),
+)
+ChipDescription(
+ Chip_Pic12F508dip8,
+ bitfile="microchip01dip8",
+ chipID="pic12f508dip8",
+ runtimeID=(0xDE02, 0x01),
+ chipVendors="Microchip",
+ description="PIC12F508",
+ fuseDesc=fuseDesc,
+ packages=(("DIP8", ""),),
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic12f629dip8.py b/libtoprammer/chips/microchip8/pic12f629dip8.py
new file mode 100644
index 0000000..efbb6c3
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic12f629dip8.py
@@ -0,0 +1,81 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC12F629 DIP8
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea import *
+
+class Chip_Pic12F629dip8(microchip8_splittedPMarea):
+ voltageVDD = 5
+ voltageVPP = 9
+
+ userIDLocationSize = 4
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ CMD_BEGIN_INTERNALLY_TIMED_PROGRAMMING = 0x08
+ delayTinternalProgPM = 0.002
+ delayTinternalProgDM = 0.005
+
+ def __init__(self):
+ microchip8_splittedPMarea.__init__(self,
+ chipPackage="DIP8",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=8,
+ signature="\xCB\x0F",
+ flashPageSize=0x400, # 1024 words
+ flashPages=1,
+ eepromPageSize=128,
+ eepromPages=1,
+ fuseBytes=2
+ )
+ self.configWordAddr = 0x2007
+ self.osccalAddr = self.flashPageSize - 1
+ # self.configWordByteAddressRange = self.configWordByteAddressRange.append((2*0xFFF, 2*0xFFF+1))
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE, 0=WDT disabled, 1=WDT enabled"),
+ BitDescription(4, "nPWRTE"),
+ BitDescription(5, "MCLRE"),
+ BitDescription(6, "BODEN, 0=BOD disabled"),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "Unused"),
+ BitDescription(10, "Unused"),
+ BitDescription(11, "Unused"),
+ BitDescription(12, "BG[0], Band Gap Calibration bits, 00 = Lowest band gap voltage"),
+ BitDescription(13, "BG[1]"),
+)
+
+ChipDescription(
+ Chip_Pic12F629dip8,
+ bitfile="microchip01dip8",
+ chipID="pic12F629dip8",
+ runtimeID=(0xDE02, 0x01),
+ chipVendors="Microchip",
+ description="PIC12F629, PIC12F675",
+ packages=(("DIP8", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1823dip14.py b/libtoprammer/chips/microchip8/pic16f1823dip14.py
new file mode 100644
index 0000000..c33f4f0
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1823dip14.py
@@ -0,0 +1,91 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1823 DIP14
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1823dip14(microchip8_splittedPMarea_hasResetPC):
+
+ rowSize = 32
+ nLatches = 32
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP14",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=14,
+ signature="\x43\x27",
+ flashPageSize=0x0800,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+)
+
+ChipDescription(
+ Chip_Pic16F1823dip14,
+ bitfile="microchip01dip14dip20",
+ chipID="pic16f1823dip14",
+ runtimeID=(0xDE03, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1823, PIC16LF1823",
+ packages=(("DIP14", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1824dip14.py b/libtoprammer/chips/microchip8/pic16f1824dip14.py
new file mode 100644
index 0000000..1eac356
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1824dip14.py
@@ -0,0 +1,90 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1824 DIP14
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1824dip14(microchip8_splittedPMarea_hasResetPC):
+
+ nLatches = 32
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP14",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=14,
+ signature="\x43\x27",
+ flashPageSize=0x1000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+)
+
+ChipDescription(
+ Chip_Pic16F1824dip14,
+ bitfile="microchip01dip14dip20",
+ chipID="pic16f1824dip14",
+ runtimeID=(0xDE03, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1824, PIC16LF1824",
+ packages=(("DIP14", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1825dip14.py b/libtoprammer/chips/microchip8/pic16f1825dip14.py
new file mode 100644
index 0000000..814161e
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1825dip14.py
@@ -0,0 +1,88 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1825 DIP14
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1825dip14(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP14",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=14,
+ signature="\x43\x27",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+)
+
+ChipDescription(
+ Chip_Pic16F1825dip14,
+ bitfile="microchip01dip14dip20",
+ chipID="pic16f1825dip14",
+ runtimeID=(0xDE03, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1825, PIC16LF1825",
+ packages=(("DIP14", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1826dip18.py b/libtoprammer/chips/microchip8/pic16f1826dip18.py
new file mode 100644
index 0000000..73a2a5b
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1826dip18.py
@@ -0,0 +1,88 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1826 DIP18
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_PIC16F1826dip18(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP18",
+ chipPinVCC=14,
+ chipPinsVPP=4,
+ chipPinGND=5,
+ signature="\x43\x27",
+ flashPageSize=0x800,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+)
+
+ChipDescription(
+ Chip_PIC16F1826dip18,
+ bitfile="microchip01dip18",
+ chipID="PIC16F1826dip18",
+ runtimeID=(0xDE04, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1826, PIC16LF1826",
+ packages=(("DIP18", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1827dip18.py b/libtoprammer/chips/microchip8/pic16f1827dip18.py
new file mode 100644
index 0000000..316fafa
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1827dip18.py
@@ -0,0 +1,88 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1827 dip18
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1827dip18(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP18",
+ chipPinVCC=14,
+ chipPinsVPP=4,
+ chipPinGND=5,
+ signature="\x43\x27",
+ flashPageSize=0x1000, # 4kWords
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+)
+
+ChipDescription(
+ Chip_Pic16F1827dip18,
+ bitfile="microchip01dip18",
+ chipID="pic16f1827dip18",
+ runtimeID=(0xDE04, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1827, PIC16LF1827",
+ packages=(("dip18", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1828dip20.py b/libtoprammer/chips/microchip8/pic16f1828dip20.py
new file mode 100644
index 0000000..ac061bb
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1828dip20.py
@@ -0,0 +1,88 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1828 DIP20
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1828dip14(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP20",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=20,
+ signature="\x43\x27",
+ flashPageSize=0x1000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+)
+
+ChipDescription(
+ Chip_Pic16F1828dip14,
+ bitfile="microchip01dip14dip20",
+ chipID="pic16f1828dip14",
+ runtimeID=(0xDE03, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1828, PIC16LF1828",
+ packages=(("DIP20", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1829dip20.py b/libtoprammer/chips/microchip8/pic16f1829dip20.py
new file mode 100644
index 0000000..7bcfd30
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1829dip20.py
@@ -0,0 +1,88 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1829 DIP14
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1829dip14(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="DIP20",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=20,
+ signature="\x43\x27",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+)
+
+ChipDescription(
+ Chip_Pic16F1829dip14,
+ bitfile="microchip01dip14dip20",
+ chipID="pic16f1829dip20",
+ runtimeID=(0xDE03, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1829, PIC16LF1829",
+ packages=(("DIP20", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1933dip28.py b/libtoprammer/chips/microchip8/pic16f1933dip28.py
new file mode 100644
index 0000000..77dc828
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1933dip28.py
@@ -0,0 +1,90 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1933 dip28
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1933dip28(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip28",
+ chipPinVCC=20,
+ chipPinsVPP=1,
+ chipPinGND=19,
+ signature="\x68\x23",
+ flashPageSize=0x1000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 000=LP, 001=XT, 010=HS, 011=EXTRC"),
+ BitDescription(1, "FOSC[1], 100=INTOSC, 101=ECL - Low power mode"),
+ BitDescription(2, "FOSC[2], 110=ECM - Medium power mode, 111=ECH - High power mode"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "VCAPEN[0] - only for PIC16F193x, 00=Vcap enabled on RA0"),
+ BitDescription(21, "VCAPEN[1], 01=Vcap enabled on RA5, 10=Vcap enabled on RA6, 11=disabled "),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV, 1=Brown-out Reset voltage set to 1.9V"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16F1933dip28,
+ bitfile="microchip01dip28",
+ chipID="pic16f1933dip28",
+ runtimeID=(0xDE07, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1933",
+ packages=(("dip28", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1934dip40.py b/libtoprammer/chips/microchip8/pic16f1934dip40.py
new file mode 100644
index 0000000..0af8d29
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1934dip40.py
@@ -0,0 +1,90 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1934 dip40
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1934dip40(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip40",
+ chipPinVCC=32,
+ chipPinsVPP=1,
+ chipPinGND=31,
+ signature="\x68\x23",
+ flashPageSize=0x1000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 000=LP, 001=XT, 010=HS, 011=EXTRC"),
+ BitDescription(1, "FOSC[1], 100=INTOSC, 101=ECL - Low power mode"),
+ BitDescription(2, "FOSC[2], 110=ECM - Medium power mode, 111=ECH - High power mode"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "VCAPEN[0] - only for PIC16F193x, 00=Vcap enabled on RA0"),
+ BitDescription(21, "VCAPEN[1], 01=Vcap enabled on RA5, 10=Vcap enabled on RA6, 11=disabled "),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV, 1=Brown-out Reset voltage set to 1.9V"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16F1934dip40,
+ bitfile="microchip01dip40",
+ chipID="pic16f1934dip40",
+ runtimeID=(0xDE08, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1934",
+ packages=(("dip40", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1936dip28.py b/libtoprammer/chips/microchip8/pic16f1936dip28.py
new file mode 100644
index 0000000..dee716b
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1936dip28.py
@@ -0,0 +1,90 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1936 dip28
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1936dip28(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip28",
+ chipPinVCC=20,
+ chipPinsVPP=1,
+ chipPinGND=19,
+ signature="\x68\x23",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 000=LP, 001=XT, 010=HS, 011=EXTRC"),
+ BitDescription(1, "FOSC[1], 100=INTOSC, 101=ECL - Low power mode"),
+ BitDescription(2, "FOSC[2], 110=ECM - Medium power mode, 111=ECH - High power mode"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "VCAPEN[0] - only for PIC16F193x, 00=Vcap enabled on RA0"),
+ BitDescription(21, "VCAPEN[1], 01=Vcap enabled on RA5, 10=Vcap enabled on RA6, 11=disabled "),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV, 1=Brown-out Reset voltage set to 1.9V"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16F1936dip28,
+ bitfile="microchip01dip28",
+ chipID="pic16f1936dip28",
+ runtimeID=(0xDE07, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1936",
+ packages=(("dip28", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1937dip40.py b/libtoprammer/chips/microchip8/pic16f1937dip40.py
new file mode 100644
index 0000000..fc86ffb
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1937dip40.py
@@ -0,0 +1,90 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1937 dip40
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1937dip40(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip40",
+ chipPinVCC=32,
+ chipPinsVPP=1,
+ chipPinGND=31,
+ signature="\x68\x23",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 000=LP, 001=XT, 010=HS, 011=EXTRC"),
+ BitDescription(1, "FOSC[1], 100=INTOSC, 101=ECL - Low power mode"),
+ BitDescription(2, "FOSC[2], 110=ECM - Medium power mode, 111=ECH - High power mode"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "VCAPEN[0] - only for PIC16F193x, 00=Vcap enabled on RA0"),
+ BitDescription(21, "VCAPEN[1], 01=Vcap enabled on RA5, 10=Vcap enabled on RA6, 11=disabled "),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV, 1=Brown-out Reset voltage set to 1.9V"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16F1937dip40,
+ bitfile="microchip01dip40",
+ chipID="pic16f1937dip40",
+ runtimeID=(0xDE08, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1937",
+ packages=(("dip40", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1938dip28.py b/libtoprammer/chips/microchip8/pic16f1938dip28.py
new file mode 100644
index 0000000..9b2af00
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1938dip28.py
@@ -0,0 +1,90 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1938 dip28
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1938dip28(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip28",
+ chipPinVCC=20,
+ chipPinsVPP=1,
+ chipPinGND=19,
+ signature="\x68\x23",
+ flashPageSize=0x4000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 000=LP, 001=XT, 010=HS, 011=EXTRC"),
+ BitDescription(1, "FOSC[1], 100=INTOSC, 101=ECL - Low power mode"),
+ BitDescription(2, "FOSC[2], 110=ECM - Medium power mode, 111=ECH - High power mode"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "VCAPEN[0] - only for PIC16F193x, 00=Vcap enabled on RA0"),
+ BitDescription(21, "VCAPEN[1], 01=Vcap enabled on RA5, 10=Vcap enabled on RA6, 11=disabled "),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV, 1=Brown-out Reset voltage set to 1.9V"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16F1938dip28,
+ bitfile="microchip01dip28",
+ chipID="pic16f1938dip28",
+ runtimeID=(0xDE07, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1938",
+ packages=(("dip28", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f1939dip40.py b/libtoprammer/chips/microchip8/pic16f1939dip40.py
new file mode 100644
index 0000000..c94bb65
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f1939dip40.py
@@ -0,0 +1,90 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F1939 dip40
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16F1939dip40(microchip8_splittedPMarea_hasResetPC):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip40",
+ chipPinVCC=32,
+ chipPinsVPP=1,
+ chipPinGND=31,
+ signature="\x68\x23",
+ flashPageSize=0x4000,
+ flashPages=1,
+ eepromPageSize=256,
+ eepromPages=1,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 000=LP, 001=XT, 010=HS, 011=EXTRC"),
+ BitDescription(1, "FOSC[1], 100=INTOSC, 101=ECL - Low power mode"),
+ BitDescription(2, "FOSC[2], 110=ECM - Medium power mode, 111=ECH - High power mode"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(13, "FCMEM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "VCAPEN[0] - only for PIC16F193x, 00=Vcap enabled on RA0"),
+ BitDescription(21, "VCAPEN[1], 01=Vcap enabled on RA5, 10=Vcap enabled on RA6, 11=disabled "),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "PLLEN, 0=4xPLL disabled"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV, 1=Brown-out Reset voltage set to 1.9V"),
+ BitDescription(27, "Unused"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16F1939dip40,
+ bitfile="microchip01dip40",
+ chipID="pic16f1939dip40",
+ runtimeID=(0xDE08, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F1939",
+ packages=(("dip40", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f59dip40.py b/libtoprammer/chips/microchip8/pic16f59dip40.py
new file mode 100644
index 0000000..a575a7b
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f59dip40.py
@@ -0,0 +1,70 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F59 SIP6
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_singlePMarea import *
+
+
+class Chip_Pic16F59dip40(microchip8_singlePMarea):
+
+ logicalFlashSize = 0x1000
+
+
+ def __init__(self):
+ microchip8_singlePMarea.__init__(self,
+ chipPackage="DIP40",
+ chipPinVCC=15,
+ chipPinsVPP=14,
+ chipPinGND=5,
+ signature="",
+ flashPageSize=0x200,
+ flashPages=4,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=2
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC0"),
+ BitDescription(1, "FOSC1 - 00=LP, 01=XT, 10=HS, 11=RC"),
+ BitDescription(2, "WDTE"),
+ BitDescription(3, "!CP"),
+ BitDescription(4, "Unused"),
+ BitDescription(5, "Unused"),
+ BitDescription(6, "Unused"),
+ BitDescription(7, "Unused"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "Unused"),
+ BitDescription(10, "Unused"),
+ BitDescription(11, "Unused"),
+)
+
+ChipDescription(
+ Chip_Pic16F59dip40,
+ bitfile="microchip01dip40",
+ chipID="pic16f59dip40",
+ runtimeID=(0xDE06, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F59",
+ packages=(("DIP40", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f630dip14.py b/libtoprammer/chips/microchip8/pic16f630dip14.py
new file mode 100644
index 0000000..32f6c73
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f630dip14.py
@@ -0,0 +1,81 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F630 DIP14
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea import *
+
+class Chip_Pic16F630dip14(microchip8_splittedPMarea):
+ voltageVDD = 5
+ voltageVPP = 9
+
+ userIDLocationSize = 4
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ CMD_BEGIN_INTERNALLY_TIMED_PROGRAMMING = 0x08
+ delayTinternalProgPM = 0.002
+ delayTinternalProgDM = 0.005
+
+ def __init__(self):
+ microchip8_splittedPMarea.__init__(self,
+ chipPackage="DIP14",
+ chipPinVCC=1,
+ chipPinsVPP=4,
+ chipPinGND=14,
+ signature="\x08\x27",
+ flashPageSize=0x400, # 1024 words
+ flashPages=1,
+ eepromPageSize=128,
+ eepromPages=1,
+ fuseBytes=2
+ )
+ self.configWordAddr = 0x2007
+ self.osccalAddr = self.flashPageSize - 1
+ # self.configWordByteAddressRange = self.configWordByteAddressRange.append((2*0xFFF, 2*0xFFF+1))
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "FOSC[2]"),
+ BitDescription(3, "WDTE, 0=WDT disabled, 1=WDT enabled"),
+ BitDescription(4, "nPWRTE"),
+ BitDescription(5, "MCLRE"),
+ BitDescription(6, "BODEN, 0=BOD disabled"),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "nCPD, 1=data memory code protection is disabled"),
+ BitDescription(9, "Unused"),
+ BitDescription(10, "Unused"),
+ BitDescription(11, "Unused"),
+ BitDescription(12, "BG[0], Band Gap Calibration bits, 00 = Lowest band gap voltage"),
+ BitDescription(13, "BG[1]"),
+)
+
+ChipDescription(
+ Chip_Pic16F630dip14,
+ bitfile="microchip01dip14dip20",
+ chipID="pic16F630dip14",
+ runtimeID=(0xDE03, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F630, PIC16F676",
+ packages=(("DIP14", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16f84adip18.py b/libtoprammer/chips/microchip8/pic16f84adip18.py
new file mode 100644
index 0000000..c89b503
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16f84adip18.py
@@ -0,0 +1,97 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16F84 DIP18
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea import *
+
+class Chip_Pic16F84adip18(microchip8_splittedPMarea):
+ CMD_BEGIN_ERASE_PROGRAMMING_CYCLE = 0x8
+ CMD_BEGIN_PROGRAMMING_ONLY_CYCLE = 0x18
+
+ voltageVDD = 5
+ voltageVPP = 13
+
+ delayTinternalProgPM = 0.004
+
+ userIDLocationSize = 4
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ def __init__(self):
+ microchip8_splittedPMarea.__init__(self,
+ chipPackage="DIP18",
+ chipPinVCC=14,
+ chipPinsVPP=4,
+ chipPinGND=5,
+ signature="\x60\x05",
+ flashPageSize=0x200,
+ flashPages=1,
+ eepromPageSize=64,
+ eepromPages=1,
+ fuseBytes=2
+ )
+
+ def sendWriteFlashInstr(self):
+ '''
+ '''
+ self.sendCommand(0, 0, 0, self.CMD_BEGIN_PROGRAMMING_ONLY_CYCLE)
+ self.top.cmdDelay(self.delayTinternalProgDM)
+
+ def sendWriteFlashInstrDM(self):
+ self.sendWriteFlashInstr()
+
+ def bulkErasePGM(self):
+ self.sendCommand(0, 0, 0, self.CMD_BULK_ERASE_PGM)
+ self.sendCommand(0, 0, 0, self.CMD_BEGIN_PROGRAMMING_ONLY_CYCLE)
+ self.top.cmdDelay(self.delayTera) # Tera
+
+ def bulkEraseDM(self):
+ self.sendCommand(0, 0, 0, self.CMD_BULK_ERASE_DM)
+ self.sendCommand(0, 0, 0, self.CMD_BEGIN_PROGRAMMING_ONLY_CYCLE)
+ self.top.cmdDelay(self.delayTera) # Tera
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 00=LP osc, 01=XT osc"),
+ BitDescription(1, "FOSC[1], 10=HS osc, 11=RC osc"),
+ BitDescription(2, "WDTEN, 1=WDT enabled"),
+ BitDescription(3, "nPWRT"),
+ BitDescription(4, "nCP"),
+ BitDescription(5, "nCP"),
+ BitDescription(6, "nCP"),
+ BitDescription(7, "nCP"),
+ BitDescription(8, "nCP"),
+ BitDescription(9, "nCP"),
+ BitDescription(10, "nCP"),
+ BitDescription(11, "nCP"),
+ BitDescription(12, "nCP"),
+ BitDescription(13, "nCP"),
+)
+
+ChipDescription(
+ Chip_Pic16F84adip18,
+ bitfile="microchip01dip18",
+ chipID="pic16f84adip18",
+ runtimeID=(0xDE04, 0x01),
+ chipVendors="Microchip",
+ description="PIC16F84A, PIC16LF84A",
+ packages=(("DIP18", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16lf1902dip28.py b/libtoprammer/chips/microchip8/pic16lf1902dip28.py
new file mode 100644
index 0000000..d20ec7d
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16lf1902dip28.py
@@ -0,0 +1,87 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16LF1902 dip28
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16LF1902dip28(microchip8_splittedPMarea_hasResetPC):
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip28",
+ chipPinVCC=20,
+ chipPinsVPP=1,
+ chipPinGND=19,
+ signature="\x22\x2c",
+ flashPageSize=0x800,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 00=INTOSC, 11=ECH - High power mode"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "Unused"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "Unused"),
+ BitDescription(13, "Unused"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "Unused"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "nULPBOR, 1= Ultra low-power BOR is disabled"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16LF1902dip28,
+ bitfile="microchip01dip28",
+ chipID="pic16lf1902dip28",
+ runtimeID=(0xDE07, 0x01),
+ chipVendors="Microchip",
+ description="PIC16LF1902",
+ packages=(("dip28", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16lf1903dip28.py b/libtoprammer/chips/microchip8/pic16lf1903dip28.py
new file mode 100644
index 0000000..b47961c
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16lf1903dip28.py
@@ -0,0 +1,87 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16LF1903 dip28
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16LF1903dip28(microchip8_splittedPMarea_hasResetPC):
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip28",
+ chipPinVCC=20,
+ chipPinsVPP=1,
+ chipPinGND=19,
+ signature="\x22\x2c",
+ flashPageSize=0x1000,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 00=INTOSC, 11=ECH - High power mode"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "Unused"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "Unused"),
+ BitDescription(13, "Unused"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "Unused"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "nULPBOR, 1= Ultra low-power BOR is disabled"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16LF1903dip28,
+ bitfile="microchip01dip28",
+ chipID="pic16lf1903dip28",
+ runtimeID=(0xDE07, 0x01),
+ chipVendors="Microchip",
+ description="PIC16LF1903",
+ packages=(("dip28", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16lf1904dip40.py b/libtoprammer/chips/microchip8/pic16lf1904dip40.py
new file mode 100644
index 0000000..88b0f1d
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16lf1904dip40.py
@@ -0,0 +1,87 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16LF1904 dip40
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16LF1904dip40(microchip8_splittedPMarea_hasResetPC):
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip40",
+ chipPinVCC=32,
+ chipPinsVPP=1,
+ chipPinGND=31,
+ signature="\x81\x2c",
+ flashPageSize=0x1000,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 00=INTOSC, 11=ECH - High power mode"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "Unused"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "Unused"),
+ BitDescription(13, "Unused"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "Unused"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "nULPBOR, 1= Ultra low-power BOR is disabled"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16LF1904dip40,
+ bitfile="microchip01dip40a",
+ chipID="pic16lf1904dip40",
+ runtimeID=(0xDE08, 0x01),
+ chipVendors="Microchip",
+ description="PIC16LF1904",
+ packages=(("dip40", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16lf1906dip28.py b/libtoprammer/chips/microchip8/pic16lf1906dip28.py
new file mode 100644
index 0000000..451acd5
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16lf1906dip28.py
@@ -0,0 +1,87 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16LF1906 dip28
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16LF1906dip28(microchip8_splittedPMarea_hasResetPC):
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip28",
+ chipPinVCC=20,
+ chipPinsVPP=1,
+ chipPinGND=19,
+ signature="\x22\x2c",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 00=INTOSC, 11=ECH - High power mode"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "Unused"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "Unused"),
+ BitDescription(13, "Unused"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "Unused"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "nULPBOR, 1= Ultra low-power BOR is disabled"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16LF1906dip28,
+ bitfile="microchip01dip28",
+ chipID="pic16lf1906dip28",
+ runtimeID=(0xDE07, 0x01),
+ chipVendors="Microchip",
+ description="PIC16LF1906",
+ packages=(("dip28", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic16lf1907dip40.py b/libtoprammer/chips/microchip8/pic16lf1907dip40.py
new file mode 100644
index 0000000..210bd07
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic16lf1907dip40.py
@@ -0,0 +1,87 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC16LF1907dip40
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_splittedPMarea_hasResetPC import *
+
+class Chip_Pic16LF1907dip40(microchip8_splittedPMarea_hasResetPC):
+
+ def __init__(self):
+ microchip8_splittedPMarea_hasResetPC.__init__(self,
+ chipPackage="dip40",
+ chipPinVCC=32,
+ chipPinsVPP=1,
+ chipPinGND=31,
+ signature="\x81\x2c",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=0,
+ eepromPages=0,
+ fuseBytes=4
+ )
+
+fuseDesc = (
+ BitDescription(0, "FOSC[0], 00=INTOSC, 11=ECH - High power mode"),
+ BitDescription(1, "FOSC[1]"),
+ BitDescription(2, "Unused"),
+ BitDescription(3, "WDTE[0], 00=WDT disabled, 11=WDT enabled"),
+ BitDescription(4, "WDTE[1]"),
+ BitDescription(5, "nPWRTE"),
+ BitDescription(6, "MCLRE, 1=nMCLR/Vpp pin is nMCLR, weak pull-up enabled, ignored if LVP=1 "),
+ BitDescription(7, "nCP 1=program memory code protection is disabled"),
+ BitDescription(8, "Unused"),
+ BitDescription(9, "BOREN[0], 00=BOR disabled"),
+ BitDescription(10, "BOREN[1]"),
+ BitDescription(11, "nCLKOUTEN, 0=CLKOUT is enabled on CLKOUT pin"),
+ BitDescription(12, "Unused"),
+ BitDescription(13, "Unused"),
+ BitDescription(14, "NA"),
+ BitDescription(15, "NA"),
+
+ BitDescription(16, "WRT[0], 11=Write protection off"),
+ BitDescription(17, "WRT[1]"),
+ BitDescription(18, "Unused"),
+ BitDescription(19, "Unused"),
+ BitDescription(20, "Unused"),
+ BitDescription(21, "Unused"),
+ BitDescription(22, "Unused"),
+ BitDescription(23, "Unused"),
+ BitDescription(24, "Unused"),
+ BitDescription(25, "STVREN, 1=Stack overflow or underflow will cause a reset"),
+ BitDescription(26, "BORV"),
+ BitDescription(27, "nULPBOR, 1= Ultra low-power BOR is disabled"),
+ BitDescription(28, "nDEBUG, 0=ICSPCLK and ICSPDAT are dedicated to the debugger"),
+ BitDescription(29, "LVP 1=Low-voltage programming enabled"),
+ BitDescription(30, "NA"),
+ BitDescription(31, "NA"),
+)
+
+ChipDescription(
+ Chip_Pic16LF1907dip40,
+ bitfile="microchip01dip40a",
+ chipID="pic16lf1907dip40",
+ runtimeID=(0xDE08, 0x01),
+ chipVendors="Microchip",
+ description="PIC16LF1907",
+ packages=(("dip40", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic18f1220dip18.py b/libtoprammer/chips/microchip8/pic18f1220dip18.py
new file mode 100644
index 0000000..dff6fe4
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic18f1220dip18.py
@@ -0,0 +1,179 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC18F1220 DIP18
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_18f1220family import *
+
+class Chip_PIC18F1220dip18(microchip8_18f1220family):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ writeBufferSize = 8
+ eraseBufferSize = 64
+
+ def __init__(self):
+ microchip8_18f1220family.__init__(self,
+ chipPackage="DIP18",
+ chipPinVCC=14,
+ chipPinsVPP=4,
+ chipPinGND=5,
+ signature="\xE7\x07",
+ flashPageSize=0x1000,
+ flashPages=1,
+ eepromPageSize=0x100,
+ eepromPages=1,
+ fuseBytes=14
+ )
+
+
+fuseDesc = (
+ BitDescription(0o00, "NA"),
+ BitDescription(0o01, "NA"),
+ BitDescription(0o02, "NA"),
+ BitDescription(0o03, "NA"),
+ BitDescription(0o04, "NA"),
+ BitDescription(0o05, "NA"),
+ BitDescription(0o06, "NA"),
+ BitDescription(0o07, "NA"),
+ BitDescription(0o10, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(0o11, "FOSC[1]"),
+ BitDescription(0o12, "FOSC[2]"),
+ BitDescription(0o13, "FOSC[3]"),
+ BitDescription(0o14, "NA"),
+ BitDescription(0o15, "NA"),
+ BitDescription(0o16, "FSCM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(0o17, "IESO, 0=Internal/External Switchover mode is disabled"),
+
+ BitDescription(0o20, "nPWRT"),
+ BitDescription(0o21, "BOR"),
+ BitDescription(0o22, "BORV[0]"),
+ BitDescription(0o23, "BORV[1]"),
+ BitDescription(0o24, "NA"),
+ BitDescription(0o25, "NA"),
+ BitDescription(0o26, "NA"),
+ BitDescription(0o27, "NA"),
+ BitDescription(0o30, "WDT, 0=WDT disabled, 1=WDT enabled"),
+ BitDescription(0o31, "WDTPS[0]"),
+ BitDescription(0o32, "WDTPS[1]"),
+ BitDescription(0o33, "WDTPS[2]"),
+ BitDescription(0o34, "WDTPS[3]"),
+ BitDescription(0o35, "NA"),
+ BitDescription(0o36, "NA"),
+ BitDescription(0o37, "NA"),
+
+ BitDescription(0o40, "NA"),
+ BitDescription(0o41, "NA"),
+ BitDescription(0o42, "NA"),
+ BitDescription(0o43, "NA"),
+ BitDescription(0o44, "NA"),
+ BitDescription(0o45, "NA"),
+ BitDescription(0o46, "NA"),
+ BitDescription(0o47, "NA"),
+ BitDescription(0o50, "NA"),
+ BitDescription(0o51, "NA"),
+ BitDescription(0o52, "NA"),
+ BitDescription(0o53, "NA"),
+ BitDescription(0o54, "NA"),
+ BitDescription(0o55, "NA"),
+ BitDescription(0o56, "NA"),
+ BitDescription(0o57, "MCLRE"),
+
+ BitDescription(0o60, "STVR"),
+ BitDescription(0o61, "NA"),
+ BitDescription(0o62, "LVP"),
+ BitDescription(0o63, "NA"),
+ BitDescription(0o64, "NA"),
+ BitDescription(0o65, "NA"),
+ BitDescription(0o66, "NA"),
+ BitDescription(0o67, "nDEBUG"),
+ BitDescription(0o70, "NA"),
+ BitDescription(0o71, "NA"),
+ BitDescription(0o72, "NA"),
+ BitDescription(0o73, "NA"),
+ BitDescription(0o74, "NA"),
+ BitDescription(0o75, "NA"),
+ BitDescription(0o76, "NA"),
+ BitDescription(0o77, "NA"),
+
+ BitDescription(0o100, "CP[0]"),
+ BitDescription(0o101, "CP[1]"),
+ BitDescription(0o102, "NA"),
+ BitDescription(0o103, "NA"),
+ BitDescription(0o104, "NA"),
+ BitDescription(0o105, "NA"),
+ BitDescription(0o106, "NA"),
+ BitDescription(0o107, "NA"),
+ BitDescription(0o110, "NA"),
+ BitDescription(0o111, "NA"),
+ BitDescription(0o112, "NA"),
+ BitDescription(0o113, "NA"),
+ BitDescription(0o114, "NA"),
+ BitDescription(0o115, "NA"),
+ BitDescription(0o116, "CPB"),
+ BitDescription(0o117, "CPD"),
+
+ BitDescription(0o120, "WRT[0]"),
+ BitDescription(0o121, "WRT[1]"),
+ BitDescription(0o122, "NA"),
+ BitDescription(0o123, "NA"),
+ BitDescription(0o124, "NA"),
+ BitDescription(0o125, "NA"),
+ BitDescription(0o126, "NA"),
+ BitDescription(0o127, "NA"),
+ BitDescription(0o130, "NA"),
+ BitDescription(0o131, "NA"),
+ BitDescription(0o132, "NA"),
+ BitDescription(0o133, "NA"),
+ BitDescription(0o134, "NA"),
+ BitDescription(0o135, "WRTC"),
+ BitDescription(0o136, "WRTB"),
+ BitDescription(0o137, "WRTD"),
+
+ BitDescription(0o140, "EBTR[0]"),
+ BitDescription(0o141, "EBTR[1]"),
+ BitDescription(0o142, "NA"),
+ BitDescription(0o143, "NA"),
+ BitDescription(0o144, "NA"),
+ BitDescription(0o145, "NA"),
+ BitDescription(0o146, "NA"),
+ BitDescription(0o147, "NA"),
+ BitDescription(0o150, "NA"),
+ BitDescription(0o151, "NA"),
+ BitDescription(0o152, "NA"),
+ BitDescription(0o153, "NA"),
+ BitDescription(0o154, "NA"),
+ BitDescription(0o155, "NA"),
+ BitDescription(0o156, "EBTRB"),
+ BitDescription(0o157, "NA"),
+)
+
+ChipDescription(
+ Chip_PIC18F1220dip18,
+ bitfile="microchip01dip18",
+ chipID="PIC18F1220dip18",
+ runtimeID=(0xDE04, 0x01),
+ chipVendors="Microchip",
+ description="PIC18F1220",
+ packages=(("DIP18", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic18f2320dip28.py b/libtoprammer/chips/microchip8/pic18f2320dip28.py
new file mode 100644
index 0000000..5314130
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic18f2320dip28.py
@@ -0,0 +1,179 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC18F2320 DIP18
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_18f1220family import *
+
+class Chip_PIC18F2320dip28(microchip8_18f1220family):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ writeBufferSize = 8
+ eraseBufferSize = 64
+
+ def __init__(self):
+ microchip8_18f1220family.__init__(self,
+ chipPackage="DIP28",
+ chipPinVCC=20,
+ chipPinsVPP=1,
+ chipPinGND=19,
+ signature="\x80\x05",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=0x100,
+ eepromPages=1,
+ fuseBytes=14
+ )
+
+
+fuseDesc = (
+ BitDescription(0o00, "NA"),
+ BitDescription(0o01, "NA"),
+ BitDescription(0o02, "NA"),
+ BitDescription(0o03, "NA"),
+ BitDescription(0o04, "NA"),
+ BitDescription(0o05, "NA"),
+ BitDescription(0o06, "NA"),
+ BitDescription(0o07, "NA"),
+ BitDescription(0o10, "FOSC[0], 0=LP, 100=INTOSC"),
+ BitDescription(0o11, "FOSC[1]"),
+ BitDescription(0o12, "FOSC[2]"),
+ BitDescription(0o13, "FOSC[3]"),
+ BitDescription(0o14, "NA"),
+ BitDescription(0o15, "NA"),
+ BitDescription(0o16, "FSCM, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(0o17, "IESO, 0=Internal/External Switchover mode is disabled"),
+
+ BitDescription(0o20, "nPWRT"),
+ BitDescription(0o21, "BOR"),
+ BitDescription(0o22, "BORV[0]"),
+ BitDescription(0o23, "BORV[1]"),
+ BitDescription(0o24, "NA"),
+ BitDescription(0o25, "NA"),
+ BitDescription(0o26, "NA"),
+ BitDescription(0o27, "NA"),
+ BitDescription(0o30, "WDT, 0=WDT disabled, 1=WDT enabled"),
+ BitDescription(0o31, "WDTPS[0]"),
+ BitDescription(0o32, "WDTPS[1]"),
+ BitDescription(0o33, "WDTPS[2]"),
+ BitDescription(0o34, "WDTPS[3]"),
+ BitDescription(0o35, "NA"),
+ BitDescription(0o36, "NA"),
+ BitDescription(0o37, "NA"),
+
+ BitDescription(0o40, "NA"),
+ BitDescription(0o41, "NA"),
+ BitDescription(0o42, "NA"),
+ BitDescription(0o43, "NA"),
+ BitDescription(0o44, "NA"),
+ BitDescription(0o45, "NA"),
+ BitDescription(0o46, "NA"),
+ BitDescription(0o47, "NA"),
+ BitDescription(0o50, "NA"),
+ BitDescription(0o51, "NA"),
+ BitDescription(0o52, "NA"),
+ BitDescription(0o53, "NA"),
+ BitDescription(0o54, "NA"),
+ BitDescription(0o55, "NA"),
+ BitDescription(0o56, "NA"),
+ BitDescription(0o57, "MCLRE"),
+
+ BitDescription(0o60, "STVR"),
+ BitDescription(0o61, "NA"),
+ BitDescription(0o62, "LVP"),
+ BitDescription(0o63, "NA"),
+ BitDescription(0o64, "NA"),
+ BitDescription(0o65, "NA"),
+ BitDescription(0o66, "NA"),
+ BitDescription(0o67, "nDEBUG"),
+ BitDescription(0o70, "NA"),
+ BitDescription(0o71, "NA"),
+ BitDescription(0o72, "NA"),
+ BitDescription(0o73, "NA"),
+ BitDescription(0o74, "NA"),
+ BitDescription(0o75, "NA"),
+ BitDescription(0o76, "NA"),
+ BitDescription(0o77, "NA"),
+
+ BitDescription(0o100, "CP[0]"),
+ BitDescription(0o101, "CP[1]"),
+ BitDescription(0o102, "CP[2]"),
+ BitDescription(0o103, "CP[3]"),
+ BitDescription(0o104, "NA"),
+ BitDescription(0o105, "NA"),
+ BitDescription(0o106, "NA"),
+ BitDescription(0o107, "NA"),
+ BitDescription(0o110, "NA"),
+ BitDescription(0o111, "NA"),
+ BitDescription(0o112, "NA"),
+ BitDescription(0o113, "NA"),
+ BitDescription(0o114, "NA"),
+ BitDescription(0o115, "NA"),
+ BitDescription(0o116, "CPB"),
+ BitDescription(0o117, "CPD"),
+
+ BitDescription(0o120, "WRT[0]"),
+ BitDescription(0o121, "WRT[1]"),
+ BitDescription(0o122, "NA"),
+ BitDescription(0o123, "NA"),
+ BitDescription(0o124, "NA"),
+ BitDescription(0o125, "NA"),
+ BitDescription(0o126, "NA"),
+ BitDescription(0o127, "NA"),
+ BitDescription(0o130, "NA"),
+ BitDescription(0o131, "NA"),
+ BitDescription(0o132, "NA"),
+ BitDescription(0o133, "NA"),
+ BitDescription(0o134, "NA"),
+ BitDescription(0o135, "WRTC"),
+ BitDescription(0o136, "WRTB"),
+ BitDescription(0o137, "WRTD"),
+
+ BitDescription(0o140, "EBTR[0]"),
+ BitDescription(0o141, "EBTR[1]"),
+ BitDescription(0o142, "NA"),
+ BitDescription(0o143, "NA"),
+ BitDescription(0o144, "NA"),
+ BitDescription(0o145, "NA"),
+ BitDescription(0o146, "NA"),
+ BitDescription(0o147, "NA"),
+ BitDescription(0o150, "NA"),
+ BitDescription(0o151, "NA"),
+ BitDescription(0o152, "NA"),
+ BitDescription(0o153, "NA"),
+ BitDescription(0o154, "NA"),
+ BitDescription(0o155, "NA"),
+ BitDescription(0o156, "EBTRB"),
+ BitDescription(0o157, "NA"),
+)
+
+ChipDescription(
+ Chip_PIC18F2320dip28,
+ bitfile="microchip01dip28",
+ chipID="PIC18F2320dip28",
+ runtimeID=(0xDE07, 0x01),
+ chipVendors="Microchip",
+ description="PIC18F2320",
+ packages=(("DIP18", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic18f2321dip28.py b/libtoprammer/chips/microchip8/pic18f2321dip28.py
new file mode 100644
index 0000000..2f66b8c
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic18f2321dip28.py
@@ -0,0 +1,179 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC18F2320 DIP18
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_18f2221family import *
+
+class Chip_PIC18F2321dip28(microchip8_18f2221family):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ writeBufferSize = 8
+ eraseBufferSize = 64
+
+ def __init__(self):
+ microchip8_18f2221family.__init__(self,
+ chipPackage="DIP28",
+ chipPinVCC=20,
+ chipPinsVPP=1,
+ chipPinGND=19,
+ signature="\x22\x21",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=0x100,
+ eepromPages=1,
+ fuseBytes=14
+ )
+
+
+fuseDesc = (
+ BitDescription(0o00, "NA"),
+ BitDescription(0o01, "NA"),
+ BitDescription(0o02, "NA"),
+ BitDescription(0o03, "NA"),
+ BitDescription(0o04, "NA"),
+ BitDescription(0o05, "NA"),
+ BitDescription(0o06, "NA"),
+ BitDescription(0o07, "NA"),
+ BitDescription(0o10, "FOSC[0], 0000=LP, 1000=internal RC oscillator, RA6=CLKO"),
+ BitDescription(0o11, "FOSC[1]"),
+ BitDescription(0o12, "FOSC[2]"),
+ BitDescription(0o13, "FOSC[3]"),
+ BitDescription(0o14, "NA"),
+ BitDescription(0o15, "NA"),
+ BitDescription(0o16, "FCMEN, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(0o17, "IESO, 0=Internal/External Switchover mode is disabled"),
+
+ BitDescription(0o20, "nPWRTEN"),
+ BitDescription(0o21, "BOREN[0]"),
+ BitDescription(0o22, "BOREN[1]"),
+ BitDescription(0o23, "BORV[0]"),
+ BitDescription(0o24, "BORV[1]"),
+ BitDescription(0o25, "NA"),
+ BitDescription(0o26, "NA"),
+ BitDescription(0o27, "NA"),
+ BitDescription(0o30, "WDTEN, 0=WDT disabled, 1=WDT enabled"),
+ BitDescription(0o31, "WDTPS[0]"),
+ BitDescription(0o32, "WDTPS[1]"),
+ BitDescription(0o33, "WDTPS[2]"),
+ BitDescription(0o34, "WDTPS[3]"),
+ BitDescription(0o35, "NA"),
+ BitDescription(0o36, "NA"),
+ BitDescription(0o37, "NA"),
+
+ BitDescription(0o40, "NA"),
+ BitDescription(0o41, "NA"),
+ BitDescription(0o42, "NA"),
+ BitDescription(0o43, "NA"),
+ BitDescription(0o44, "NA"),
+ BitDescription(0o45, "NA"),
+ BitDescription(0o46, "NA"),
+ BitDescription(0o47, "NA"),
+ BitDescription(0o50, "NA"),
+ BitDescription(0o51, "PBADEN"),
+ BitDescription(0o52, "LPT1OSC"),
+ BitDescription(0o53, "NA"),
+ BitDescription(0o54, "NA"),
+ BitDescription(0o55, "NA"),
+ BitDescription(0o56, "NA"),
+ BitDescription(0o57, "MCLRE"),
+
+ BitDescription(0o60, "STVREN"),
+ BitDescription(0o61, "NA"),
+ BitDescription(0o62, "LVP"),
+ BitDescription(0o63, "NA"),
+ BitDescription(0o64, "BBSIZ[0]"),
+ BitDescription(0o65, "BBSIZ[1]"),
+ BitDescription(0o66, "XINST"),
+ BitDescription(0o67, "nDEBUG"),
+ BitDescription(0o70, "NA"),
+ BitDescription(0o71, "NA"),
+ BitDescription(0o72, "NA"),
+ BitDescription(0o73, "NA"),
+ BitDescription(0o74, "NA"),
+ BitDescription(0o75, "NA"),
+ BitDescription(0o76, "NA"),
+ BitDescription(0o77, "NA"),
+
+ BitDescription(0o100, "CP[0]"),
+ BitDescription(0o101, "CP[1]"),
+ BitDescription(0o102, "CP[2]/NA"),
+ BitDescription(0o103, "CP[3]/NA"),
+ BitDescription(0o104, "CP[4]/NA"),
+ BitDescription(0o105, "CP[5]/NA"),
+ BitDescription(0o106, "NA"),
+ BitDescription(0o107, "NA"),
+ BitDescription(0o110, "NA"),
+ BitDescription(0o111, "NA"),
+ BitDescription(0o112, "NA"),
+ BitDescription(0o113, "NA"),
+ BitDescription(0o114, "NA"),
+ BitDescription(0o115, "NA"),
+ BitDescription(0o116, "CPB"),
+ BitDescription(0o117, "CPD"),
+
+ BitDescription(0o120, "WRT[0]"),
+ BitDescription(0o121, "WRT[1]"),
+ BitDescription(0o122, "WRT[2]/NA"),
+ BitDescription(0o123, "WRT[3]/NA"),
+ BitDescription(0o124, "WRT[4]/NA"),
+ BitDescription(0o125, "WRT[5]/NA"),
+ BitDescription(0o126, "NA"),
+ BitDescription(0o127, "NA"),
+ BitDescription(0o130, "NA"),
+ BitDescription(0o131, "NA"),
+ BitDescription(0o132, "NA"),
+ BitDescription(0o133, "NA"),
+ BitDescription(0o134, "NA"),
+ BitDescription(0o135, "WRTC"),
+ BitDescription(0o136, "WRTB"),
+ BitDescription(0o137, "WRTD"),
+
+ BitDescription(0o140, "EBTR[0]"),
+ BitDescription(0o141, "EBTR[1]"),
+ BitDescription(0o142, "EBTR[2]/NA"),
+ BitDescription(0o143, "EBTR[3]/NA"),
+ BitDescription(0o144, "EBTR[4]/NA"),
+ BitDescription(0o145, "EBTR[5]/NA"),
+ BitDescription(0o146, "NA"),
+ BitDescription(0o147, "NA"),
+ BitDescription(0o150, "NA"),
+ BitDescription(0o151, "NA"),
+ BitDescription(0o152, "NA"),
+ BitDescription(0o153, "NA"),
+ BitDescription(0o154, "NA"),
+ BitDescription(0o155, "NA"),
+ BitDescription(0o156, "EBTRB"),
+ BitDescription(0o157, "NA"),
+)
+
+ChipDescription(
+ Chip_PIC18F2321dip28,
+ bitfile="microchip01dip28",
+ chipID="PIC18F2321dip28",
+ runtimeID=(0xDE07, 0x01),
+ chipVendors="Microchip",
+ description="PIC18F2321",
+ packages=(("DIP28", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
diff --git a/libtoprammer/chips/microchip8/pic18f67j60sip6.py b/libtoprammer/chips/microchip8/pic18f67j60sip6.py
new file mode 100644
index 0000000..0c2791a
--- /dev/null
+++ b/libtoprammer/chips/microchip8/pic18f67j60sip6.py
@@ -0,0 +1,111 @@
+"""
+# TOP2049 Open Source programming suite
+#
+# Microchip PIC18F67J60 SIP6
+#
+# Copyright (c) 2013 Pavel Stemberk <stemberk@gmail.com>
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License along
+# with this program; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+"""
+
+from microchip8_18f97j60family import *
+
+class Chip_PIC18F67J60sip6(microchip8_18f97j60family):
+
+ SUPPORT_EEPROMREAD = (1 << 4)
+ SUPPORT_EEPROMWRITE = (1 << 5)
+
+ writeBufferSize = 8
+ eraseBufferSize = 64
+
+ def __init__(self):
+ microchip8_18f97j60family.__init__(self,
+ chipPackage="DIP10",
+ chipPinVCC=9,
+ chipPinsVPP=10,
+ chipPinGND=8,
+ signature="\x22\x21",
+ flashPageSize=0x2000,
+ flashPages=1,
+ eepromPageSize=0x100,
+ eepromPages=1,
+ fuseBytes=6
+ )
+
+
+fuseDesc = (
+ BitDescription(0o00, "WDTEN"),
+ BitDescription(0o01, "NA"),
+ BitDescription(0o02, "NA"),
+ BitDescription(0o03, "NA"),
+ BitDescription(0o04, "NA"),
+ BitDescription(0o05, "STVREN"),
+ BitDescription(0o06, "XINST"),
+ BitDescription(0o07, "nDEBUG"),
+ BitDescription(0o10, "NA"),
+ BitDescription(0o11, "NA"),
+ BitDescription(0o12, "CP[0]"),
+ BitDescription(0o13, "NA"),
+ BitDescription(0o14, "NA"),
+ BitDescription(0o15, "NA"),
+ BitDescription(0o16, "NA"),
+ BitDescription(0o17, "NA"),
+
+ BitDescription(0o20, "FOSC[0]"),
+ BitDescription(0o21, "FOSC[1]"),
+ BitDescription(0o22, "FOSC[2]"),
+ BitDescription(0o23, "NA"),
+ BitDescription(0o24, "NA"),
+ BitDescription(0o25, "NA"),
+ BitDescription(0o26, "FCMEN, 0=Fail-Safe Clock Monitor is disabled"),
+ BitDescription(0o27, "IESO, 0=Internal/External Switchover mode is disabled"),
+ BitDescription(0o30, "WDTPS[0]"),
+ BitDescription(0o31, "WDTPS[1]"),
+ BitDescription(0o32, "WDTPS[2]"),
+ BitDescription(0o33, "WDTPS[3]"),
+ BitDescription(0o34, "NA"),
+ BitDescription(0o35, "NA"),
+ BitDescription(0o36, "NA"),
+ BitDescription(0o37, "NA"),
+
+ BitDescription(0o40, "NA"),
+ BitDescription(0o41, "NA"),
+ BitDescription(0o42, "NA"),
+ BitDescription(0o43, "NA"),
+ BitDescription(0o44, "NA"),
+ BitDescription(0o45, "NA"),
+ BitDescription(0o46, "NA"),
+ BitDescription(0o47, "NA"),
+ BitDescription(0o50, "NA"),
+ BitDescription(0o51, "NA"),
+ BitDescription(0o52, "NA"),
+ BitDescription(0o53, "NA"),
+ BitDescription(0o54, "NA"),
+ BitDescription(0o55, "ETHLED"),
+ BitDescription(0o56, "NA"),
+ BitDescription(0o57, "NA"),
+)
+
+ChipDescription(
+ Chip_PIC18F67J60sip6,
+ bitfile="microchip01sip6",
+ chipID="PIC18F67J60sip6",
+ runtimeID=(0xDE05, 0x01),
+ chipVendors="Microchip",
+ description="PIC18F67J60",
+ packages=(("sip6", ""),),
+ fuseDesc=fuseDesc,
+ maintainer="Pavel Stemberk <stemberk@gmail.com>",
+)
bues.ch cgit interface