Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

PICKit2 Vpp Low Voltage issue...

Status
Not open for further replies.
thanks everyone for the fast replies (apologies for not being as reliable) been very busy with work. the pickit is not a clone as i bought it from rapid and it looks identicle to the image shown. I gave up with it (as i had a tight deadline, will return to it after this project is completed) and bought what i thought would be an easier solution from ebay (but i am having more issues with this)... i load the hex file to the software 'MicroBrn' and it successfully writes to the PIC (I know it is successful because i am able to read the code from the pic afterwards), however when i put the pic into the circuits nothing happens at all. The code i am using is very basic (though at the moment i feel stupid enough to get flashing an led wrong).

LIST P=16F628
#include "P16F628.INC"
__config _INTRC_OSC_NOCLKOUT & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON

;----------------------------
CBLOCK 0X20
Loop1,Loop2,Loop3,Loop4 ;Loop4 = potential to extend delay timing
ENDC
;----------------------------
;Initialise
;----------------------------
ORG 0X00
GOTO START
CLRF PORTA ; Initialize port A
CLRF PORTB ; Initialize port B

BSF STATUS,RP0 ; RAM bank 1

CLRF TRISA ; All pins port A output
CLRF TRISB ; All pins port B output
BCF STATUS,RP0 ; RAM bank 0
;-----------------------------
MOVLW 7
MOVWF CMCON ; Comparators off, all pins digital I/O

;-----------------------------
;Main Loop
;-----------------------------
START

BSF PORTA,1
BSF PORTA,2
BSF PORTA,3
CALL delay
BCF PORTA,1
BCF PORTA,2
BCF PORTA,3
GOTO START


;------------------------------
;DELAY
;------------------------------
delay
MOVLW 250
MOVWF Loop1
Outer MOVLW 200
MOVWF Loop2
Inner NOP
NOP
DECFSZ Loop2,F
GOTO Inner ; Inner loop = 5 usec.
DECFSZ Loop1,F
GOTO Outer
RETURN
END

here is an example of the code i am using and:View attachment 65659 is the programmer (DIY K149-BC) but i have a feeling it may be a copy.
 
the photo you had shown ialong with soucrce code is definitely a CLONE. The only way is power it from a buffered usb EXTENSION connector, where the powewr supply (5V) can be externally supplied.
 
Last edited:
the photo you had shown ialong with soucrce code is definitely a CLONE. The only way is power it from a buffered usb connector, where the powewr supply (5V) can be externally supplied. EVEN THE ORIGINAL CIRCUIT HAD LOTS OF LOAD. 3 LEDS WITH SERIES RESISTOR OF 470 OHMS EACH WERE CHANGED TO 1k EACH.
 
hi sarma, i realised after reading the DIY website that the chip was a clone. What i dont get though is how the programme can be written to the pic but still not function. It must work to some extent as it seems to be succesfuly sold on ebay and mass produced from china (meaning people actually use it). I have emailed the chinese company that supplied it (https://www.nbglin.com/) to enquire about my issue (however i am not expecting an answer anytime soon.

were can i find a buffered usb? and dont usb's carry 5v as standard? the device uses a usb2 currently so i will have to look for a buffered usb2 device. (why is it always a power problem... :(
 
you could write garbage to MCU and read it back, that still does not make it working program.
one common problem for example is incorrect oscillator configuration so MCU never starts.
 
so the problem may potentially lie in the configuration bits... interesting. that would be a good thing and imply that i not the hardware was at fault (meaning i could rectify this and not have to consider purchasing another device). Thank you panic mode. I will look into what configurations may cause a chip to not function even though it appears to be programmed successfully.

I did suspect the device was maybe not converting the hex file properly and writing 'garbage' to the pic. In which case what i would read back is garbage but assume it was correct.
 
yep, check if your selection matches what is actually connected to pic (HS, RC, whatever...).
you may try to find some complete project that uses your chip and few external components (there must be gazillion "hello world" programs that just flash LED) and same frequency crystal or just RC oscillator. get their HEX file and burn it, breadboard it and see if that runs. once you see that something works, you have reached major milestone. for example if you are using PIC16F628, this would be perfect test:
https://www.oz1bxm.dk/PIC/628LED.htm

the nice thing is that most of the work is already done, you have there HEX file to burn into PIC, you just need few parts to hookup and see it work.
if that works, you know your programmer and pic are ok. then you can try to compile the source code from that link and make your own hex file. if that also works, start making some adjustments like different flashing speed etc.
 
Last edited:
hi panic mode, resolved it. The problem was in the code, it was spotted and fixed by 'HAYOTO' along with other issues i had. The issue was that i had not initialized the mcu and ran strait to 'start'


ORG 0X00
GOTO START
CLRF PORTA ; Initialize port A
CLRF PORTB ; Initialize port B

instead of:

ORG 0X00
GOTO INIT
ORG 0x0A
INIT
CLRF PORTA ; Initialize port A
CLRF PORTB ; Initialize port B

BSF STATUS,RP0 ; RAM bank 1

CLRF TRISA ; All pins port A output
CLRF TRISB ; All pins port B output
BCF STATUS,RP0 ; RAM bank 0

this solution enabled the correct led's to come on. (meaning the programmer works perfectly). But why it didnt work when i used other peoples test code confuses me. I also set the config bits to:
__config _INTRC_OSC_NOCLKOUT & _LVP_OFF & _WDT_OFF & _PWRTE_ON & _BODEN_ON & _MCLRE_OFF

turning the mclr off.

AGAIN thank you all for all your help (this is probably the best forum i have ever been on in terms of community and responses).
 
It is nice to note that your programmer worked. there are some cautions like 'not to update firmaware etc, on the manufacturer's site

https://www.nbglin.com/usba.htm

thus beware of their notice. better to foloow the user guide provided by them.
 
Hello
İ think your problem in the enable pin pin 1 make sure you are not connect any voltage with this pin when you use pickit2
 
Status
Not open for further replies.

New Articles From Microcontroller Tips

Back
Top