Menu

Problems with PIC18F46K22

Anonymous
2019-04-11
2019-04-24
  • Anonymous

    Anonymous - 2019-04-11

    Hello!

    I've built an OpenProg with a 3.3V adapter and tried to program PIC18F46K22. PIC is mounted on another PCB so I use ICSP connector. I've tried several times but always have 1 error during programming Flash and 1 error programming EEPROM. Programmed PIC doesn't work correctly - looks like executing prograam but with random glitches and bugs. If I flash my PIC with PicKit4 there's no problem, programming goes smoothly and apllication runs without bugs.

    What should I do?

     
  • Alberto Maccioni

    You need to be more precise.
    Save a log and the errors you see.

     
  • Anonymous

    Anonymous - 2019-04-15
    Programmer detected on 
    Programmer detected
    Firmware version 0.11.0
    Hardware ID: 0.0.1 (18F2550)
    
    /media/DATA/System_Komfort/MDK01_STR/dist/default/production/MDK01_STR.production.hex :
    
    ID:
    ID0: 0xFF   ID1: 0xFF
    ID2: 0xFF   ID3: 0xFF
    ID4: 0xFF   ID5: 0xFF
    ID6: 0xFF   ID7: 0xFF
    
    CONFIG:
    CONFIG1H: 0x68  CONFIG1L: 0xFF
    CONFIG2H: 0x1F  CONFIG2L: 0x1E
    CONFIG3H: 0x3F  CONFIG3L: 0xFF
    CONFIG4H: 0xFF  CONFIG4L: 0x85
    CONFIG5H: 0x80  CONFIG5L: 0x00
    CONFIG6H: 0x80  CONFIG6L: 0x00
    CONFIG7H: 0x40  CONFIG7L: 0x0F
    
    Code memory:
    0000: 5F EF 00 F0 FF FF FF FF D9 CF 21 F0 DA CF 22 F0 25 EF 6D F0 FF FF FF FF D8 CF 16 F0 E8 CF 17 F0 
    
    ...
    
    FFE0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 05 05 05 05 05 05 32 0A BF 63 BF 63 00 00 
    
    EEPROM memory:
    0000: 80 28 07 00 01 00 00 00 80 04 01 00 81 00 00 00  .(..............
    
    ...
    
    03F0: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00  ................
    
    Forcing config words
    CONFIG1H: 0x68  CONFIG1L: 0xFF
    CONFIG2H: 0x1F  CONFIG2L: 0x1E
    CONFIG3H: 0x3F  CONFIG3L: 0xFF
    CONFIG4H: 0xFF  CONFIG4L: 0x85
    CONFIG5H: 0x80  CONFIG5L: 0x00
    CONFIG6H: 0x80  CONFIG6L: 0x00
    CONFIG7H: 0x40  CONFIG7L: 0x0F
    Regulator up and running after 89ms VPP=11.9V
    
    Regulator up and running after 1048ms VPP=9.4V
    
    DevID: 0x5404
    18F46K22 rev4
    Erasing ... completed
    Writing code ... completed
    Writing EEPROM ... completed, 1 errors
    Verifying code ... completed, 1 errors
    Writing CONFIG ... completed
    Verifying CONFIG ... completed, 0 errors
    
    End (10.91 s) 1 error
    
     
  • Anonymous

    Anonymous - 2019-04-15

    I've lso tried to run op with -l option but don't know where logs are saved. Specifing location after -l doesn't work, log file is not saved.

     
  • Alberto Maccioni

    The location is where OP is started from. Otherwise you specify a file with -l=filename

     
  • Anonymous

    Anonymous - 2019-04-17

    Log file in the attachment.

     
  • Alberto Maccioni

    It took a while, but I finally found the problem; it's just a verification bug, there are no real errors in the log.
    EEPROM verification is done in the same write packet, and the current code is incorrectly parsing the result, because it gets fooled when the value written is equal to the instruction to be found.
    In line 18867 you see instruction 22 (SHIFT_TABLAT) being equal to the payload 22.
    Code @ progP18.c:1300 looks for the istruction code in reverse and instead finds the payload.
    I'll write a fix but for now you can ignore this error.
    As for the original problem, it's most likely due to a wrong configuration word.
    Try to read the device after programming it with the pickit: is there a difference in config words?

     

Anonymous
Anonymous

Add attachments
Cancel





Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.