• AVR Freaks

ICD4 will not program PIC if memory preserved.

Author
Geoff
Starting Member
  • Total Posts : 50
  • Reward points : 0
  • Joined: 2011/05/07 19:05:12
  • Location: Melbourne Australia
  • Status: offline
2018/11/03 20:13:18 (permalink)
0

ICD4 will not program PIC if memory preserved.

MPLABX v5.05
PIC16F15313
MPasm v5.81
The ICD4 will program the PIC ok when no memory is preserved. See (a) and (b).
 
When I attempt to program with some memory preserved, it fails to program. See (c) and (d). The ICD4 clicks at the start then clicks again after it gets to the Device ID Revision line and stops. Any clues?
 
The reason for preserving the memory is to store long term data.
 

Attached Image(s)

#1

6 Replies Related Threads

    MBedder
    Circuit breaker
    • Total Posts : 6800
    • Reward points : 0
    • Joined: 2008/05/30 11:24:01
    • Location: Zelenograd, Russia
    • Status: offline
    Re: ICD4 will not program PIC if memory preserved. 2018/11/04 01:57:58 (permalink)
    0
    Shouldn't the "Program memory" range to be 0-6FF since you want to preserve the 700 to 7FF?
    #2
    Geoff
    Starting Member
    • Total Posts : 50
    • Reward points : 0
    • Joined: 2011/05/07 19:05:12
    • Location: Melbourne Australia
    • Status: offline
    Re: ICD4 will not program PIC if memory preserved. 2018/11/04 02:07:46 (permalink)
    0
    Thanks MBedder. I tried this but get the following message:
    The range(s) of program memory to be preserved. Each range must be two hex numbers, representing the start and end addresses of the range, separated by a dash. Ranges must be separated by a comma (e.g. 0-ff, 200-2ff). Areas are reserved by reading them into MPLAB and then programming them back down when a program operation occurs. Thus the preserved areas must lie within a memory range that will be programmed. Ranges must be aligned on a 0x20 address boundary.
    #3
    du00000001
    Just Some Member
    • Total Posts : 3184
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: ICD4 will not program PIC if memory preserved. 2018/11/04 03:13:27 (permalink)
    0
    When in "Let ICD4 select ..." mode, the option to preserve memory seems to be available as well. Did you already try this?

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #4
    Geoff
    Starting Member
    • Total Posts : 50
    • Reward points : 0
    • Joined: 2011/05/07 19:05:12
    • Location: Melbourne Australia
    • Status: offline
    Re: ICD4 will not program PIC if memory preserved. 2018/11/04 14:00:58 (permalink)
    0
    The problem appears to be that if there are software breakpoints set while programming a debug program the  verifying fails. With no breakpoints set it will program ok.
    #5
    du00000001
    Just Some Member
    • Total Posts : 3184
    • Reward points : 0
    • Joined: 2016/05/03 13:52:42
    • Location: Germany
    • Status: offline
    Re: ICD4 will not program PIC if memory preserved. 2018/11/04 14:40:51 (permalink)
    0
    Now tell me the software breakpoint was in the reserved memory section  :)

    PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
    #6
    DevMod1
    Administrator
    • Total Posts : 472
    • Reward points : 0
    • Joined: 2009/02/10 09:34:30
    • Location: 0
    • Status: offline
    Re: ICD4 will not program PIC if memory preserved. 2018/11/06 09:23:51 (permalink)
    0
    Software breakpoints require that the code be modified to add the software breakpoint opcode, it is then replaced with the original to execute after the breakpoint is reached and then reprogrammed with the SWBP opcode.
     
    You can't have a SWBP in reserved memory as the IDE does not change that since you requested it to be reserved.

    _____________________________

    Please read the forum posting guidelines. Do not double post, please help keep these forums professional and comments respectful.
    Please notify the moderators of problems/spam/trolls.
    #7
    Jump to:
    © 2019 APG vNext Commercial Version 4.5