can't reprogram 12F615


Results 1 to 6 of 6

Threaded View

  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

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 : 0

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