[<<][staapl][>>][..]
Sun Oct 5 10:12:16 CEST 2008

readMode()

A trace of the 'read' command for pk2 by Jeff Post simplified to PK2
v2.x and 18F1220 programming.

http://home.pacbell.net/theposts/picmicro/
http://home.pacbell.net/theposts/picmicro/pk2-3.00-alpha12.tar.gz


In pk2-3.00-alpha12/pk2main.c :

readMode()
  pickitGetDevice()
    readDeviceData1/2()
    pickitGetDevice2()
      findDeviceName2()
      SETVPP
  pickitRead()
    allocateDevice2Buffers();
    pickitReadProgram()
      pickitReadProgram()
        enableTargetPower()
        clearUploadBfr()
        (EXECUTE_SCRIPT (ProgEntryScript))
        setDownloadAdrs()
        while {
          clearUploadBfr()
          (EXECUTE_SCRIPT (ProgMemRdScript))
          readDataBlock()
        }
      pickitReadEeprom()
      pickitReadConfig()
  writeHexFile()



Some problems: UPLOAD_DATA_NOLEN doesn't seem to work in my
implementation, so I'm using UPLOAD_DATA.

Got config write to work too.. However, write protect can't be cleared
with just writing config data.  I think this requires a chip-erase.
OK, works now.

For program write, I move to the Microchip pk2cmd sources:
PICkitFunctions.cpp : WriteDevice

write-program-memory now finishes, but the pk2 hangs on the next
read-program-memory.

Wait.. Got something back!
After reset it does seem to work.

Let's try with uploaded script again.

That doesn't work, but without works fine.

Got the problem: the DOWNLOAD_SCRIPT function had tag 255, which
should be 254, but that doesn't work either.  Something fishy there:
it's not tested yet.




[Reply][About]
[<<][staapl][>>][..]