12F683 Chips

Thread Starter

Robert Webb

Joined Dec 20, 2014
18
Hi
I am attempting to program some 12F683 chips with a PICkit2 programmer. The program compiles normally and the system tells me the programming was successful but there is no program on the chip. The only conclusion that I can come to is that the chips I am using are compromised in some way and I have just sent for some more. Does anybody have any suggestions.
regards
Bob
 

tshuck

Joined Oct 18, 2012
3,534
What makes you say they're not programming. Part of the programming process is checking the program after it's written.

What are your configuration bits?

Do you have a MCLR pullup?

Schematic?
 

Thread Starter

Robert Webb

Joined Dec 20, 2014
18
The program is for a two second pulse and I test the newly programmed chip by installing it in the switch which performs normally with a previously programmed 12f683. What I am attempting to do is to refine the timing of the output measured by an LED. When I replace the chip with the newly programmed chip, there is no activity.
I am following the normal, or what I think is the normal PICkit system using microcode studio. I modify the program, save it, import the HEX file and write it. All of the indicators during the process are normal and the final message is Programming Successful. But when I instal the chip in the switch, there is nothing. What am I not understanding?
Bob
 

tshuck

Joined Oct 18, 2012
3,534
So it is not the same *.hex that was used before? No? Then you seem to have made a mistake in your program...

What is your code and configuration bits?
 

Thread Starter

Robert Webb

Joined Dec 20, 2014
18
Thanks, all I am doing is changing some values i.e at 16 to 15. When I returned to the original values the problem persisted. Normally if there is a problem with the program will not compile but you have given me food for thought so I will go back to square one and try again.
'* Name : UNTITLED.BAS *
'* Author : [Bob Webb *
'* Notice : Copyright (c) 2014 [select VIEW...EDITOR OPTIONS] *
'* : All Rights Reserved *
'* Date : 23/07/2014 *
'* Version : 1.0 *
'* Notes : *
'* : *
'****************************************************************
#CONFIG
__config _FOSC_LP&_WDT_OFF&_CP_OFF&_FCMEN_OFF
#ENDCONFIG

ANSEL = 0
CMCON0 = 7

main:

high GPIO.0
PAUSE 2
LOW GPIO.0

pause 15


PAUSEUS 382

GOTO MAIN
Bob.
 

absf

Joined Dec 29, 2010
1,968
The 12F683 has an internal 8 MHz crystal which can be config as 8, 4,2,1 MHz and 500,250, 125 KHz and also 32 KHz. Using external crystal, it can use max 20MHz. Since you config as FOSC_LP, I guess you're using 32 KHz internal oscillator.

Or else the PAUSE 2 and PAUSE 15, doesnt make sense if you're running 4 MHz. The 2 and 15 mS would be too fast for your eye to notice any changes.

I use Pic Basic Pro to compile your program and simulate on proteus and it works. If I comment off

Code:
'#CONFIG
'__config _FOSC_LP&_WDT_OFF&_CP_OFF&_FCMEN_OFF
'#ENDCONFIG
12F683 TEST.PNG

Allen
 
Last edited:

jjw

Joined Dec 24, 2013
823
Internal oscillator for 12F683 can be from 125KHz to 8MHz.
LP is 32KHz crystal oscillator.
The compiler should be told which frequency the 12F683 is using.
 

tshuck

Joined Oct 18, 2012
3,534
As others have intimated, this is likely an issue with knowing what your configurations bits do and why.

You have told the compiler to tell the PIC that you are using a Low-Power, external crystal as your oscillator source. Does that match with your hardware? You must have a low-power crystal attached to pins 2 and 3 with the configuration you've specified. Did you mean to use the internal oscillator?

Do you have the pullup resistor on MCLR that absf has shown in his image? MCLR, or Master CLeaR, is a global reset that will continually reset your device if not held high (never leave resets floating!). You can use a 10k pullup to take care of that, or set MCLR off in the configuration bits.

I would, however, avoid the habit of not explicitly setting the configuration bits each time as this will come back to frustrate you at some point.
 

Thread Starter

Robert Webb

Joined Dec 20, 2014
18
Hi All
Thanks for the input. I am not a programmer and have been using the program I detailed (written by a friend) for a while. It was originally designed (with a pause of 489) to pulse once per minute and the switch the chip is used in has been driving a solenoid (for a clock) for some time. What I have been doing is attempting to play with the pause figure in the program as previously suggested on this forum so see if I could get the pulse rate to 30 times per minute. As I said, it would appear I may have to return to the drawing board or to find a non programming solution using 4060 chips with a 32K clock crystal.
regards
Bob
 

darrough

Joined Jan 18, 2015
86
It could be that the USB port you are using is not supplying enough power. Are you using the same USB port as when you did the previously programmed 12f683?
 

Thread Starter

Robert Webb

Joined Dec 20, 2014
18
Hi darrough
Thanks for the input.
I am not 100 percent sure about that. I have an ASUS with four USBs at the top and as best I can recall have used the same one.
I have ordered some new chips and when they arrive I will start again including trying different USBs. I read somewhere that powered USBs might provide a better output so I will try that as well. I have now isolated the problem to the extent that I know the software will work because I got a friend to program a chip with the code I am using and he reported that it was successful and that the code is generating a 2 second pulse + or -.
I have also discovered that I am not the first person to have a problem with the Microchip PICkit system particularly the VPP voltage error message and that fixing it is not for the technologically challenged.
I get the impression the Microchip has a bit of a quality control problem and that it does not bother them too much. It is easier to blame the customer.
Bob
 

MrAl

Joined Jun 17, 2014
13,702
Hi,

Usually there is a way to 'verify' the chip, and that should tell you if it was really programmed or not.
Why would this not work, even if there was a problem with the programming voltage?
The programming voltage is usually developed by a simple PIC controlled voltage boost circuit, with a transistor and inductor and diode, and a couple resistors to set the voltage level. But if something happened to this, the chip would never pass the verify check.
 

Thread Starter

Robert Webb

Joined Dec 20, 2014
18
MrAl
Thanks for the input. The problem started when the PICkit2 programmer told me it had a voltage problem and could not find the target. I spent some time fiddling with the connection and then suddenly it could find the target and the programming process was, according the the Micro Code Studio program I am using, was successful. But there was no program on the chip. So after a lot of research I discovered that other people were getting the same voltage message. I followed a discussion between two people who were either engineers or technicians and they isolated and fixed this fault (he said it cost 10c for the part). Unfortunately I do not have these skills so I opted to try another cheaper version PICkit programmer from China. It seemed to program the active chip I was using because I was able to go from 30 pulses every 57 seconds to 30 pulses every 61 seconds. But when I tried another chip it didn't want to know. I have several of these chips but they have not been stored very carefully so there is a possibility that these have been affected by static electricity, which I am told is easy to do and is a problem. So in order to removed that as an issue I ordered some new ones. Hopefully they will arrived this week.
regards
Bob
 
Top