can't reprogram 12F615


Closed Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2008
    Location
    Milwaukee, WI
    Posts
    37

    Default can't reprogram 12F615

    Hello,
    I having a heck of a time reprogramming a board with a 12F615 on it. The first program will download and verify just fine. After that, there are errors in different program memory locations:
    Address: 00000000 Expected Value: 00002851 Received Value: 00002810
    Programming failed

    I suspect that I need to use my pickit2 instead of my pickit3...but I've also tried an ICD2 and an ICD3. my pickit2 is back at home.

    I read through this: (the 2nd post)
    http://www.microchip.com/forums/m576596-print.aspx

    and then I set my icsp data and clock pins to be inputs instead of outputs - I'm not using them for anything else, there is nothing connected to them except the programming header. Also, I put in the pause command early in the program.

    I figured that had to be what was going on.. programmed a new chip with the modified code...but I still can't reprogram

    here is the program. I've got a thermistor voltage divider coming into GP2 and I've got GP4 controlling a fet acting as a low side switch. 10K pullup on MCLR, and the 5 pin programming header, and thats it.

    Code:
     @	__CONFIG _CP_OFF & _WDT_OFF & _BOR_OFF & _MCLRE_ON & _PWRTE_OFF & _INTRC_OSC_NOCLKOUT & _IOSCFS_4MHZ 
    
    'CLEARWDT						'picbasic will insert watchdog clears throughout the program
    
    '    Hardware configuration
    '    ======================
    PAUSE 1000
    
    DEFINE OSC 4					'tell picbasic how fast the clock is
    
    DEFINE ADC_BITS 10 				' Set number of bits in result (8, 10 or 12)
    DEFINE ADC_CLOCK 3 				' Set clock source (rc =3)
    DEFINE ADC_SAMPLEUS 50 			' Set sampling
    
    ADCON0 = %10001000				'RIGHT JUSTIFIED, VDD reference
    ANSEL  = %00000100				'GP2 is analog
    
    
    
    GPIO = 0						'pins are set low, BEFORE assigning output pins to be outputs
    
    TRISIO.0= 1   '0 = output		'GPIO.0 = PIN7	(icsp DATA)
    TRISIO.1= 1						'GPIO.1 = PIN6  (ICSP CLOCK)
    TRISIO.2= 1              		'GPIO.2 = PIN5   analog input
    TRISIO.3= 1   'GP3 = input only	'GPIO.3 = PIN4
    TRISIO.4= 0                 	'GPIO.4 = PIN3  
    TRISIO.5= 0                   	'GPIO.5 = PIN2  
    	
    
    
    POWERSWITCH VAR GPIO.4
    
    TESTLED VAR GPIO.5
    
    ADvalue VAR WORD
    
    
    Main:
    
    ADCIN 2, ADvalue
    
    IF ADvalue > 275 THEN
    
    	POWERSWITCH = 0
    	pause 200
    
    	POWERSWITCH = 1
    	pause 75
    
    ELSE
    
    	POWERSWITCH = 1
    
    ENDIF
    
    goto Main						'loop back up to main
        
    END
    Last edited by Max Power; - 29th March 2013 at 18:57. Reason: code brackets

  2. #2
    Join Date
    Jun 2008
    Location
    Milwaukee, WI
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: can't reprogram 12F615

    pic is running at 3.3V

    using PBP 2.6C (I know..upgrade!) inside MPlab8.7

  3. #3
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: can't reprogram 12F615

    Are you erasing the chip before re-programming?
    Dave
    Always wear safety glasses while programming.

  4. #4
    Join Date
    Jun 2008
    Location
    Milwaukee, WI
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: can't reprogram 12F615

    I hit erase, and it says

    Erasing...
    Erase device complete

    but then I fail a blank check

  5. #5
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: can't reprogram 12F615

    I think Max Power has a Min Power problem.

    The 12F615 requires a minimum of 4.5V to do a "Bulk Erase".

    melabs programmers have a "Low Voltage Erase" option that can "Row Erase" at lower voltages.
    I'm not sure if you can do that with Microchip programmers.

    If possible, power your circuit with 5V during programming.

    The problem you thought you were having with ICSP pins in output mode only affects chips with MCLR disabled. You have MCLR enabled.
    Last edited by Darrel Taylor; - 29th March 2013 at 21:12.
    DT

  6. #6
    Join Date
    Jun 2008
    Location
    Milwaukee, WI
    Posts
    37


    Did you find this post helpful? Yes | No

    Default Re: can't reprogram 12F615

    Awesome. I think that was it. This board has a 3.3V switching power supply running the micro. I also have a 4.7V zener on the power supply output because I have seen some pretty wicked spikes at startup. I set the pickit3 to power the micro at 4.625V, with the main power disconnected and....
    Programming...
    Programming/Verify complete

    Thanks for your help.. and happy easter!.. I know I will be much happier not having to worry about this anymore!

Similar Threads

  1. SERIN and PWM on 12f615
    By jowan512 in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 21st November 2011, 13:15
  2. configuring AD converter in a 12F615
    By tekart in forum mel PIC BASIC Pro
    Replies: 19
    Last Post: - 1st June 2011, 03:38
  3. 12F615 and PBP
    By Meriachee in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 8th April 2011, 06:19
  4. How to reprogram the OSC cal. 12F675
    By rtsandiego in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st April 2010, 23:27
  5. 12F675 won't reprogram or erase
    By modifyit in forum mel PIC BASIC Pro
    Replies: 16
    Last Post: - 19th May 2006, 05:07

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