Tuesday, December 15, 2015

dsPIC33EP256MC202 - PICkit2

family ID: 5
search Priority: 2
using example from dsPIC33FJ256MC510,  dsPIC33FJ256MC710, dsPIC33FJ128MC202

family ID: 1
search Priority: 0
using example from PIC24FJ64GB002

test get DeviceID

delay long: 5.46ms
delay short: 21.3us

dsPIC33EP256MC202
   TBLPAG: 0x54
   VISI: 0x0F88, VISI>>1:0x07C4
        MOV W0, TBLPAG, 8802A0
        MOV W0, VISI          887C40
        MOV #VISI, W7        20F887

  double word write cycle time: 346 FRC cycles, 54.4us ~ 60us

dsPIC33F
   TBLPAG: 0x32
   VISI: 0x0784, VISI>>1:0x03C2
        MOV W0, TBLPAG, 880190
        MOV W0, VISI,         883C20
        MOV #VISI, W7        207847

    row(64 instructions) programming time: 1.28 ms

<ICSP>
enter ICSP (OK)

get DeviceID (OK)

disable PE33 in PICkit2.ini

adjust DialogConfigEdit.cs (OK)

create simple LED blinking app running with internal oscillator. (OK)

update Script
   ScriptLength cannot be greater than 61
   [#ChipEraseScript]
   [#ConfigRdScript]   <--- need to change to byte
   [#UserIDRdScript]  <--- need to change byte to word

   [#ProgMemAddrSetScript]
        MOV ADDR_L, W6
        MOV.B ADDR_H, W0
        MOV W0, TBLPAG
        MOV #VISI,W7

   [#ProgMemRdScript]
        TBLRDL [W6],[W7]
        TBLRDH [W6++],[W7]

===========
   [#ProgMemWrPrepScript]
        MOV #0x4001, W10     //word write
        MOV W10, NVMCON
        MOV ADDR_L, W7
        MOV.B ADDR_H, W0
        MOV W0, TBLPAG

   [#ProgMemWrScript]
   [#ConfigWrScript]
   [#UserIDWrScript]

test erase script(should be OK)

test programming script(OK)
   add script buffer location (number): PROGMEM_WR2 = 30;  // not required

test configure write script (OK)

test userid write script(Pending)

add device family dsPIC33EP  FamilyID:18, FamilyType:18, SearchPriority:3 (OK)

enable PE33 in PICkit2.ini (as default)
---
load PE executive (OK)

<Enhanced ICSP>

PE: A delay of 25 ms is required between commands.

PE_DownloadAndConnect(OK)
PE_Connect (OK)
PE_Read(OK)
      add a dealy_short(1) between read_byte and read_byte_buffer
PE_BlankCheck(OK)
      PE bug: Expected Reponse[0] should be 0x1E, but returned 0x1A
PE_Write(OK) might have problem with the last block(32 instructions) with the Configuration Bits
PE_Verify(OK)

Export the script(OK)

Add CRC check (WIP)

Apply Object Oriented Design...



[get device ID script]
 $COREINST24 00 02 04  //goto 0x200
 $COREINST24 00 02 04
 $NOP24
 $NOP24
 $NOP24
 $COREINST24 00 02 04
 $NOP24
 $COREINST24 F0 0F 20  //mov 0xff, w0
 $COREINST24 90 01 88  //mov w0, tblpag
 $COREINST24 06 00 20  //mov 0x0000, w6
 $NOP24
 $NOP24
 $COREINST24 07 00 20  //mov 0x0000, w7
 $COREINST24 B6 0B BA  //mov [w6++], [w7] == mov [w6++],w0
 $NOP24
 $NOP24
 $COREINST24 20 3C 88  //mov w0, visi
 $NOP24
 $VISI24
 $NOP24
 $LOOP 0D 01

No comments:

Post a Comment