Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

PIC12F675 ..won't program with Pickit2 and MPLAB X IDE

Status
Not open for further replies.
T

treez

Guest
Hello,
Do you know why my Pickit2 will not program the PIC12F675 that I have in-circuit? I get the following error message from MPLAB X....

BUILD SUCCESSFUL (total time: 344ms)
Loading code from C:/MPASM/LED Flasher.X/dist/default/production/LED_Flasher.X.production.hex...
Loading completed
Connecting to programmer...
The programmer could not be started: Could not connect to tool hardware: PICkit2PlatformTool, com.microchip.mplab.mdbcore.pickit2.PICkit2DbgToolManager


The Pickit2 application tells me that "Pickit2 found and connected"

Also, when I run the program, it doesn't work, even though the pickit2 application tells me "programming successful"

I am using MPLAB X IDE V2.10 and the pickit2 software is v2.55.02

By the way, here is the MPASM code....it simply flashes a led on and off until a pushbutton switch is pressed....if the switch is pressed again it goes back to flashing the led, etc etc...


list p=12f675 ;list directive to define processor
#include <p12f675.inc> ;processor specific definitions
__config (_INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_OFF & _MCLRE_OFF & _CP_OFF & _BODEN_OFF & _CPD_OFF)


; define variables (general memory starts at 0x20)
count equ 20h ; number of millisecond delays
count1 equ 21h ; number of NOP delays
press equ 22h ;Holds flag telling whether or not pressed


; *** DECLARE MACRO'S ***
BANK0 macro
bcf STATUS,RP0
endm

BANK1 macro
bsf STATUS,RP0
endm
;************************

org 0
goto Start

Start:

BANK1
CLRF ANSEL ;Digital I/O

movlw 28h ;GP5=switch;GP4=LED
movwf TRISIO

bcf VRCON,VREN ;disable comparator ref

BANK0
;Disable interrupts as i don't want to use them
bcf INTCON,GIE
bcf PIR1,ADIF

CLRF GPIO ;Init GPIO
MOVLW 07h ;Set GP<2:0> to
MOVWF CMCON ;digital IO

clrf count
clrf count1
clrf press

;**************************
led_off:
call delay
call delay
bcf GPIO,GP4
led_off_1:
btfss GPIO,GP5
goto flash
goto led_off_1
;**************************


;**************************
flash:
call delay
call delay
call delay
flash_1:
;Flash the LED ON and OFF
bsf GPIO, GP4
call delay_flash
bcf GPIO, GP4
call delay_flash
goto flash_1
;**************************


;*****************************
delay_flash:
movlw 0xFF
movwf count
here:
movlw 0xFF
movwf count1

here1:
btfss GPIO,GP5
goto led_off
decfsz count1,1
goto here1

decfsz count,1
goto here
retlw 0x00
;******************************


;******************************
delay:
movlw 0xFF
movwf count
there:
movlw 0xFF
movwf count1

there1:
decfsz count1,1
goto here1

decfsz count,1
goto here
retlw 0x00
;******************************
end;
 

use the release mode instead of debug mode when you program the pic ?
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
thanks, though in 'MPLAB X' there is no release or debug mode, as I remember it, that was in the old MPLAB
 

MPLAB and MPLABX use different device drivers
have you used the MPLAB driver switcher to check that the Pickit2 is set up for MPLAB X?
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
I am sure MPLAB X can handle the pic12f675, because when I set up the project, it offered me to pick the pic12f675 as an option, which I did.

I must admit I didn't download the pickit2 device firmware from the following download page...I wonder if I have to do that?
**broken link removed**
..the device firmware is a hex file, but I don't know what to do with it, or even of I should do anything with it.?
 

there appears to be problems with Pickit2 and MPLABX

if you do a web search for mplabx and pickit2 it will give plenty of links in particular on the Microchip forums
 
  • Like
Reactions: treez

    T

    Points: 2
    Helpful Answer Positive Rating
thanks, ok, I have been thrown off by an error message in MPLAB X......I have gotten it to work now.....at least with a simpler led flash program.......goodness knows why MPLABX reports that it cant find the pickit2
Sorry for your time......thankyou for your help
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top