From 3479b3013ec567fe451e25c018a1e6609304f072 Mon Sep 17 00:00:00 2001 From: Pavel Štemberk Date: Sat, 22 Feb 2014 17:45:15 +0100 Subject: Add support for pic24f PIC24F04KA200, PIC24F04KA201 PIC24F16KL402, PIC24F08KL402, PIC24F16KL401, PIC24F08KL401, PIC24F08KL302, PIC24F08KL301, PIC24F08KL201, PIC24F08KL200, PIC24F04KL101, PIC24F04KL100 Signed-off-by: Michael Buesch --- libtoprammer/chips/__init__.py | 2 +- libtoprammer/chips/microchip16/__init__.py | 26 +- libtoprammer/chips/microchip16/configWords.py | 298 ++++++++++++++++++++ libtoprammer/chips/microchip16/makeSip6.py | 73 +++++ .../chips/microchip16/microchip16_common.py | 218 ++++++++++----- .../chips/microchip16/pic24f04ka200dip14.py | 57 ++-- .../chips/microchip16/pic24f04ka200sip6.py | 73 +++++ .../chips/microchip16/pic24f04ka201dip20.py | 68 +++++ .../chips/microchip16/pic24f04ka201sip6.py | 73 +++++ .../chips/microchip16/pic24f04kl100dip14.py | 68 +++++ .../chips/microchip16/pic24f04kl100sip6.py | 73 +++++ .../chips/microchip16/pic24f04kl101dip20.py | 68 +++++ .../chips/microchip16/pic24f04kl101sip6.py | 73 +++++ .../chips/microchip16/pic24f08kl200dip14.py | 68 +++++ .../chips/microchip16/pic24f08kl200sip6.py | 73 +++++ .../chips/microchip16/pic24f08kl201dip20.py | 68 +++++ .../chips/microchip16/pic24f08kl201sip6.py | 73 +++++ .../chips/microchip16/pic24f08kl301dip20.py | 68 +++++ .../chips/microchip16/pic24f08kl301sip6.py | 73 +++++ .../chips/microchip16/pic24f08kl302dip28.py | 68 +++++ .../chips/microchip16/pic24f08kl302sip6.py | 73 +++++ .../chips/microchip16/pic24f08kl401dip20.py | 66 +++++ .../chips/microchip16/pic24f08kl401sip6.py | 71 +++++ .../chips/microchip16/pic24f08kl402dip28.py | 66 +++++ .../chips/microchip16/pic24f08kl402sip6.py | 71 +++++ .../chips/microchip16/pic24f16kl401dip20.py | 66 +++++ .../chips/microchip16/pic24f16kl401sip6.py | 71 +++++ .../chips/microchip16/pic24f16kl402dip28.py | 66 +++++ .../chips/microchip16/pic24f16kl402sip6.py | 71 +++++ .../chips/microchip8/microchip8_splittedPMarea.py | 2 +- libtoprammer/fpga/bin/microchip16dip14dip20.bit | Bin 24798 -> 24798 bytes libtoprammer/fpga/src/microchip16/microchip16.vh | 300 +++++++++++---------- .../microchip16dip14dip20/microchip16dip14dip20.v | 20 +- .../fpga/src/microchip16/microchip16dip28/Makefile | 3 + .../microchip16dip28/microchip16dip28.v | 90 +++++++ .../fpga/src/microchip16/microchip16sip6/Makefile | 3 + .../microchip16/microchip16sip6/microchip16sip6.v | 51 ++++ 37 files changed, 2505 insertions(+), 246 deletions(-) create mode 100644 libtoprammer/chips/microchip16/configWords.py create mode 100644 libtoprammer/chips/microchip16/makeSip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f04ka200sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f04ka201dip20.py create mode 100644 libtoprammer/chips/microchip16/pic24f04ka201sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f04kl100dip14.py create mode 100644 libtoprammer/chips/microchip16/pic24f04kl100sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f04kl101dip20.py create mode 100644 libtoprammer/chips/microchip16/pic24f04kl101sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl200dip14.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl200sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl201dip20.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl201sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl301dip20.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl301sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl302dip28.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl302sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl401dip20.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl401sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl402dip28.py create mode 100644 libtoprammer/chips/microchip16/pic24f08kl402sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f16kl401dip20.py create mode 100644 libtoprammer/chips/microchip16/pic24f16kl401sip6.py create mode 100644 libtoprammer/chips/microchip16/pic24f16kl402dip28.py create mode 100644 libtoprammer/chips/microchip16/pic24f16kl402sip6.py create mode 100644 libtoprammer/fpga/src/microchip16/microchip16dip28/Makefile create mode 100644 libtoprammer/fpga/src/microchip16/microchip16dip28/microchip16dip28.v create mode 100644 libtoprammer/fpga/src/microchip16/microchip16sip6/Makefile create mode 100644 libtoprammer/fpga/src/microchip16/microchip16sip6/microchip16sip6.v (limited to 'libtoprammer') diff --git a/libtoprammer/chips/__init__.py b/libtoprammer/chips/__init__.py index e91bc74..396441b 100644 --- a/libtoprammer/chips/__init__.py +++ b/libtoprammer/chips/__init__.py @@ -16,4 +16,4 @@ from m8cissp import * from unitest import * from w29ee011dip32 import * from microchip8 import * -#from microchip16 import * +from microchip16 import * diff --git a/libtoprammer/chips/microchip16/__init__.py b/libtoprammer/chips/microchip16/__init__.py index ac58a62..d6e9c6f 100644 --- a/libtoprammer/chips/microchip16/__init__.py +++ b/libtoprammer/chips/microchip16/__init__.py @@ -1 +1,25 @@ -from pic24f04ka200dip14 import * \ No newline at end of file +from pic24f04ka200dip14 import * +from pic24f04ka201dip20 import * +from pic24f16kl402dip28 import * +from pic24f08kl402dip28 import * +from pic24f16kl401dip20 import * +from pic24f08kl401dip20 import * +from pic24f08kl302dip28 import * +from pic24f08kl301dip20 import * +from pic24f08kl201dip20 import * +from pic24f08kl200dip14 import * +from pic24f04kl101dip20 import * +from pic24f04kl100dip14 import * +# +from pic24f04ka200sip6 import * +from pic24f04ka201sip6 import * +from pic24f04kl100sip6 import * +from pic24f04kl101sip6 import * +from pic24f08kl200sip6 import * +from pic24f08kl201sip6 import * +from pic24f08kl301sip6 import * +from pic24f08kl302sip6 import * +from pic24f08kl401sip6 import * +from pic24f08kl402sip6 import * +from pic24f16kl401sip6 import * +from pic24f16kl402sip6 import * diff --git a/libtoprammer/chips/microchip16/configWords.py b/libtoprammer/chips/microchip16/configWords.py new file mode 100644 index 0000000..99a5640 --- /dev/null +++ b/libtoprammer/chips/microchip16/configWords.py @@ -0,0 +1,298 @@ +""" +# TOP2049 Open Source programming suite +# +# configWordsSet - configWord specification for 16bit PIC MCUs +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 BitDescription + +ka200_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, "NA"), + BitDescription(0o11, "NA"), + BitDescription(0o12, "NA"), + BitDescription(0o13, "NA"), + BitDescription(0o14, "NA"), + BitDescription(0o15, "NA"), + BitDescription(0o16, "NA"), + BitDescription(0o17, "NA"), + + BitDescription(0o20, "NA"), + BitDescription(0o21, "NA"), + BitDescription(0o22, "NA"), + BitDescription(0o23, "NA"), + BitDescription(0o24, "NA"), + BitDescription(0o25, "NA"), + BitDescription(0o26, "NA"), + BitDescription(0o27, "NA"), + BitDescription(0o30, "NA"), + BitDescription(0o31, "NA"), + BitDescription(0o32, "NA"), + BitDescription(0o33, "NA"), + BitDescription(0o34, "NA"), + BitDescription(0o35, "NA"), + BitDescription(0o36, "NA"), + BitDescription(0o37, "NA"), + + BitDescription(0o40, "FGS:GWRP: General Segment Code Flash Write Protection bit, 1 = General segment may be written"), + BitDescription(0o41, "FGS:GSS0 General Segment Code Flash Code Protection bit, 1 = no protection"), + 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, "NA"), + + BitDescription(0o60, "FOSCSEL: FNOSC[0] 101 = 500 kHz Low-Power FRC oscillato"), + BitDescription(0o61, "FOSCSEL: FNOSC[1] 110 = 500 kHz Low-Power FRC oscillator with divide-by-N (LPFRCDIV)"), + BitDescription(0o62, "FOSCSEL: FNOSC[2] 111 = 8 MHz FRC oscillator with divide-by-N (FRCDIV)"), + BitDescription(0o63, "NA"), + BitDescription(0o64, "NA"), + BitDescription(0o65, "NA"), + BitDescription(0o66, "NA"), + BitDescription(0o67, "FOSCSEL: IESO: Internal External Switchover bit, 1 = enabled"), + 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, "FOSC: POSCMD[0] 11 = Primary oscillator disabled = HS Oscillator mode selected"), + BitDescription(0o101, "FOSC: POSCMD[1]"), + BitDescription(0o102, "FOSC: OSCIOFNC 1 = CLKO output signal active on the OSCO pin"), + BitDescription(0o103, "FOSC: POSCFREQ[0] 00 = Reserved; do not use"), + BitDescription(0o104, "FOSC: POSCFREQ[1] 11 = Primary oscillator/external clock input frequency greater than 8 MHz"), + BitDescription(0o105, "FOSC: SOSCSEL 1 = Secondary oscillator configured for high-power operation"), + BitDescription(0o106, "FOSC: FCKSM[0] 00 = Clock switching is enabled, Fail-Safe Clock Monitor is enabled"), + BitDescription(0o107, "FOSC: FCKSM[1] 1x = Clock switching is disabled, Fail-Safe Clock Monitor is disabled"), + BitDescription(0o110, "NA"), + BitDescription(0o111, "NA"), + BitDescription(0o112, "NA"), + BitDescription(0o113, "NA"), + BitDescription(0o114, "NA"), + BitDescription(0o115, "NA"), + BitDescription(0o116, "NA"), + BitDescription(0o117, "NA"), + + BitDescription(0o120, "FWDT: WDTPS[0] 0000 = 1:1"), + BitDescription(0o121, "FWDT: WDTPS[1] 0001 = 1:2"), + BitDescription(0o122, "FWDT: WDTPS[2] 0010 = 1:4"), + BitDescription(0o123, "FWDT: WDTPS[3] 1111 = 1:32768"), + BitDescription(0o124, "FWDT: FWPSA 1 = WDT prescaler ratio of 1:128"), + BitDescription(0o125, "NA"), + BitDescription(0o126, "FWDT: WINDIS: 1 = Standard WDT selected; windowed WDT disabled"), + BitDescription(0o127, "FWDT: FWDTEN: 1 = WDT enabled"), + BitDescription(0o130, "NA"), + BitDescription(0o131, "NA"), + BitDescription(0o132, "NA"), + BitDescription(0o133, "NA"), + BitDescription(0o134, "NA"), + BitDescription(0o135, "NA"), + BitDescription(0o136, "NA"), + BitDescription(0o137, "NA"), + + BitDescription(0o140, "FPOR: BOREN[0] 00 = Brown-out Reset disabled in hardware; SBOREN bit disabled"), + BitDescription(0o141, "FPOR: BOREN[1] 11 = Brown-out Reset enabled in hardware; SBOREN bit disabled"), + BitDescription(0o142, "NA"), + BitDescription(0o143, "FPOR: PWRTEN: 1 = Power-up Timer Enable bit enabled"), + BitDescription(0o144, "NA"), + BitDescription(0o145, "FPOR: BORV[0] 00 = Low-power Brown-out Reset occurs around 2.0V"), + BitDescription(0o146, "FPOR: BORV[1] 11 = Brown-out Reset set to lowest voltage"), + BitDescription(0o147, "FPOR: MCLRE: 1 = MCLR pin enabled; RA5 input pin disabled"), + BitDescription(0o150, "NA"), + BitDescription(0o151, "NA"), + BitDescription(0o152, "NA"), + BitDescription(0o153, "NA"), + BitDescription(0o154, "NA"), + BitDescription(0o155, "NA"), + BitDescription(0o156, "NA"), + BitDescription(0o157, "NA"), + + BitDescription(0o160, "FICD[0] 10 = PGC2/PGD2 are used for programming the device"), + BitDescription(0o161, "FICD[1] 00, 11 = Reserved; do not use"), + BitDescription(0o162, "NA"), + BitDescription(0o163, "NA"), + BitDescription(0o164, "NA"), + BitDescription(0o165, "NA"), + BitDescription(0o166, "NA"), + BitDescription(0o167, "NA"), + BitDescription(0o170, "NA"), + BitDescription(0o171, "NA"), + BitDescription(0o172, "NA"), + BitDescription(0o173, "NA"), + BitDescription(0o174, "NA"), + BitDescription(0o175, "NA"), + BitDescription(0o176, "NA"), + BitDescription(0o137, "NA"), +) +klx0x_fuseDesc = ( + BitDescription(0o00, "FBS:BWRP 1 = Boot Segment may be written"), + BitDescription(0o01, "FBS:BSS[0] 001 = High-security Boot Segment starts at 0200h, ends at 15FEh"), + BitDescription(0o02, "FBS:BSS[1] 101 = Standard security Boot Segment starts at 0200h, ends at 15FEh"), + BitDescription(0o03, "FBS:BSS[2] 111 = No Boot Segment; all program memory space is General Segment"), + BitDescription(0o04, "NA"), + BitDescription(0o05, "NA"), + BitDescription(0o06, "NA"), + BitDescription(0o07, "NA"), + BitDescription(0o10, "NA"), + BitDescription(0o11, "NA"), + BitDescription(0o12, "NA"), + BitDescription(0o13, "NA"), + BitDescription(0o14, "NA"), + BitDescription(0o15, "NA"), + BitDescription(0o16, "NA"), + BitDescription(0o17, "NA"), + + BitDescription(0o20, "NA"), + BitDescription(0o21, "NA"), + BitDescription(0o22, "NA"), + BitDescription(0o23, "NA"), + BitDescription(0o24, "NA"), + BitDescription(0o25, "NA"), + BitDescription(0o26, "NA"), + BitDescription(0o27, "NA"), + BitDescription(0o30, "NA"), + BitDescription(0o31, "NA"), + BitDescription(0o32, "NA"), + BitDescription(0o33, "NA"), + BitDescription(0o34, "NA"), + BitDescription(0o35, "NA"), + BitDescription(0o36, "NA"), + BitDescription(0o37, "NA"), + + BitDescription(0o40, "FGS:GWRP: General Segment Code Flash Write Protection bit, 1 = General segment may be written"), + BitDescription(0o41, "FGS:GSS0 General Segment Code Flash Code Protection bit, 1 = no protection"), + 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, "NA"), + + BitDescription(0o60, "FOSCSEL: FNOSC[0] 101 = 000 = 8 MHz FRC Oscillator (FRC)"), + BitDescription(0o61, "FOSCSEL: FNOSC[1] 110 = 500 kHz Low-Power FRC oscillator with divide-by-N (LPFRCDIV)"), + BitDescription(0o62, "FOSCSEL: FNOSC[2] 111 = 8 MHz FRC oscillator with divide-by-N (FRCDIV)"), + BitDescription(0o63, "NA"), + BitDescription(0o64, "NA"), + BitDescription(0o65, "FOSCSEL: SOSCSRC 1 = SOSC analog crystal function is available on the SOSCI/SOSCO pins"), + BitDescription(0o66, "FOSCSEL: LPRCSEL 1 = High-Power/High-Accuracy mode"), + BitDescription(0o67, "FOSCSEL: IESO: Internal External Switchover bit, 1 = enabled"), + 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, "FOSC: POSCMD[0] 11 = Primary oscillator disabled = HS Oscillator mode selected"), + BitDescription(0o101, "FOSC: POSCMD[1]"), + BitDescription(0o102, "FOSC: OSCIOFNC 1 = CLKO output signal active on the OSCO pin"), + BitDescription(0o103, "FOSC: POSCFREQ[0] 00 = Reserved; do not use"), + BitDescription(0o104, "FOSC: POSCFREQ[1] 11 = Primary oscillator/external clock input frequency greater than 8 MHz"), + BitDescription(0o105, "FOSC: SOSCSEL 1 = Secondary oscillator configured for high-power operation"), + BitDescription(0o106, "FOSC: FCKSM[0] 00 = Clock switching is enabled, Fail-Safe Clock Monitor is enabled"), + BitDescription(0o107, "FOSC: FCKSM[1] 1x = Clock switching is disabled, Fail-Safe Clock Monitor is disabled"), + BitDescription(0o110, "NA"), + BitDescription(0o111, "NA"), + BitDescription(0o112, "NA"), + BitDescription(0o113, "NA"), + BitDescription(0o114, "NA"), + BitDescription(0o115, "NA"), + BitDescription(0o116, "NA"), + BitDescription(0o117, "NA"), + + BitDescription(0o120, "FWDT: WDTPS[0] 0000 = 1:1"), + BitDescription(0o121, "FWDT: WDTPS[1] 0001 = 1:2"), + BitDescription(0o122, "FWDT: WDTPS[2] 0010 = 1:4"), + BitDescription(0o123, "FWDT: WDTPS[3] 1111 = 1:32768"), + BitDescription(0o124, "FWDT: FWPSA 1 = WDT prescaler ratio of 1:128"), + BitDescription(0o125, "FWDT: FWDTEN[0]: 00 = WDT is disabled in hardware; SWDTEN bit is disabled"), + BitDescription(0o126, "FWDT: WINDIS: 1 = Standard WDT selected; windowed WDT disabled"), + BitDescription(0o127, "FWDT: FWDTEN[1]: 11 = WDT is enabled in hardware"), + BitDescription(0o130, "NA"), + BitDescription(0o131, "NA"), + BitDescription(0o132, "NA"), + BitDescription(0o133, "NA"), + BitDescription(0o134, "NA"), + BitDescription(0o135, "NA"), + BitDescription(0o136, "NA"), + BitDescription(0o137, "NA"), + + BitDescription(0o140, "FPOR: BOREN[0] 00 = Brown-out Reset disabled in hardware; SBOREN bit disabled"), + BitDescription(0o141, "FPOR: BOREN[1] 11 = Brown-out Reset enabled in hardware; SBOREN bit disabled"), + BitDescription(0o142, "NA"), + BitDescription(0o143, "FPOR: PWRTEN: 1 = Power-up Timer Enable bit enabled"), + BitDescription(0o144, "FPOR: I2C1SEL: Alternate MSSP1 I2CTM Pin Mapping bit 1 = default loc."), + BitDescription(0o145, "FPOR: BORV[0] 00 = Low-power Brown-out Reset occurs around 2.0V"), + BitDescription(0o146, "FPOR: BORV[1] 11 = Brown-out Reset set to lowest voltage"), + BitDescription(0o147, "FPOR: MCLRE: 1 = MCLR pin enabled; RA5 input pin disabled"), + BitDescription(0o150, "NA"), + BitDescription(0o151, "NA"), + BitDescription(0o152, "NA"), + BitDescription(0o153, "NA"), + BitDescription(0o154, "NA"), + BitDescription(0o155, "NA"), + BitDescription(0o156, "NA"), + BitDescription(0o157, "NA"), + + BitDescription(0o160, "FICD: ICS[0] 11 = PGEC1/PGED1 are used for programming and debugging the device"), + BitDescription(0o161, "FICD: ICS[1] 00, 11 = Reserved; do not use"), + BitDescription(0o162, "NA"), + BitDescription(0o163, "NA"), + BitDescription(0o164, "NA"), + BitDescription(0o165, "NA"), + BitDescription(0o166, "NA"), + BitDescription(0o167, "FICD: DEBUG 1 = Background debugger is disabled"), + BitDescription(0o170, "NA"), + BitDescription(0o171, "NA"), + BitDescription(0o172, "NA"), + BitDescription(0o173, "NA"), + BitDescription(0o174, "NA"), + BitDescription(0o175, "NA"), + BitDescription(0o176, "NA"), + BitDescription(0o137, "NA"), +) diff --git a/libtoprammer/chips/microchip16/makeSip6.py b/libtoprammer/chips/microchip16/makeSip6.py new file mode 100644 index 0000000..bedca51 --- /dev/null +++ b/libtoprammer/chips/microchip16/makeSip6.py @@ -0,0 +1,73 @@ +#!/usr/bin/env python + +""" +# TOP2049 Open Source programming suite +# +# Commandline utility +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 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:'{} = (0xDF05, 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:'{} = "microchip16sip6",'.format(m.group(1)), input) + input = re.sub("{}".format(oldSocket), "{}".format(newSocket), input) + input = re.sub("{}".format(oldSocket.upper()), "{}".format(newSocket.upper()), input) + return input + +def makeSip(): + inputFileName = '__init__.py' + fin = open(inputFileName) + dMCU = {} + for line in fin: + matchObj = re.match('.*(pic[0-9]+l?f\w+)(sip[0-9a]+).*', line) + if matchObj: + continue + matchObj = re.match('.*(pic[0-9]+l?f\w+)(dip[0-9a]+).*', line) + if not matchObj: + print("{} did not match".format(line)) + continue +# print('matched {} - {}'.format(matchObj.group(1), matchObj.group(2))) + dMCU.setdefault(matchObj.group(1), matchObj.group(2)) + fin.close() + for item in dMCU.items(): + fin = open("{}{}.py".format(item[0], item[1])) + fout = open("{}sip6.py".format(item[0]), 'w') + fout.write("#\n") + fout.write("# THIS FILE WAS AUTOGENERATED BY makeSip6.py\n") + fout.write("# Do not edit this file manually. All changes will be lost.\n") + fout.write("#\n\n") + for line in fin: + fout.write(substitute(line, "{}".format(item[1]), "sip6")) + fout.close() + fin.close() + +def main(argv): + makeSip() + +if __name__ == "__main__": + exit(main(sys.argv)) diff --git a/libtoprammer/chips/microchip16/microchip16_common.py b/libtoprammer/chips/microchip16/microchip16_common.py index 46dabd8..1e3ab26 100644 --- a/libtoprammer/chips/microchip16/microchip16_common.py +++ b/libtoprammer/chips/microchip16/microchip16_common.py @@ -29,7 +29,8 @@ class Chip_Microchip16_common(Chip): PROGCMD_SENDSIXINSTR = 0 PROGCMD_SENDREGOUTINSTR = 1 - PROGCMD_ENTERPM = 2 + PROGCMD_ENTERPM = 2 + PROGCMD_SEND9SIXINSTR = 3 codeExitResetVector = (0x000000, 0x040200, 0x000000) codeExitResetVectorSimple = (0x040200, 0x000000) @@ -38,12 +39,15 @@ class Chip_Microchip16_common(Chip): # EEPROM access: default on, if does not exist override it hasEEPROM = True - + eepromStartAddress = 0x7FFE00 + # default delays - can be overridden delayTdis = 0.0001 delayTprog = 0.001 - delayTdly = 0.000005 + delayCommandDataREGOUT = 0.0000005 delayTera = 0.01 + # delayP3 = 0.000000015 # Input Data Hold Time from PGECx rise + delayP3 = 0.00000006 # this is hard-tuned value ! delayP4 = 0.000000040 # Delay between 4-Bit Command Operand and Command Operand delayP4A = 0.000000040 # Delay between 4-Bit Command Operand and the Next 4-bit command delayP5 = 0.000000020 # Delay between Last PGCx fall of Command Byte and First PGC rise by Programming Executive @@ -57,8 +61,27 @@ class Chip_Microchip16_common(Chip): delayP19 = 0.001 # delay between last PGC fall for key sequence on PGDx and second nMCLR rise deviceIDAddr = 0xFF0000 - deviceIDLength = 2 - + deviceIDLength = 1 + + deviceIdMapDict = { + 0x0d00:"24f04ka201", 0x0d02:"24f04ka200", 0x4b14:"24f16kl402", 0x4b1e:"24f16kl401", 0x4b04:"24f08kl402", 0x4b0e:"24f08kl401", + 0x4b00:"24f08kl302", 0x4b0a:"24f08kl301", 0x4b06:"24f08kl201", 0x4b05:"24f08kl200", 0x4b02:"24f04kl101", 0x4b01:"24f04kl100" + } + def getIHexInterpreter(self): + inter = IHexInterpreter() + inter.progmemRanges = [ AddressRange(0, 2 * self.flashPageSize) ] + inter.fuseRanges = [ AddressRange(2 * self.configWordAddr, + 2 * self.configWordAddr + 1) ] + return inter + + @classmethod + def getSupportFlags(cls): + flags = super(Chip_Microchip16_common, cls).getSupportFlags() + if not cls.hasEEPROM: + flags &= ~(Chip.SUPPORT_EEPROMREAD | \ + Chip.SUPPORT_EEPROMWRITE) + return flags + def __init__(self, chipPackage, chipPinVCC, chipPinsVPP, chipPinGND, signature, @@ -95,15 +118,19 @@ class Chip_Microchip16_common(Chip): self.applyVCC(True) self.top.hostDelay(self.delayP6) self.applyVPP(True) + self.setTopProgrammerDelays(); if lowVoltageIcspEntry: self.top.hostDelay(self.delayP6) self.applyVPP(False) self.top.hostDelay(self.delayP18) - # self.sendCommand(self.PROGCMD_ENTERPM) + self.sendCommand(self.PROGCMD_ENTERPM) if lowVoltageIcspEntry: self.top.hostDelay(self.delayP19) self.applyVPP(True) self.top.hostDelay(self.delayP7) + self.sendSIX(0x0, True) + self.executeCode(self.codeExitResetVectorSimple) + # self.testPORTA() self.isInPmMode = True def checkSignature(self): @@ -150,23 +177,35 @@ class Chip_Microchip16_common(Chip): self.progressMeterInit("Erasing chip", 0) self.enterPM() er(0x4064) - if(not keepEEPROM): + if(not keepEEPROM and self.eepromPageSize != 0): er(0x4050) self.progressMeterFinish() + self.exitPM() def readProgmem(self): + def unpackImage(): + out = "" + for halfPackAddr in range(0, len(self.Image), 6): + out += self.Image[halfPackAddr:halfPackAddr + 3] + "\0" + out += self.Image[halfPackAddr + 4:halfPackAddr + 6] + self.Image[halfPackAddr + 3] + "\0" + return out + nrWords = self.flashPages * self.flashPageSize + # return self.readSequentialBlock(0x0 , nrWords/2, "Reading Progmem") + # something wrong for packed PM reading below self.enterPM() self.progressMeterInit("Reading flash", nrWords / 2) self.BufferedBytes = 0 self.Image = "" self.executeCode(self.codeExitResetVector) self.executeCode(self.getCodeInitializeTBLPAG(0, 6)) - self.executeCode((0x207847, 0x0)) + self.executeCode(self.codeInitializeW7toVISI) for wordAddrHalf in range(0, nrWords / 2): self.executeCode((0xBA0B96, 0x0, 0x0)) self.readREGOUTword() - self.executeCode((0x0, 0xBA8BB6, 0x0, 0x0, 0xBAD3D6, 0x0, 0x0)) + # Microchip's bug in the documentation + # TBLRDH.B [W6++], [W7++] is correct instead of TBLRDH [W6++], [W7] + self.executeCode((0x0, 0xBADBB6, 0x0, 0x0, 0xBAD3D6, 0x0, 0x0)) self.readREGOUTword() self.executeCode((0x0, 0xBA0BB6, 0x0, 0x0)) self.readREGOUTword() @@ -174,7 +213,10 @@ class Chip_Microchip16_common(Chip): self.progressMeter(wordAddrHalf) self.progressMeterFinish() self.flushBufferToImage() - return self.Image + self.exitPM() + # return self.Image + return unpackImage() + def _t_readEEPROM(self): nrWords = self.eepromPages * self.eepromPageSize @@ -196,14 +238,37 @@ class Chip_Microchip16_common(Chip): def readEEPROM(self): nrWords = self.eepromPages * self.eepromPageSize - return self.readSequentialBlock(0x7F0000 , nrWords, "Reading EEPROM") + return self.readSequentialBlock(self.eepromStartAddress , nrWords, "Reading EEPROM") def readFuse(self): return self.readSequentialBlock(self.configWordAddr, self.fuseBytes / 2, "Reading Config Words") - + 6402 + def tmp_readSignature(self): + self.enterPM() + self.executeCode(self.codeExitResetVector) + self.executeCode((0x200FF0, 0x880190, 0x200006, 0x0, 0x0, 0x207847, 0x0, 0xBA0BB6, 0x0, 0x0, 0x0)) + self.Image = "" + self.readREGOUTword() + self.executeCode(self.codeExitResetVector) + self.flushBufferToImage() + signature = self.top.cmdReadBufferReg()[0:2] + devId = (byte2int(signature[1]) << 8) | byte2int(signature[0]) + if(devId in self.deviceIdMapDict): + print("device: {:s}".format(self.deviceIdMapDict.get(devId))) + else: + print("WARNING: device id {:o} not found in local dictionary".format(devId)) + return self.Image def readSignature(self): - return self.readSequentialBlock(self.deviceIDAddr, self.deviceIDLength, "Reading Signature") - + signature = self.readSequentialBlock(self.deviceIDAddr, self.deviceIDLength, "Reading Signature") + devId = (byte2int(signature[1]) << 8) | byte2int(signature[0]) + if(devId in self.deviceIdMapDict): + print("device: {:s}".format(self.deviceIdMapDict.get(devId))) + else: + print("WARNING: device id {:x} not found in local dictionary".format(devId)) + return signature + + def testPORTA(self): + self.executeCode((0x0, 0x23CFF4, 0x881644, 0x0, 0xEB8200, 0x881654, 0x0, 0x0)) def readSequentialBlock(self, startAddr, nWords, infoText): self.enterPM() self.progressMeterInit(infoText, nWords) @@ -213,41 +278,45 @@ class Chip_Microchip16_common(Chip): self.executeCode(self.getCodeInitializeTBLPAG(startAddr, 6)) self.executeCode(self.codeInitializeW7toVISI) for wordAddr in range(0, nWords): + # print "wAddr:{:x}".format(wordAddr) self.executeCode((0xBA0BB6, 0x0, 0x0)) self.readREGOUTword() - self.executeCode(self.codeExitResetVector) + self.executeCode((0x0,)) self.progressMeter(wordAddr) + self.executeCode(self.codeExitResetVectorSimple) self.progressMeterFinish() self.flushBufferToImage() - return self.Image + self.exitPM() + return self.Image 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) // 12) - self.enterPM() - self.executeCode(self.codeExitResetVector) - self.executeCode(self.getCodeSetNVMCON(0x4004)) - for packAddr in range(0, len(image) // 12): - self.progressMeter(packAddr) - writePackedInstructionWords(packAddr * 4, image[12 * packAddr:][:12]) - if(0 == (packAddr % 8)): - writeSeq() - writeSeq() - self.progressMeterFinish() - - # TODO: packed format is probably wrong - def writePackedInstructionWords(addr, packed12bytes): + def writePackedInstructionWords(addr, _16bytes): + """ + writes 4 double word size instructions to program memory. + Most high instruction byte has 0x00 value and thus is ignored. + """ + print("writingPackedInstr init, addr: {:x}\n".format(addr)) self.executeCode(self.getCodeInitializeTBLPAG(addr, 7)) - for wIdx in range(0, 6): - WD = (byte2int(packed12bytes[wIdx * 2 + 1]) << 8) | byte2int(packed12bytes[wIdx * 2 + 0]) - self.executeCode((0x200000 | (WD << 4) | wIdx)) + cnt = 0 + for wIdx in (0, 8): + # LSW0 + WD = (byte2int(_16bytes[wIdx + 1]) << 8) | byte2int(_16bytes[wIdx + 0]) + self.executeCode(((0x200000 | (WD << 4) | cnt),)) + cnt += 1 + # MSB1 MSB0 + WD = (byte2int(_16bytes[wIdx + 6]) << 8) | byte2int(_16bytes[wIdx + 2]) + self.executeCode(((0x200000 | (WD << 4) | cnt),)) + cnt += 1 + # LSW1 + WD = (byte2int(_16bytes[wIdx + 5]) << 8) | byte2int(_16bytes[wIdx + 4]) + self.executeCode(((0x200000 | (WD << 4) | cnt),)) + cnt += 1 self.executeCode((0xEB0300, 0x0)) + print("writingPackedInstr med\n") # Set the Read Pointer and load the (next set of) write latches for i in range(0, 2): self.executeCode((0xBB0BB6, 0x0, 0x0, 0xBBDBB6, 0x0, 0x0, 0xBBEBB6, 0x0, 0x0, 0xBB1BB6, 0x0, 0x0)) + print("writingPackedInstr done\n") def writeSeq(): # Initiate the write cycle self.executeCode((0xA8E761, 0x0, 0x0)) @@ -255,9 +324,27 @@ class Chip_Microchip16_common(Chip): pass self.executeCode((0x040200, 0x0)) - def writeEEPROM(self, image): + nrWords = self.flashPages * self.flashPageSize + if len(image) > (nrWords * 4) or len(image) % 4 != 0: + self.throwError("Invalid flash image size %d (expected <=%d and double word aligned)" % \ + (len(image), nrWords * 4)) + self.progressMeterInit("Writing flash", len(image) // 12) + self.enterPM() + self.executeCode(self.codeExitResetVector) + self.executeCode(self.getCodeSetNVMCON(0x4004)) + for packAddr in range(0, len(image) // 16): + self.progressMeter(packAddr) + writePackedInstructionWords(packAddr * 8, image[16 * packAddr:][:16]) + if(0 == ((packAddr + 1) % 8)): + writeSeq() + writeSeq() + self.progressMeterFinish() + self.exitPM() + + + def writeEEPROM(self, image): nrWords = self.eepromPages * self.eepromPageSize - if len(image) > nrWords / 2: + if len(image) > nrWords * 2: self.throwError("Invalid flash image size {:d} (expected <={:d})".format(len(image), 2 * nrWords)) self.enterPM() self.progressMeterInit("Writing eeprom", len(image) / 2) @@ -265,9 +352,9 @@ class Chip_Microchip16_common(Chip): self.executeCode(self.getCodeSetNVMCON(0x4004)) for addr in range(0, len(image) / 2): self.progressMeter(addr) - WD = (byte2int(image[wIdx * 2 + 1]) << 8) | byte2int(image[wIdx * 2 + 0]) + WD = (byte2int(image[addr * 2 + 1]) << 8) | byte2int(image[addr * 2 + 0]) if WD != 0xFFFF: - self.executeCode(self.getCodeInitializeTBLPAG(0x7F0000 | addr, 7)) + self.executeCode(self.getCodeInitializeTBLPAG(self.eepromStartAddress | (2 * addr), 7)) # Load W0 with data word program and load the wire latch self.executeCode((0x200000 | (WD << 4), 0xBB1B80, 0x0, 0x0)) # Initiate the write cycle @@ -281,9 +368,9 @@ class Chip_Microchip16_common(Chip): self.exitPM() def writeFuse(self, image): - if len(image) != 2 * self.getConfigWordSize(): + if len(image) != self.fuseBytes: self.throwError("Invalid Fuses image size %d (expected %d)" % \ - (len(image), 2 * self.getConfigWordSize())) + (len(image), self.fuseBytes)) self.progressMeterInit("Writing fuses", 0) # print "image1:%x,,%x,,%x" % (byte2int(image[0]),byte2int(image[1]),byte2int(image[1])<<8) CW = [] @@ -293,21 +380,17 @@ class Chip_Microchip16_common(Chip): 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.executeCode(self.codeExitResetVector) # init WritePointer (W7) for the TBLWT instruction, Set the NVMCON reg. to prog. Config. regs. self.executeCode((0x200007, 0x24004A, 0x883B0A)) # init TBLPAG - self.executeCode((0x200F86, 0x880190)) + # another bug in Microchip's doc - s/0x200F86/0x200F80/ + self.executeCode((0x200F80, 0x880190)) for configWord16 in listConfigWord16: - print ("write CW {:x}".format(configWord16)) + print ("write CW 0x{:x}".format(configWord16)) # Load the Config reg data to W6 - self.executeCode((0x200006 | (configWord16 << 4))) + self.executeCode(((0x200006 | (configWord16 << 4)),)) # Write the Config. reg. data to the write latch and increment Write Pointer self.executeCode((0x0, 0xBB1B86, 0x0, 0x0)) # Initiate the write cycle @@ -345,7 +428,7 @@ class Chip_Microchip16_common(Chip): CMD_SENDREGOUTINSTR 1 CMD_ENTERPM 2 ''' - self.top.cmdFPGAWrite(0x10, command) + self.top.cmdFPGAWrite(0x12, command) def readREGOUTword(self): def incBbAndCheckFillImage(): @@ -353,15 +436,15 @@ class Chip_Microchip16_common(Chip): if self.BufferedBytes == self.top.getBufferRegSize(): self.Image += self.top.cmdReadBufferReg(self.BufferedBytes) self.BufferedBytes = 0 - # self.busyWait() - self.top.hostDelay(0.000001) + self.busyWait() + # self.top.hostDelay(0.000001) self.sendCommand(self.PROGCMD_SENDREGOUTINSTR) - # self.busyWait() - self.top.hostDelay(0.000001) - self.readSDOBufferHigh() - incBbAndCheckFillImage() + self.busyWait() + # self.top.hostDelay(0.000001) self.readSDOBufferLow() incBbAndCheckFillImage() + self.readSDOBufferHigh() + incBbAndCheckFillImage() def flushBufferToImage(self): @@ -369,10 +452,10 @@ class Chip_Microchip16_common(Chip): self.Image += self.top.cmdReadBufferReg(self.BufferedBytes) self.BufferedBytes = 0 - def sendSIX(self, instr): + def sendSIX(self, instr, is9SIX=False): self.busyWait() self.setSDI(instr) - self.sendCommand(self.PROGCMD_SENDSIXINSTR) + self.sendCommand((self.PROGCMD_SENDSIXINSTR, self.PROGCMD_SEND9SIXINSTR)[is9SIX]) def read2words(self): self.executeCode((0xBA0B96, 0x000000, 0x000000)) @@ -422,8 +505,17 @@ class Chip_Microchip16_common(Chip): def isBusy(self): return bool(self.getStatusFlags() & self.STAT_BUSY) - + def setTopProgrammerDelays(self): + # print("tdel5:{:d}".format(int(math.ceil(self.delayP3 / 42e-9)))) + # print("tdly:{:d}".format(int(math.ceil(self.delayCommandDataREGOUT / 42e-9)))) + self.top.cmdFPGAWrite(0x10, int(math.ceil(self.delayP3 / 42e-9))) + self.top.cmdFPGAWrite(0x11, int(math.ceil(self.delayCommandDataREGOUT / 42e-9))) def busyWait(self): + # We do not poll the busy flag, because that would result + # in a significant slowdown. We delay long enough for the + # command to finish execution, instead. + self.top.hostDelay(0.0000005) + return for i in range(0, 100): if not self.isBusy(): return @@ -445,5 +537,5 @@ class Chip_Microchip16_common(Chip): self.Image = "" self.readREGOUTword() self.flushBufferToImage() - # self.executeCode((0x000000,)) - return int(self.Image[1]) & 0x80 + self.executeCode((0x000000,)) + return byte2int(self.Image[1]) & 0x80 diff --git a/libtoprammer/chips/microchip16/pic24f04ka200dip14.py b/libtoprammer/chips/microchip16/pic24f04ka200dip14.py index 7211aaa..beafad5 100644 --- a/libtoprammer/chips/microchip16/pic24f04ka200dip14.py +++ b/libtoprammer/chips/microchip16/pic24f04ka200dip14.py @@ -1,7 +1,7 @@ """ # TOP2049 Open Source programming suite # -# Microchip PIC24f04ka200 DIP18 +# Microchip PIC24f04ka200 DIP14 # # Copyright (c) 2013 Pavel Stemberk # @@ -21,14 +21,17 @@ """ from microchip16_common import * +from configWords import ka200_fuseDesc class Chip_Pic24f04ka200dip14(Chip_Microchip16_common): - voltageVDD = 3 - voltageVPP = 7.75 + voltageVDD = 3.3 + voltageVPP = 8 logicalFlashProgramMemorySize = 0x800000 - logicalFlashConfigurationMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False def __init__(self): Chip_Microchip16_common.__init__(self, @@ -36,45 +39,21 @@ class Chip_Pic24f04ka200dip14(Chip_Microchip16_common): chipPinVCC=14, chipPinsVPP=1, chipPinGND=13, - signature="\x02\x84", - flashPageSize=0x200, + signature="\x02\x0d", + # flashPageSize (in number of 24bit words) + flashPageSize=0xAFE / 2 + 2, + # flashPageSize=0x40, flashPages=1, - eepromPageSize=64, - eepromPages=1, - fuseBytes=16 * 2 + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 ) self.configWordAddr = 0xF80000 # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize - - def getIHexInterpreter(self): - inter = IHexInterpreter() - inter.progmemRanges = [ AddressRange(0, 2 * self.flashPageSize) ] - inter.fuseRanges = [ AddressRange(2 * self.configWordAddr, - 2 * self.configWordAddr + 1) ] - return inter - - def sendWriteFlashInstr(self): - ''' - ''' - self.sendInstr(self.CMD_BEGIN_PROGRAMMING_ONLY_CYCLE) - self.top.hostDelay(self.delayTinternalProgDM) -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"), -) +fuseDesc = ka200_fuseDesc ChipDescription( Chip_Pic24f04ka200dip14, @@ -82,7 +61,7 @@ ChipDescription( chipID="pic24f04ka200dip14", runtimeID=(0xDF01, 0x01), chipVendors="Microchip", - description="PIC24F04KA200 - experimental mode !!!", + description="PIC24F04KA200", packages=(("DIP14", ""),), fuseDesc=fuseDesc, maintainer="Pavel Stemberk ", diff --git a/libtoprammer/chips/microchip16/pic24f04ka200sip6.py b/libtoprammer/chips/microchip16/pic24f04ka200sip6.py new file mode 100644 index 0000000..270f4d9 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f04ka200sip6.py @@ -0,0 +1,73 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f04ka200 SIP6 +# +# Copyright (c) 2013 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import ka200_fuseDesc + +class Chip_Pic24f04ka200sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x02\x0d", + # flashPageSize (in number of 24bit words) + flashPageSize=0xAFE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = ka200_fuseDesc + +ChipDescription( + Chip_Pic24f04ka200sip6, + bitfile = "microchip16sip6", + chipID="pic24f04ka200sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F04KA200 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f04ka201dip20.py b/libtoprammer/chips/microchip16/pic24f04ka201dip20.py new file mode 100644 index 0000000..64dd695 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f04ka201dip20.py @@ -0,0 +1,68 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f04ka201 DIP20 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import ka200_fuseDesc + +class Chip_Pic24f04ka201dip20(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP20", + chipPinVCC=20, + chipPinsVPP=1, + chipPinGND=19, + signature="\x00\x0d", + # flashPageSize (in number of 24bit words) + flashPageSize=0xAFE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = ka200_fuseDesc + +ChipDescription( + Chip_Pic24f04ka201dip20, + bitfile="microchip16dip14dip20", + chipID="pic24f04ka201dip20", + runtimeID=(0xDF01, 0x01), + chipVendors="Microchip", + description="PIC24F04KA201", + packages=(("DIP20", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f04ka201sip6.py b/libtoprammer/chips/microchip16/pic24f04ka201sip6.py new file mode 100644 index 0000000..50c5d54 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f04ka201sip6.py @@ -0,0 +1,73 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f04ka201 SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import ka200_fuseDesc + +class Chip_Pic24f04ka201sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x00\x0d", + # flashPageSize (in number of 24bit words) + flashPageSize=0xAFE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = ka200_fuseDesc + +ChipDescription( + Chip_Pic24f04ka201sip6, + bitfile = "microchip16sip6", + chipID="pic24f04ka201sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F04KA201 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f04kl100dip14.py b/libtoprammer/chips/microchip16/pic24f04kl100dip14.py new file mode 100644 index 0000000..bcf0023 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f04kl100dip14.py @@ -0,0 +1,68 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f04kl100 DIP14 +# +# Copyright (c) 2013 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f04kl100dip14(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP14", + chipPinVCC=14, + chipPinsVPP=1, + chipPinGND=13, + signature="\x01\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0xAFE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f04kl100dip14, + bitfile="microchip16dip14dip20", + chipID="pic24f04kl100dip14", + runtimeID=(0xDF01, 0x01), + chipVendors="Microchip", + description="PIC24F04KL100", + packages=(("DIP14", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f04kl100sip6.py b/libtoprammer/chips/microchip16/pic24f04kl100sip6.py new file mode 100644 index 0000000..300ff06 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f04kl100sip6.py @@ -0,0 +1,73 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f04kl100 SIP6 +# +# Copyright (c) 2013 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f04kl100sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x01\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0xAFE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f04kl100sip6, + bitfile = "microchip16sip6", + chipID="pic24f04kl100sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F04KL100 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f04kl101dip20.py b/libtoprammer/chips/microchip16/pic24f04kl101dip20.py new file mode 100644 index 0000000..d96cbc9 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f04kl101dip20.py @@ -0,0 +1,68 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f04kl101 DIP20 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f04kl101dip20(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP20", + chipPinVCC=20, + chipPinsVPP=1, + chipPinGND=19, + signature="\x02\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0xAFE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f04kl101dip20, + bitfile="microchip16dip14dip20", + chipID="pic24f04kl101dip20", + runtimeID=(0xDF01, 0x01), + chipVendors="Microchip", + description="PIC24F04KL101", + packages=(("DIP20", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f04kl101sip6.py b/libtoprammer/chips/microchip16/pic24f04kl101sip6.py new file mode 100644 index 0000000..74dad3b --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f04kl101sip6.py @@ -0,0 +1,73 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f04kl101 SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f04kl101sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x02\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0xAFE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f04kl101sip6, + bitfile = "microchip16sip6", + chipID="pic24f04kl101sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F04KL101 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl200dip14.py b/libtoprammer/chips/microchip16/pic24f08kl200dip14.py new file mode 100644 index 0000000..678070f --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl200dip14.py @@ -0,0 +1,68 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f08kl200 DIP14 +# +# Copyright (c) 2013 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl200dip14(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP14", + chipPinVCC=14, + chipPinsVPP=1, + chipPinGND=13, + signature="\x05\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x15FE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl200dip14, + bitfile="microchip16dip14dip20", + chipID="pic24f08kl200dip14", + runtimeID=(0xDF01, 0x01), + chipVendors="Microchip", + description="PIC24F08KL200", + packages=(("DIP14", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl200sip6.py b/libtoprammer/chips/microchip16/pic24f08kl200sip6.py new file mode 100644 index 0000000..d553bf4 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl200sip6.py @@ -0,0 +1,73 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f08kl200 SIP6 +# +# Copyright (c) 2013 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl200sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x05\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x15FE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl200sip6, + bitfile = "microchip16sip6", + chipID="pic24f08kl200sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F08KL200 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl201dip20.py b/libtoprammer/chips/microchip16/pic24f08kl201dip20.py new file mode 100644 index 0000000..139497a --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl201dip20.py @@ -0,0 +1,68 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f08kl201 DIP20 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl201dip20(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP20", + chipPinVCC=20, + chipPinsVPP=1, + chipPinGND=19, + signature="\x06\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x15FE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl201dip20, + bitfile="microchip16dip14dip20", + chipID="pic24f08kl201dip20", + runtimeID=(0xDF01, 0x01), + chipVendors="Microchip", + description="PIC24F08KL201", + packages=(("DIP20", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl201sip6.py b/libtoprammer/chips/microchip16/pic24f08kl201sip6.py new file mode 100644 index 0000000..77c032a --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl201sip6.py @@ -0,0 +1,73 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f08kl201 SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl201sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + hasEEPROM = False + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x06\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x15FE / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0, + eepromPages=0, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl201sip6, + bitfile = "microchip16sip6", + chipID="pic24f08kl201sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F08KL201 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl301dip20.py b/libtoprammer/chips/microchip16/pic24f08kl301dip20.py new file mode 100644 index 0000000..6fad118 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl301dip20.py @@ -0,0 +1,68 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24F08KL301DIP20 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl301dip20(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + eepromStartAddress = 0x7FFF00 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP20", + chipPinVCC=20, + chipPinsVPP=1, + chipPinGND=19, + signature="\x0a\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x2bfe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x80, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl301dip20, + bitfile="microchip16dip14dip20", + chipID="pic24f08kl301dip20", + runtimeID=(0xDF01, 0x01), + chipVendors="Microchip", + description="PIC24F08KL301", + packages=(("DIP20", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl301sip6.py b/libtoprammer/chips/microchip16/pic24f08kl301sip6.py new file mode 100644 index 0000000..cb365eb --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl301sip6.py @@ -0,0 +1,73 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24F08KL301SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl301sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + eepromStartAddress = 0x7FFF00 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x0a\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x2bfe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x80, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl301sip6, + bitfile = "microchip16sip6", + chipID="pic24f08kl301sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F08KL301 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl302dip28.py b/libtoprammer/chips/microchip16/pic24f08kl302dip28.py new file mode 100644 index 0000000..0af09d1 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl302dip28.py @@ -0,0 +1,68 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f08kl302 DIP28 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl302dip28(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + eepromStartAddress = 0x7FFF00 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP28", + chipPinVCC=28, + chipPinsVPP=1, + chipPinGND=27, + signature="\x00\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x15fe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x80, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl302dip28, + bitfile="microchip16dip28", + chipID="pic24f08kl302dip28", + runtimeID=(0xDF02, 0x01), + chipVendors="Microchip", + description="PIC24F08KL302", + packages=(("DIP28", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl302sip6.py b/libtoprammer/chips/microchip16/pic24f08kl302sip6.py new file mode 100644 index 0000000..be001a5 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl302sip6.py @@ -0,0 +1,73 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f08kl302 SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl302sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + eepromStartAddress = 0x7FFF00 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x00\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x15fe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x80, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl302sip6, + bitfile = "microchip16sip6", + chipID="pic24f08kl302sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F08KL302 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl401dip20.py b/libtoprammer/chips/microchip16/pic24f08kl401dip20.py new file mode 100644 index 0000000..c31829a --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl401dip20.py @@ -0,0 +1,66 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24F08KL401DIP20 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl401dip20(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP20", + chipPinVCC=20, + chipPinsVPP=1, + chipPinGND=19, + signature="\x0e\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x2bfe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x100, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl401dip20, + bitfile="microchip16dip14dip20", + chipID="pic24f08kl401dip20", + runtimeID=(0xDF01, 0x01), + chipVendors="Microchip", + description="PIC24F08KL401", + packages=(("DIP20", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl401sip6.py b/libtoprammer/chips/microchip16/pic24f08kl401sip6.py new file mode 100644 index 0000000..c937c70 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl401sip6.py @@ -0,0 +1,71 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24F08KL401SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl401sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x0e\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x2bfe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x100, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl401sip6, + bitfile = "microchip16sip6", + chipID="pic24f08kl401sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F08KL401 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl402dip28.py b/libtoprammer/chips/microchip16/pic24f08kl402dip28.py new file mode 100644 index 0000000..aaf6b95 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl402dip28.py @@ -0,0 +1,66 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f08kl402 DIP28 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl402dip28(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP28", + chipPinVCC=28, + chipPinsVPP=1, + chipPinGND=27, + signature="\x04\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x15fe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x100, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl402dip28, + bitfile="microchip16dip28", + chipID="pic24f08kl402dip28", + runtimeID=(0xDF02, 0x01), + chipVendors="Microchip", + description="PIC24F08KL402", + packages=(("DIP28", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f08kl402sip6.py b/libtoprammer/chips/microchip16/pic24f08kl402sip6.py new file mode 100644 index 0000000..913a632 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f08kl402sip6.py @@ -0,0 +1,71 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24f08kl402 SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f08kl402sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x04\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x15fe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x100, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f08kl402sip6, + bitfile = "microchip16sip6", + chipID="pic24f08kl402sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F08KL402 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f16kl401dip20.py b/libtoprammer/chips/microchip16/pic24f16kl401dip20.py new file mode 100644 index 0000000..18ab112 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f16kl401dip20.py @@ -0,0 +1,66 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24F16KL401DIP20 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f16kl401dip20(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP20", + chipPinVCC=20, + chipPinsVPP=1, + chipPinGND=19, + signature="\x1e\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x2bfe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x100, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f16kl401dip20, + bitfile="microchip16dip14dip20", + chipID="pic24f16kl401dip20", + runtimeID=(0xDF01, 0x01), + chipVendors="Microchip", + description="PIC24F16KL401", + packages=(("DIP20", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f16kl401sip6.py b/libtoprammer/chips/microchip16/pic24f16kl401sip6.py new file mode 100644 index 0000000..6b3fa44 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f16kl401sip6.py @@ -0,0 +1,71 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24F16KL401SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f16kl401sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x1e\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x2bfe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x100, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f16kl401sip6, + bitfile = "microchip16sip6", + chipID="pic24f16kl401sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F16KL401 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f16kl402dip28.py b/libtoprammer/chips/microchip16/pic24f16kl402dip28.py new file mode 100644 index 0000000..5739ed1 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f16kl402dip28.py @@ -0,0 +1,66 @@ +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24F16KL402 DIP28 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f16kl402dip28(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage="DIP28", + chipPinVCC=28, + chipPinsVPP=1, + chipPinGND=27, + signature="\x14\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x2bfe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x100, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f16kl402dip28, + bitfile="microchip16dip28", + chipID="pic24f16kl402dip28", + runtimeID=(0xDF02, 0x01), + chipVendors="Microchip", + description="PIC24F16KL402", + packages=(("DIP28", ""),), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip16/pic24f16kl402sip6.py b/libtoprammer/chips/microchip16/pic24f16kl402sip6.py new file mode 100644 index 0000000..c90d9a8 --- /dev/null +++ b/libtoprammer/chips/microchip16/pic24f16kl402sip6.py @@ -0,0 +1,71 @@ +# +# THIS FILE WAS AUTOGENERATED BY makeSip6.py +# Do not edit this file manually. All changes will be lost. +# + +""" +# TOP2049 Open Source programming suite +# +# Microchip PIC24F16KL402 SIP6 +# +# Copyright (c) 2014 Pavel Stemberk +# +# 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 microchip16_common import * +from configWords import klx0x_fuseDesc + +class Chip_Pic24f16kl402sip6(Chip_Microchip16_common): + + voltageVDD = 3.3 + voltageVPP = 8 + + logicalFlashProgramMemorySize = 0x800000 + logicalFlashConfigurationMemorySize = 0x800000 + + def __init__(self): + Chip_Microchip16_common.__init__(self, + chipPackage = "DIP10", + chipPinVCC = 9, + chipPinsVPP = 10, + chipPinGND = 8, + signature="\x14\x4b", + # flashPageSize (in number of 24bit words) + flashPageSize=0x2bfe / 2 + 2, + # flashPageSize=0x40, + flashPages=1, + # eepromPageSize (in 16bit words) + eepromPageSize=0x100, + eepromPages=1, + # all 7 words uses lowest byte only + fuseBytes=2 * 9 + ) + self.configWordAddr = 0xF80000 + # self.osccalBackupAddr = self.userIDLocationAddr + self.userIDLocationSize + +fuseDesc = klx0x_fuseDesc + +ChipDescription( + Chip_Pic24f16kl402sip6, + bitfile = "microchip16sip6", + chipID="pic24f16kl402sip6", + runtimeID = (0xDF05, 0x01), + chipVendors="Microchip", + description = "PIC24F16KL402 - ICD", + packages = (("DIP10", ""), ), + fuseDesc=fuseDesc, + maintainer="Pavel Stemberk ", +) diff --git a/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py b/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py index 1e87c9d..92d8401 100644 --- a/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py +++ b/libtoprammer/chips/microchip8/microchip8_splittedPMarea.py @@ -53,7 +53,7 @@ class microchip8_splittedPMarea(Chip_Microchip8_common): 0o053:"16F84A", 0o546:"12F1501", 0o554:"12LF1501", 0o547:"16F1503", 0o555:"16LF1503", 0o550:"16F1507", 0o556:"16LF1507", 0o551:"16F1508", 0o557:"16LF1508", 0o552:"16F1509", 0o560:"16LF1509", - 0o460:"16F1933", 0o462:"16F1934", 0o463:"16F1936", 0o464:"16F1937", 0o465:"16F1938", 0o466:"16F1939", + 0o460:"16F1933", 0o432:"16F1934", 0o433:"16F1936", 0o434:"16F1937", 0o435:"16F1938", 0o436:"16F1939", 0o450:"16F1946", 0o451:"16F1947", 0o440:"16LF1933", 0o442:"16LF1934", 0o443:"16LF1936", 0o444:"16LF1937", 0o445:"16LF1938", 0o446:"16LF1939", 0o454:"16LF1946", 0o455:"16LF1947", 0o541:"16LF1902", 0o540:"16LF1903", 0o544:"16LF1904", 0o543:"16LF1906", 0o542:"16LF1907", diff --git a/libtoprammer/fpga/bin/microchip16dip14dip20.bit b/libtoprammer/fpga/bin/microchip16dip14dip20.bit index 2a48cad..1e311ab 100644 Binary files a/libtoprammer/fpga/bin/microchip16dip14dip20.bit and b/libtoprammer/fpga/bin/microchip16dip14dip20.bit differ diff --git a/libtoprammer/fpga/src/microchip16/microchip16.vh b/libtoprammer/fpga/src/microchip16/microchip16.vh index 8fdb1bf..ce6b51c 100644 --- a/libtoprammer/fpga/src/microchip16/microchip16.vh +++ b/libtoprammer/fpga/src/microchip16/microchip16.vh @@ -23,148 +23,172 @@ `include "common.vh" -`define DELAY42NSEC(D42NSEC) __delay_count <= (D42NSEC) - 1;//41.666 ns wait cycle if D42NSEC = 1 +`define DUT_SDIO 35 -`define CMD_SENDSIXINSTR 0 -`define CMD_SENDREGOUTINSTR 1 +`define DELAY42NSEC(D42NSEC) __delay_count <= (D42NSEC) - 1;//41.666 ns wait cycle if D42NSEC = 1 + +`define CMD_SENDSIXINSTR 0 +`define CMD_SENDREGOUTINSTR 1 `define CMD_ENTERPM 2 +`define CMD_SEND9SIXINSTR 3 `define ENTERPM_SEQ 32'h4D434851 -`define ALL_WITHOUT_ZIF(NAME_, ID_MAJOR_, ID_MINOR_) \ - `BOTTOMHALF_BEGIN(NAME_, ID_MAJOR_, ID_MINOR_) \ - /* Programmer context */ \ - reg [7:0] prog_count; \ - reg dut_sci_manual; \ - reg dut_sci_auto; \ - wire dut_sci; \ - reg dut_sdio_driven_manual; \ - reg dut_sdio_driven_auto; \ - wire dut_sdio_driven; \ - reg dut_sdio_value_manual; \ - reg dut_sdio_value_auto; \ - wire dut_sdio_value; \ - reg dut_vpp; \ - reg [23:0] sdi_buf; \ - reg [15:0] sdo_buf; \ - reg [31:0] enterpm_seq; \ - reg sdio_auto; \ - \ - initial begin \ - prog_count <= 0; \ - dut_sci_manual <= 0; \ - dut_sci_auto <= 0; \ - dut_sdio_driven_auto <= 0; \ - dut_sdio_driven_manual <= 0; \ - dut_sdio_value_auto <= 0; \ - dut_sdio_value_manual <= 0; \ - sdi_buf <= 0; \ - sdo_buf <= 0; \ - dut_vpp <= 0; \ - sdio_auto <= 1; \ - enterpm_seq <= `ENTERPM_SEQ ; \ - end \ - \ - `ASYNCPROC_BEGIN \ - if (`CMD_IS_RUNNING) begin \ - case (`CMD_STATE) \ - 0: begin \ - case(`CMD_NR) \ - `CMD_SENDSIXINSTR: begin \ - dut_sdio_driven_auto <= 1; \ - if (prog_count > 8) begin \ - dut_sdio_value_auto <= sdi_buf[prog_count-9];\ - end \ - end \ - `CMD_SENDREGOUTINSTR: begin \ - if (prog_count == 0) begin \ - dut_sdio_value_auto <= 1; \ - end else begin \ - dut_sdio_value_auto <= 0; \ - end \ - if (prog_count < 4 ) begin \ - dut_sdio_driven_auto <= 1; \ - end else begin \ - dut_sdio_driven_auto <= 0; \ - end \ - end \ - `CMD_ENTERPM: begin \ - dut_sdio_driven_auto <= 1; \ - dut_sdio_value_auto <= enterpm_seq[31-prog_count];\ + +`define ALL_WITHOUT_ZIF(NAME_, ID_MAJOR_, ID_MINOR_) \ +`BOTTOMHALF_BEGIN(NAME_,ID_MAJOR_, ID_MINOR_) \ + /* Programmer context */ \ + reg [7:0] prog_count; \ + reg dut_sci_manual; \ + reg dut_sci_auto; \ + wire dut_sci; \ + reg dut_sdio_driven_manual; \ + reg dut_sdio_driven_auto; \ + wire dut_sdio_driven; \ + reg dut_sdio_value_manual; \ + reg dut_sdio_value_auto; \ + wire dut_sdio_value; \ + reg dut_vpp; \ + reg [23:0] sdi_buf; \ + reg [15:0] sdo_buf; \ + reg [31:0] enterpm_seq; \ + reg sdio_auto;\ + reg [3:0] dly5; \ + reg [7:0] tdly; \ + \ + initial begin \ + prog_count <= 0; \ + dut_sci_manual <= 0; \ + dut_sci_auto <= 0; \ + dut_sdio_driven_auto <= 0; \ + dut_sdio_driven_manual <= 0; \ + dut_sdio_value_auto <= 0; \ + dut_sdio_value_manual <= 0; \ + sdi_buf <= 0; \ + sdo_buf <= 0; \ + dut_vpp <= 0; \ + sdio_auto <= 1; \ + enterpm_seq <= `ENTERPM_SEQ ;\ + tdly <= 24; \ + dly5 <= 5; \ + end \ + \ + `ASYNCPROC_BEGIN \ + if (`CMD_IS_RUNNING) begin \ + case (`CMD_STATE) \ + 0: begin \ + case(`CMD_NR)\ + `CMD_SENDSIXINSTR: begin \ + dut_sdio_driven_auto <= 1; \ + if (prog_count > 3) begin \ + dut_sdio_value_auto <= sdi_buf[prog_count-4];\ + end \ + end \ + `CMD_SEND9SIXINSTR: begin \ + dut_sdio_driven_auto <= 1; \ + if (prog_count > 8) begin \ + dut_sdio_value_auto <= sdi_buf[prog_count-9];\ + end \ + end \ + `CMD_SENDREGOUTINSTR: begin \ + if (prog_count == 0) begin \ + dut_sdio_value_auto <= 1; \ + end else begin \ + dut_sdio_value_auto <= 0; \ + end \ + if (prog_count < 4 ) begin \ + dut_sdio_driven_auto <= 1; \ + end else begin \ + dut_sdio_driven_auto <= 0; \ end \ - endcase \ - `CMD_STATE_SET(1) \ - `DELAY42NSEC(5) \ - end \ - 1: begin \ - dut_sci_auto <= 1; \ - if (`CMD_IS(`CMD_SENDREGOUTINSTR) && prog_count > 11 && prog_count < 28) begin \ - sdo_buf[prog_count-12] <= zif[`DUT_SDIO];\ - end \ - `CMD_STATE_SET(2) \ - `DELAY42NSEC(5) \ - end \ - 2: begin \ - prog_count <= prog_count + 1; \ - `CMD_STATE_SET(3) \ - `DELAY42NSEC(5) \ - end \ - 3: begin \ - dut_sci_auto <= 0; /* CLK lo */ \ - \ - if ( \ - (prog_count == 32 && `CMD_IS(`CMD_ENTERPM)) ||\ - (prog_count == 33 && `CMD_IS(`CMD_SENDSIXINSTR)) ||\ - (prog_count == 28 && `CMD_IS(`CMD_SENDREGOUTINSTR)) \ - ) begin \ - `CMD_FINISH \ - prog_count <= 0; \ - dut_sdio_value_auto <= 0; \ - end else begin \ - `DELAY42NSEC(5) \ - `CMD_STATE_SET(0) \ - end \ - end \ - endcase \ - end \ - `ASYNCPROC_END \ - \ - `DATAWRITE_BEGIN \ - `ADDR(0): begin /* Run command */ \ - `CMD_RUN(in_data) \ - sdio_auto <= 1; \ - end \ - `ADDR(3): begin /* Load SDI LO BYTE sequence */ \ - sdi_buf[7:0] <= in_data; \ - end \ - `ADDR(4): begin /* Load SDI ME BYTE sequence */ \ - sdi_buf[15:8] <= in_data; \ - end \ - `ADDR(5): begin /* Load SDI HI BYTE sequence */ \ - sdi_buf[23:16] <= in_data; \ - end \ - `ADDR(9): begin /* Set signals manually */ \ - dut_sci_manual <= in_data[0]; /* SCI */ \ - dut_sdio_driven_manual <= in_data[1]; /* SDIODRIVEN */ \ - dut_sdio_value_manual <= in_data[2]; /* SDIOVALUE */ \ - sdio_auto <= 0; \ - end \ - `DATAWRITE_END \ - \ - `DATAREAD_BEGIN \ - `ADDR(0): begin /* Get SDO sequence high (bits 8-13) */ \ - out_data[7:0] <= 255; /*sdo_buf[15:8];*/ \ - end \ - `ADDR(2): begin /* Read status */ \ - out_data[0] <= `CMD_IS_RUNNING; /* busy */ \ - out_data[1] <= zif[`DUT_SDIO]; /* Raw SDO pin access */\ - end \ - `ADDR(3): begin /* Get SDO sequence low (bits 0-7) */ \ - out_data[7:0] <= 0; /*sdo_buf[7:0]; */ \ - end \ - `DATAREAD_END \ - \ - assign dut_sci = `CMD_IS_RUNNING ? dut_sci_auto : dut_sci_manual; \ - assign dut_sdio_driven = sdio_auto?dut_sdio_driven_auto:dut_sdio_driven_manual; \ - assign dut_sdio_value = sdio_auto?dut_sdio_value_auto:dut_sdio_value_manual; + end \ + `CMD_ENTERPM: begin \ + dut_sdio_driven_auto <= 1; \ + dut_sdio_value_auto <= enterpm_seq[31-prog_count];\ + end \ + endcase \ + `CMD_STATE_SET(1) \ + `DELAY42NSEC(dly5) \ + end \ + 1: begin \ + dut_sci_auto <= 1; \ + if (`CMD_IS(`CMD_SENDREGOUTINSTR) && prog_count > 11 && prog_count < 28) begin \ + sdo_buf[prog_count-12] <= zif[`DUT_SDIO];\ + end \ + `CMD_STATE_SET(2) \ + `DELAY42NSEC(dly5) \ + end \ + 2: begin \ + prog_count <= prog_count + 1; \ + `CMD_STATE_SET(3) \ + `DELAY42NSEC(dly5) \ + end \ + 3: begin \ + dut_sci_auto <= 0; /* CLK lo */ \ + \ + if (\ + (prog_count == 32 && `CMD_IS(`CMD_ENTERPM)) ||\ + (prog_count == 33 && `CMD_IS(`CMD_SEND9SIXINSTR)) ||\ + (prog_count == 28 && (`CMD_IS(`CMD_SENDREGOUTINSTR) || `CMD_IS(`CMD_SENDSIXINSTR)))\ + ) begin \ + `CMD_FINISH \ + prog_count <= 0; \ + dut_sdio_value_auto <= 0; \ + end else begin\ + if(`CMD_IS(`CMD_SENDREGOUTINSTR) && prog_count == 12 ) begin\ + `DELAY42NSEC(tdly)\ + end else begin \ + `DELAY42NSEC(dly5) \ + end \ + `CMD_STATE_SET(0) \ + end \ + end \ + endcase \ + end \ + `ASYNCPROC_END \ + \ + `DATAWRITE_BEGIN \ + `ADDR(0): begin /* Set dly5 - base clock period half, 1=42ns*/ \ + dly5 <= in_data[3:0]; \ + end \ + `ADDR(1): begin /* Set tdly - REGOUT: delay between command and data 1=42ns*/ \ + tdly <= in_data; \ + end \ + `ADDR(2): begin /* Run command */ \ + `CMD_RUN(in_data) \ + sdio_auto <= 1; \ + end\ + `ADDR(3): begin /* Load SDI LO BYTE sequence */ \ + sdi_buf[7:0] <= in_data; \ + end \ + `ADDR(4): begin /* Load SDI ME BYTE sequence */ \ + sdi_buf[15:8] <= in_data; \ + end \ + `ADDR(5): begin /* Load SDI HI BYTE sequence */ \ + sdi_buf[23:16] <= in_data; \ + end \ + `ADDR(9): begin /* Set signals manually */ \ + dut_sci_manual <= in_data[0]; /* SCI */ \ + dut_sdio_driven_manual <= in_data[1]; /* SDIODRIVEN */ \ + dut_sdio_value_manual <= in_data[2]; /* SDIOVALUE */ \ + sdio_auto <= 0; \ + end \ + `DATAWRITE_END \ + \ + `DATAREAD_BEGIN \ + `ADDR(0): begin /* Get SDO sequence high (bits 8-13) */ \ + out_data[7:0] <= sdo_buf[15:8]; \ + end \ + `ADDR(2): begin /* Read status */ \ + out_data[0] <= `CMD_IS_RUNNING; /* busy */ \ + out_data[1] <= zif[`DUT_SDIO]; /* Raw SDO pin access */\ + end \ + `ADDR(3): begin /* Get SDO sequence low (bits 0-7) */ \ + out_data[7:0] <= sdo_buf[7:0]; \ + end \ + `DATAREAD_END \ + \ + assign dut_sci = `CMD_IS_RUNNING ? dut_sci_auto : dut_sci_manual; \ + assign dut_sdio_driven = sdio_auto?dut_sdio_driven_auto:dut_sdio_driven_manual; \ + assign dut_sdio_value = sdio_auto?dut_sdio_value_auto:dut_sdio_value_manual; /* vim: filetype=verilog:shiftwidth=8:tabstop=8:softtabstop=8 */ diff --git a/libtoprammer/fpga/src/microchip16/microchip16dip14dip20/microchip16dip14dip20.v b/libtoprammer/fpga/src/microchip16/microchip16dip14dip20/microchip16dip14dip20.v index 28955fa..3df1c40 100644 --- a/libtoprammer/fpga/src/microchip16/microchip16dip14dip20/microchip16dip14dip20.v +++ b/libtoprammer/fpga/src/microchip16/microchip16dip14dip20/microchip16dip14dip20.v @@ -1,8 +1,8 @@ /* * TOP2049 Open Source programming suite * - * Microchip DIP14 and DIP20 implementation - * FPGA bottomhalf implementation + * Microchip header file for 16 bit MCUs + * FPGA Main bottomhalf implementation * * Copyright (c) 2013 Pavel Stemberk * @@ -21,8 +21,19 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -`define DUT_SDIO 17 +`include "common.vh" `include "microchip16.vh" + +`define DUT_SDIO 17 + +`define DELAY42NSEC(D42NSEC) __delay_count <= (D42NSEC) - 1;//41.666 ns wait cycle if D42NSEC = 1 + +`define CMD_SENDSIXINSTR 0 +`define CMD_SENDREGOUTINSTR 1 +`define CMD_ENTERPM 2 +`define CMD_SEND9SIXINSTR 3 +`define ENTERPM_SEQ 32'h4D434851 + `ALL_WITHOUT_ZIF(microchip16dip14dip20, 32'hDF01, 1) `ZIF_UNUSED(1) @@ -75,3 +86,6 @@ `ZIF_UNUSED(48) `BOTTOMHALF_END + +/* vim: filetype=verilog:shiftwidth=8:tabstop=8:softtabstop=8 + */ diff --git a/libtoprammer/fpga/src/microchip16/microchip16dip28/Makefile b/libtoprammer/fpga/src/microchip16/microchip16dip28/Makefile new file mode 100644 index 0000000..c1a11f1 --- /dev/null +++ b/libtoprammer/fpga/src/microchip16/microchip16dip28/Makefile @@ -0,0 +1,3 @@ +NAME:=microchip16dip28 +include ../../../common/makefile +COMMONDIR:=../../../common diff --git a/libtoprammer/fpga/src/microchip16/microchip16dip28/microchip16dip28.v b/libtoprammer/fpga/src/microchip16/microchip16dip28/microchip16dip28.v new file mode 100644 index 0000000..f359226 --- /dev/null +++ b/libtoprammer/fpga/src/microchip16/microchip16dip28/microchip16dip28.v @@ -0,0 +1,90 @@ +/* + * TOP2049 Open Source programming suite + * + * Microchip header file for 16 bit MCUs + * FPGA Main bottomhalf implementation + * + * Copyright (c) 2013 Pavel Stemberk + * + * 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. + */ + +`include "common.vh" +`include "microchip16.vh" + +`define DUT_SDIO 35 + +`define DELAY42NSEC(D42NSEC) __delay_count <= (D42NSEC) - 1;//41.666 ns wait cycle if D42NSEC = 1 + +`define CMD_SENDSIXINSTR 0 +`define CMD_SENDREGOUTINSTR 1 +`define CMD_ENTERPM 2 +`define CMD_SEND9SIXINSTR 3 +`define ENTERPM_SEQ 32'h4D434851 + +`ALL_WITHOUT_ZIF(microchip16dip28, 32'hDF02, 1) + `ZIF_UNUSED(1) + `ZIF_UNUSED(2) + `ZIF_UNUSED(3) + `ZIF_UNUSED(4) + `ZIF_UNUSED(5) + `ZIF_UNUSED(6) + `ZIF_UNUSED(7) + `ZIF_UNUSED(8) + `ZIF_UNUSED(9) + `ZIF_UNUSED(10) + `ZIF_UNUSED(11) + `ZIF_UNUSED(12) + `ZIF_UNUSED(13) + `ZIF_UNUSED(14) + `ZIF_UNUSED(15) + bufif0(zif[16], low, low); /* GND */ + bufif0(zif[17], high, low); /* VCC */ + `ZIF_UNUSED(18) + `ZIF_UNUSED(19) + `ZIF_UNUSED(20) + `ZIF_UNUSED(21) + `ZIF_UNUSED(22) + `ZIF_UNUSED(23) + `ZIF_UNUSED(24) + `ZIF_UNUSED(25) + `ZIF_UNUSED(26) + `ZIF_UNUSED(27) + `ZIF_UNUSED(28) + `ZIF_UNUSED(29) + `ZIF_UNUSED(30) + `ZIF_UNUSED(31) + bufif0(zif[32], low, dut_vpp); /* VPP/Reset */ + `ZIF_UNUSED(33) + `ZIF_UNUSED(34) + bufif0(zif[35], dut_sdio_value, !dut_sdio_driven); /* SDO - PGED1 */ + bufif0(zif[36], dut_sci, low); /* SCI - PGEC1 */ + `ZIF_UNUSED(37) + `ZIF_UNUSED(38) + `ZIF_UNUSED(39) + `ZIF_UNUSED(40) + `ZIF_UNUSED(41) + `ZIF_UNUSED(42) + `ZIF_UNUSED(43) + `ZIF_UNUSED(44) + `ZIF_UNUSED(45) + `ZIF_UNUSED(46) + `ZIF_UNUSED(47) + `ZIF_UNUSED(48) + +`BOTTOMHALF_END + +/* vim: filetype=verilog:shiftwidth=8:tabstop=8:softtabstop=8 + */ diff --git a/libtoprammer/fpga/src/microchip16/microchip16sip6/Makefile b/libtoprammer/fpga/src/microchip16/microchip16sip6/Makefile new file mode 100644 index 0000000..342b99f --- /dev/null +++ b/libtoprammer/fpga/src/microchip16/microchip16sip6/Makefile @@ -0,0 +1,3 @@ +NAME:=microchip16sip6 +include ../../../common/makefile +COMMONDIR:=../../../common diff --git a/libtoprammer/fpga/src/microchip16/microchip16sip6/microchip16sip6.v b/libtoprammer/fpga/src/microchip16/microchip16sip6/microchip16sip6.v new file mode 100644 index 0000000..5e8b3fb --- /dev/null +++ b/libtoprammer/fpga/src/microchip16/microchip16sip6/microchip16sip6.v @@ -0,0 +1,51 @@ +/* + * TOP2049 Open Source programming suite + * + * Microchip ICD2 SIP6 connection (implemented as DIP10) + * FPGA bottomhalf implementation + * + * Copyright (c) 2014 Pavel Stemberk + * + * 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. + */ + +`define DUT_SDIO 27 +`include "microchip16.vh" +`ALL_WITHOUT_ZIF(microchip16sip6, 32'hDF05, 1) + + `ZIF_UNUSED(1) `ZIF_UNUSED(2) `ZIF_UNUSED(3) + `ZIF_UNUSED(4) `ZIF_UNUSED(5) `ZIF_UNUSED(6) + `ZIF_UNUSED(7) `ZIF_UNUSED(8) `ZIF_UNUSED(9) + `ZIF_UNUSED(10) `ZIF_UNUSED(11) `ZIF_UNUSED(12) + `ZIF_UNUSED(13) `ZIF_UNUSED(14) `ZIF_UNUSED(15) + `ZIF_UNUSED(16) `ZIF_UNUSED(17) `ZIF_UNUSED(18) + `ZIF_UNUSED(19) + `ZIF_UNUSED(20) + `ZIF_UNUSED(21) + `ZIF_UNUSED(22) + `ZIF_UNUSED(23) `ZIF_UNUSED(24) `ZIF_UNUSED(25) + bufif0(zif[26], dut_sci, low); /* SCI */ + bufif0(zif[27], dut_sdio_value, !dut_sdio_driven); /* SDO */ + bufif0(zif[28], low, low); /* GND */ + bufif0(zif[29], high, low); /* VCC */ + bufif0(zif[30], low, dut_vpp); /* VPP/Reset */ + `ZIF_UNUSED(31) `ZIF_UNUSED(32) `ZIF_UNUSED(33) + `ZIF_UNUSED(34) + `ZIF_UNUSED(35) `ZIF_UNUSED(36) `ZIF_UNUSED(37) + `ZIF_UNUSED(38) `ZIF_UNUSED(39) `ZIF_UNUSED(40) + `ZIF_UNUSED(41) `ZIF_UNUSED(42) `ZIF_UNUSED(43) + `ZIF_UNUSED(44) `ZIF_UNUSED(45) `ZIF_UNUSED(46) + `ZIF_UNUSED(47) `ZIF_UNUSED(48) +`BOTTOMHALF_END -- cgit v1.2.3