• AVR Freaks

Add pic16F18855 in PicKit2DeviceFile

Author
an80
New Member
  • Total Posts : 2
  • Reward points : 0
  • Joined: 2017/08/20 02:56:03
  • Location: 0
  • Status: offline
2017/08/23 12:39:13 (permalink)
0

Add pic16F18855 in PicKit2DeviceFile

Hi everybody,
I have to add pic16F18855 to PK2DeviceFile.dat for pickit2.

This is one of the Script, but not works. Please help.
 
 
Name MR_Rd_ID (MR_CfgWrScript) - load configuration
Script 310
Device PIC16F18855
   
ScriptIndex   Commands and operands   Coments
   0                0xAAEE                            WRITE_BITS_LITERALS
   1                0xBB08                            N = 8 Command = 80 (Load address)
   2                0xBB80                            LITERAL = 80 PC = 0x8000
   3                0xAAF1                            WRITE_BYTE_BUFFER
   4                0xAAF1                            WRITE_BYTE_BUFFER
   5                0xAAEE                            WRITE_BITS_LITERALS
   6                0xBB08                            N = 8 Command = F8 (INCREMENT ADDRESS)
   7                0xBBF8                            LITERAL = F8 PC = 0x8001
   8                0xAAE9                            LOOP
   9                0xBB03                            IndexOffset =3 Back 3 bytes, just to Script_Index = 5
   10               0xBB06                            LoopIteration = 6 during 6 iterations (PC = 0x8007 at the end of iterations)
   11               0xAAEE                            WRITE_BITS_LITERALS
   12               0xBB08                            N = 8 Command = E0 (BEGIN PROGRAMMING)
   13               0xBBE0                            LITERAL = E0 PC = 0x8007
   14               0xAAE7                            DELAY_SHORT 21.3us x 255 = 5.4ms
   15               0x00FF                            LENGTH_OF_DELAY = 0xFF (255)
   16               0xAAEE                            WRITE_BITS_LITERALS
   17               0xBB08                            N = 8 Command = 00 (LOAD DATA FOR NVM, PC = 8007)
   18               0xBB00                            LITERAL = 00h
   19               0xAAF1                            WRITE_BYTE_BUFFER Config1
   20               0xAAF1                            WRITE_BYTE_BUFFER Config1
   21               0xAAEE                            WRITE_BITS_LITERALS
   22               0xBB08                            N = 8 Command = E0 (BEGIN PROGRAMMING)
   23               0xBBE0                            LITERAL = E0
   24               0xAAE7                            DELAY_SHORT 21.3us x 255 = 5.4ms
   25               0x00FF                            LENGTH_OF_DELAY = 0xFF (255)
   26               0xAAEE                            WRITE_BITS_LITERALS
   27               0xBB08                            N = 8 Command = F8 (INCREMENT ADDRESS)
   28               0xBBF8                            LITERAL = F8h   PC = PC + 1
   29               0xAAE9                            LOOP
   30               0xBB1D                            IndexOffset = 13 Back, just to Script_Index = 16
   31               0xBB06                            LoopIteration = 4 (PC = 0x800B at the end of iteration)
#1

3 Replies Related Threads

    scasis
    Super Member
    • Total Posts : 121
    • Reward points : 0
    • Joined: 2011/01/07 01:18:59
    • Location: 0
    • Status: offline
    Re: Add pic16F18855 in PicKit2DeviceFile 2017/08/23 23:12:44 (permalink)
    4 (1)
    Hi,
    the PIC16F1885x family uses an SPI based programming method with 24 bit payload and an MSB first shifting. See figure 3-6 in the programming specication DS40001753.
    #2
    an80
    New Member
    • Total Posts : 2
    • Reward points : 0
    • Joined: 2017/08/20 02:56:03
    • Location: 0
    • Status: offline
    Re: Add pic16F18855 in PicKit2DeviceFile 2017/08/24 11:17:41 (permalink)
    0
    Hi, I don't understand haw to do it.
    #3
    scasis
    Super Member
    • Total Posts : 121
    • Reward points : 0
    • Joined: 2011/01/07 01:18:59
    • Location: 0
    • Status: offline
    Re: Add pic16F18855 in PicKit2DeviceFile 2017/08/24 23:00:19 (permalink)
    3 (1)
    Hi,
    Let see the Name MR_Rd_ID (MR_CfgWrScript) - load configuration script.
    We are about to use the load PC address command. The WRITE_BITS_LITERALS and WRITE_BYTE_LITERALS commands shift out the LSB first, so the reversed 0x80 has to be shifted out first.
    WRITE_BYTE_LITERALS
    0x01
    The 24 bit payload has to be shifted next. The load PC address requires the address with a 0 bit in the LSB of payload. He address to send is 0x8000 for configuration area.
    Tree bytes to shift out is the bit reversed of 0x010000.
    WRITE_BYTE_LITERALS
    0x80
    WRITE_BYTE_LITERALS
    0x00
    WRITE_BYTE_LITERALS
    0x00
     
    And so on. Every data for load PC address, Load data for NVM (PFM), Load data for NVM (DFM) has to be shifted 1 bit left and then bit reversed for 24 bit. The command code has to be a byte bit reversed. 
     
    This bit reversal can be made only modifying the PC application or changing the firmware of PICKit2.
    post edited by scasis - 2017/08/24 23:01:51
    #4
    Jump to:
    © 2019 APG vNext Commercial Version 4.5