18F2431 won't program or erase.


Closed Thread
Results 1 to 25 of 25

Hybrid View

  1. #1
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default Reply from Microchip

    Hi All,

    just got the following reply from Microchip....

    Could you please try out the following when you receive the message:
    "Program Memory or EEPROM Data is protected. Reprogram the entire part. If Auto select memory areas and range on the Memory Ranges tab of the programmer settings
    is enabled, it must be disabled before proceeding.."

    Proceed to Programmer Menu -> Settings
    There deselect ( don't select) Auto Memory Areas and Range.
    Manually enter memory areas and range as follows:
    Program Memory Start Address : 0
    Program Memory End Address : 3fff
    Select Program Memory
    Select Configuration Bits
    Select ID Locations
    Select EEPROM Data
    Select Erase All Before Program

    Then try programming. Programming will take a while since the entire memory range is being programmed.

    In addition try out the following:
    Short the Vdd and AVdd pins of the microcontroller. Also separately short the Vss and AVss pins of the microcontroller. Now connect the capacitor between Vdd and Vss pins.
    Ensure that the capacitor that you're connecting between Vdd and Vss is a low ESR capacitor such as tantalum. Start with 0.1uF value and if programming failures still arise, try increasing this value incrementally to a maximum of 10uF.


    Will give that a try this evening to see if I get any success.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    I also used MPLAB 7.42 and PicStart 4.40.01 to make i work.

    But forget the ZIFF socket and place it on a board normally, load the PGM pin to gnd (via 1-10K resistor) and use ICSP... it will work.

    i had this reply from Microchip... but as it wasn't the solution i decided to not post it before.
    Quote Originally Posted by Microchip ticket answer... kindOf
    Thank you for contacting microchip's technical support.

    We suggest to make sure the following points to program the PIC18F2431 with picstart plus programmer:

    PIC18F8F2431which have power supply (Vdd and AVdd) and ground (Vss and AVss), all pins must be used in order to program.

    Devices require that a 0.1uF bypass capacitor be placed from the VDD pin to the VSS pin of the device to successfully program the device.
    If programming failures still arise, try increasing this value incrementally to a maximum of 10uF. A low ESR capacitor such as a tantalum

    Looking forward to your response.
    Woooohoooo! it's just weird that i didn't get the same answer as Keith.

    Anyways, ICSP work a treat.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default ICSP - How to

    Hi Steve,
    Could you perhaps explain how you do ICSP with the PicStart? Do you run wires from the ZIF socket or what? I've never done it myself and the other day I recieved some flyers from Microship in the mail, one of them had a table showing the various programmers features and according to that the PICStartPlus didn't support ICSP.

    If you would I'd appreciate a quick tutorial on how you do it, what pins, resistors etc? I don't think I'll use in place of a bootloader on the chips that supports it but on the smaller ones it would be great not to have to swap the chip back and forth between the circuit and the PicStart.

    Thank you in advance!
    /Henrik.

  4. #4
    Join Date
    Feb 2003
    Posts
    432


    Did you find this post helpful? Yes | No

    Default Success at last :)

    HOORAY !!!!!

    I have programmed all my 18F2431s and 18F4431s

    Here is my response to Microchip support.

    Thanks for the suggestions.

    I had already tried connecting AVdd to Vdd and AVss to Vss as I noticed that they had slightly different voltages on them (5.01 and 4.97) but that didnt make any difference.

    I attempted the "manual" method you suggested but didnt have the option of "Erase all before program" (MPLAB 7.30)

    I then upgraded to MPLAB 7.42 and still didnt have any luck with the 2431 so I went to the 4431. Again these failed to program. A blank check revealed that they werent blank and attempts to erase the devices failed. I removed the 2.2uF capacitor and successfully erased it. I then discovered that I could now program these WITHOUT needing the capacitor.

    I returned to the 2431 WITHOUT a capacitor but WITH a 1K resistor between pins 7 and 11 as that had been succesful for others on the PBP forum, SUCCESS

    It would appear that the root of my problem was MPLAB 7.30 as I couldnt program 4431s either. I do need the AVdd connection to program 2431s but since upgrading to MPLAB7.42 the problem seems to be sorted.

    Regards

    Keith


    Note to Steve: I too would appreciate a tutorial on ICSP with Picstart as it is something I have never tried. Having said that, all the PICs I use now have bootloaders but I think it would be a useful to know.
    Keith

    www.diyha.co.uk
    www.kat5.tv

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    OK, it's really easy.

    1. You need to read your datasheet to find those MCLR, PGD, PGC and Vss pins.

    2. place some jumper from the PICSTART ZIFF on the pins# you find and send them on the same pins on your PIC

    3. Once the PIC is programmed, just remove the wires.

    Not much. The only Extra hardware you have to add, is a 10k resistor+whatever diode on the MCLR pin. If the PGM pin of your PIC is already loaded with something it will work case not, just place a pull-down resistor on it. 10K work great

    well it's a variant of something like the following taken on the melabs website...
    <img src="http://melabs.com/images/icsp1.gif">

    Source and more explanation here

    in the past i did few adapter using some 40pins DIP socket. you make 1 of each different pic size (8,18,28,40, etc)

    Also handy to use something like...
    <img src="http://www.picbasic.co.uk/forum/attachment.php?attachmentid=163&d=1104851398">

    if you want to avoid this 'plug/deplug' dance.

    Have fun!
    Last edited by mister_e; - 28th September 2006 at 02:29.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  6. #6
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,624


    Did you find this post helpful? Yes | No

    Default Yes!!

    Keith,
    Glad to here it's finally working, great!!
    Let's see what the upcoming firmware does. Perhaps it will let us avoid the resistor. I think we can call this issue resolved, at last.

    Steve,
    Thanks a lot for the ICSP info, I will try it out next time I'm on a non-bootloader-able PIC.

    Thank you both!
    /Henrik Olsson.

Similar Threads

  1. Presetting Configuration Fuses (PIC Defines) into your Program
    By Melanie in forum FAQ - Frequently Asked Questions
    Replies: 82
    Last Post: - 15th December 2013, 10:54
  2. Replies: 1
    Last Post: - 23rd May 2009, 10:22
  3. Compile and Program help using PICKit2
    By ozarkshermit in forum mel PIC BASIC Pro
    Replies: 15
    Last Post: - 10th March 2009, 15:51
  4. Making Program Code Space your playground...
    By Melanie in forum Code Examples
    Replies: 15
    Last Post: - 19th July 2008, 09:26
  5. PIC16F684 Program question
    By Nicholas in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th December 2006, 15:30

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts