• AVR Freaks

C30 BUG or PIC24FJ192GA106 Silicon BUG?!?!?!

Author
paofer
New Member
  • Total Posts : 26
  • Reward points : 0
  • Joined: 2007/01/29 08:10:31
  • Location: 0
  • Status: offline
2008/08/25 13:30:28 (permalink)
0

C30 BUG or PIC24FJ192GA106 Silicon BUG?!?!?!

Hi all,
after a week of weasted time and a PIC24, an 8MHz Quartz and an ICD2 RJ45 cable repleaced I finally found the cause of verify and debug errors:
 
ICD0161: Verify failed (MemType = Program, Address = 0x1400, Expected Val = 0xFFFFFF, Val Read = 0xF30000)
ICD0275:  Programming failed.
 
ICD0083: Debug:  Unable to enter debug mode.  Please double click this message for more information.
ICD0082: Failed MPLAB ICD 2 operation
ICD0069: Debug:  Unable to run target
 
I know, I know it's incredible but you have to trust me: this error is caused by the firmware .
But now I start from the begin.......
I'm trying to implement the AN1095 (Emulating Data EEPROM....bla bla bla) in my project to store some parameter in the Program Memory, so as soon as I use the function DataEEInit() it's impossible to program and/or debug the firmware.
Ivestigating in the function code I found the bastard instruction!!!!!
 
NVMCON = PROGRAM_WORD;  // C Code

mov.w #0x4003,0x0000  // Compiled ASM Code
mov.w 0x0000,0x0760

If I comment (//) this instruction I can normally program and debug (I'm not shure but I think the code doesn't work without this instruction, I didn't try)
 
There any body of you that experimented the same problem using the NVMCON instruction?
Again, there is anibody of you that implement the function DataEEInit() successfully in his project?
 
Please, let me know if there is any kind of workaround or any other suggestion.
Thanks in advance
 
Oh, I forgot: I'm using MPLAB v8.14 and C30 v3.11
 
 
#1

5 Replies Related Threads

    paofer
    New Member
    • Total Posts : 26
    • Reward points : 0
    • Joined: 2007/01/29 08:10:31
    • Location: 0
    • Status: offline
    RE: C30 BUG or PIC24FJ192GA106 Silicon BUG?!?!?! 2008/08/25 14:50:38 (permalink)
    0
    I discover another thing: I repleaced the instruction
     
    NVMCON = PROGRAM_WORD;
     
    with

    __asm__ ("mov.w #0x4003,w0");
    __asm__ ("mov.w w0,0x0760");

    and the problem still remain, then I comment the first assembler instruction and the problem still remain, in the end I comment only the second assembler instruction and.....
     
    __asm__ ("mov.w #0x4003,w0");
    //__asm__ ("mov.w w0,0x0760");
     
    .....surprise......the problem disappear, so I can conclude that the killer instruction is:
     
    mov.w w0,0x0760
     
    I also tryied to use the WREG1:
     
    __asm__ ("mov.w #0x4003,w1");
    __asm__ ("mov.w w1,0x0760");
     
    but it didn't solve the problem......
    some hints or suggestion? I need to close the project, then I have to find the way to store parameters in program memory.
    Thanks
     

     

     
     
    #2
    flubydust
    Super Member
    • Total Posts : 1286
    • Reward points : 0
    • Joined: 2005/05/19 13:44:42
    • Status: offline
    RE: C30 BUG or PIC24FJ192GA106 Silicon BUG?!?!?! 2008/08/25 15:28:42 (permalink)
    0
    ORIGINAL: paoferafter a week of weasted time and a PIC24, an 8MHz Quartz and an ICD2 RJ45 cable repleaced I finally found the cause of verify and debug errors:


    Reading the ICD2 release notes supplied with MPLAB would have saved you a lot of time.
    #3
    paofer
    New Member
    • Total Posts : 26
    • Reward points : 0
    • Joined: 2007/01/29 08:10:31
    • Location: 0
    • Status: offline
    RE: C30 BUG or PIC24FJ192GA106 Silicon BUG?!?!?! 2008/08/25 16:12:54 (permalink)
    0
    Are you talking about this:
    "Code Example CE020 for 16-bit controllers: During the programming sequence, PIC24F devices may be put into a run condition using MPLAB ICD 2. This can result in a verification failure if the code performs self write to either program memory or Data EE."?
    Is there a workaround?
     
    #4
    paofer
    New Member
    • Total Posts : 26
    • Reward points : 0
    • Joined: 2007/01/29 08:10:31
    • Location: 0
    • Status: offline
    RE: C30 BUG or PIC24FJ192GA106 Silicon BUG?!?!?! 2008/08/25 16:48:57 (permalink)
    0
    I think you refer to:
     
    "For PIC24F devices during a programming/verify operation (or subsequent verification operation) of user code that performs self-writes and/or self-erases to program space, a verify sequence may fail if the code execution occurs within the first execution cycles following reset.
    Workaround: Place a delay in your code before the code section that performs the self-write and/or self-erase.
    The specific delay value may need to be adjusted, but 100 ms would be a conservative value to start
    out with....."
     
    Then the solution is adding a delay at begin of main:
     
    int main (void)
    {
          __delay32(3200000); //Delay about 100ms
          ....
    }
     
    NO COMMENT!!!!!!!!!!!!!![:'(]
     
    #5
    hong0001
    New Member
    • Total Posts : 17
    • Reward points : 0
    • Joined: 2008/09/25 02:57:11
    • Location: 0
    • Status: offline
    RE: C30 BUG or PIC24FJ192GA106 Silicon BUG?!?!?! 2010/11/07 12:45:04 (permalink)
    0
    I have encountered the same problem, and it is solved by adding a delay before calling DataEEInit(), as the following

         __delay32(3200000); //Delay about 100ms
         DataEEInit();


    Thanks
    #6
    Jump to:
    © 2019 APG vNext Commercial Version 4.5