Menu

PIC16F18446 LVP mode

Joe
2021-02-02
2021-02-09
  • Joe

    Joe - 2021-02-02

    Hi,

    I recently built this programmer (v0.11.2) and compiled the op.exe (MinGW on Windows 7 64bit) with updates to enable LVP on the 12F1572 and 16F18446:
    (deviceRW.c)

    {"12F1572",
            PIC16,-1,1,Read16F1xxx,{0x800,0,12,2},0x200,Write16F1xxx,{0x800,0,2},0},
    
    {"16F18426,16F18446,16F18456,16F19156,16F19176,16F19186,16F19196",
            PIC16,-1,1,Read16F18xxx,{0x4000,1,0,2},0,Write16F18xxx,{0x4000,0x100,2},0},
    

    I was able to confirm read/writes work with LVP on 12F1572 but can't seem to get LVP on 16F18446 to read at all. The device ID, config words, etc.. all read as 0x0000. I confirmed the 16F18446 chip is functional with LVP enabled by borrowing a PICKit3 Programmer. Ideally I'd like to use the Open Programmer as the command line interface is much faster and customizable! Any ideas on what to check for? Have any 16F18xxx micros been confirmed to work with LVP?

     
  • Joe

    Joe - 2021-02-02

    I think I found the issue! The 16F184xx family requires the LVP entry code to be MSb -> LSb and 32 clocks not 33:
    progP16.c --Read16F18xxx()

        else{           //Low voltage programming
            bufferU[j++]=EN_VPP_VCC;
            bufferU[j++]=4;             //VPP
            bufferU[j++]=WAIT_T3;
            bufferU[j++]=TX16;          //0x4d434850 "MCHP"
            bufferU[j++]=2;
            bufferU[j++]=0x4D;          //4d 43 48 50, MSb->LSb
            bufferU[j++]=0x43;
            bufferU[j++]=0x48;
            bufferU[j++]=0x50;
            //bufferU[j++]=SET_CK_D;        //33rd Clock pulse not required
            //bufferU[j++]=0x4;
            //bufferU[j++]=SET_CK_D;
            //bufferU[j++]=0x0;
        }
    

    So far reads are working on the 16F18446 with LVP! Will check on the writes and report back...

     
  • Alberto Maccioni

    I guess you're the first one to use LVP.
    I only tried it long time ago and never bothered to keep it up to date.
    So thanks for trying and sharing, I will modify the code as you suggested.

     
  • Anonymous

    Anonymous - 2021-02-09

    Sounds good! I tested LVP writes also and they work with the same modification to Write16F18xxx(). Haven't tested the -ee option yet

     

Anonymous
Anonymous

Add attachments
Cancel