Help with other switching to other types of pic controllers

Post here to discuss the PIC microcontroller tutorials.

Moderators: Chuckt, Garth, bitfogav

Jumbosize
newbie
newbie
Posts: 5
Joined: Fri May 27, 2011 7:47 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Help with other switching to other types of pic controllers

Post by Jumbosize » Sat Jun 25, 2011 2:00 am

Hi, First I would like to start off by saying thank you so much for all of your helpful tutorials that you have put up on your website Brad. They were all incredibly helpful for me to get started up. And while this forum appears to be pretty dead, I have a question that I hope somebody will be able to help me with. I have been programming using the pic16f628a microcontrollers as the tutorials use, but I've wanted to try programming a different type of chip. I bought some pic12f629's to experiment with. I'm having some trouble with getting them to work. I downloaded a simple led flasher source code to test it out (Which I was able to build successfully), I switched the device type to pic12f629, I checked several times and made sure I have the pickit2 attached to the chip properly, and all went fine until I tried to set my pickit2. It gave me an error "PKWarn0003: Unexpected device ID: Please verify that a PIC12F629 is correctly installed in the application. (Expected ID = 0xF80, ID Read = 0x3FE0)"

What am I doing wrong? Please help me out.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Help with other switching to other types of pic controll

Post by bitfogav » Sat Jun 25, 2011 9:57 pm

Jumbosize wrote:while this forum appears to be pretty dead.
Hi Jumbosize, And welcome to the site.

I wouldnt say that this forum is pretty dead, I mean there a few of us that check it on a regular basis with some great knowledge and try to help when we can.

Has for your Pickit2 problem, Some questions - Is it a Clone version of the pickit2 that you have and have you tried another PIC12F629?, Im wondering if the 12F629 that you've been using has received too much static? I have had that done to me before, ive tried another 12F629 and it worked fine..

Jumbosize
newbie
newbie
Posts: 5
Joined: Fri May 27, 2011 7:47 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by Jumbosize » Sun Jun 26, 2011 1:14 am

I tried swapping out the chip for another but with no success. It still gave me the same error. As for the pickit 2, it is an official product to the best of my knowledge. It came in the standard packaging and looks like any other I've seen. Do you have any other tips I could try?

Also I'm sorry if I offended you by saying the forum is dead. I just didn't notice a lot of activity when I glanced around the pages. I'm actually pretty glad I got such a quick response so please forgive me.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Help with other switching to other types of pic controll

Post by bitfogav » Sun Jun 26, 2011 9:03 pm

No offence taken :)

The reason I asked if you had a clone pickit2 was because i know they give some problems with programming chips, Heres a picture of a Clone pickit2
PICKit2clone.jpg
PICKit2clone.jpg (15.99 KiB) Viewed 28078 times

Ok so now we have eleminated the PIC being at fault by swapping it with another, Double check that your circuit is correct and your Pickit2 is correctly connected to the PIC. Heres a circuit I made up to show you how your circuit should be connected to your 12F629.
Pickit2-12F629.jpg
Pickit2-12F629.jpg (25.13 KiB) Viewed 28078 times
If all this checks out fine then how are you programming the 12F629? I mean are you programming the 12F629 using the MPLAB programming feature or using the Pickit2 application? for example this app below..
pickit2app.jpg
pickit2app.jpg (65.59 KiB) Viewed 28078 times

Jumbosize
newbie
newbie
Posts: 5
Joined: Fri May 27, 2011 7:47 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by Jumbosize » Mon Jun 27, 2011 1:35 am

No, I do not have a clone pickit then. Mine looks like the official one does. (With the red two and Microchip written on top.)

I checked your diagram and that is exactly how I have mine wired up, so that isn't the problem.

I am programming with MPLAB IDE, not the Pickit 2 software.

Could it have anything to do with the code that I am using? I was able to build it fine and everything but I just don't know anything at this point.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Help with other switching to other types of pic controll

Post by bitfogav » Mon Jun 27, 2011 7:11 am

Jumbosize wrote:No, I do not have a clone pickit then. Mine looks like the official one does. (With the red two and Microchip written on top.)

I checked your diagram and that is exactly how I have mine wired up, so that isn't the problem.

I am programming with MPLAB IDE, not the Pickit 2 software.

Could it have anything to do with the code that I am using? I was able to build it fine and everything but I just don't know anything at this point.

Thats answered my next question, I would try using the pickit2 software instead of the MPLAB IDE :)

If you need to download it then you will find it here, near the bottom of the page, under "Windows Software & Firmware"
http://www.microchip.com/stellent/idcpl ... e=en023805

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by brad » Mon Jun 27, 2011 9:31 pm

Sorry for the late reply, We are in the process of moving house - we are half way there!

I guess the forum is not as busy as others you would find out there, but there certainly are some helpful members around here and whenever someone has something useful to post, they will :D

Now as for your post, one thing I would certainly recommend is try connecting the pickit 2 to your microcontroller without anything else in the circuit. I have found sometimes that the circuit can load down the pickit and it will have trouble connecting to it. If that step works, program the microcontroller and then put it back in the circuit to see if it works

Jumbosize
newbie
newbie
Posts: 5
Joined: Fri May 27, 2011 7:47 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by Jumbosize » Tue Jun 28, 2011 2:22 am

Thank you so much brad! It worked perfectly! I unhooked everything else attached to it and it programmed just fine. I will have to keep that in mind from now on. Thank you both for your time.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by brad » Tue Jun 28, 2011 10:28 pm

No problem :)

Jumbosize
newbie
newbie
Posts: 5
Joined: Fri May 27, 2011 7:47 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by Jumbosize » Sat Jul 02, 2011 12:56 am

I'm sorry but it seems like I spoke too soon when I said that worked. For some reason it worked the very first time I tried it, and now I can't get it to work any more. Do you have any other tips? It's like some times I can actually get it to work but usually it doesn't. Since I took your advice and unhooked all of the attached led's it has stopped giving me an error, however the circuit does not run properly every time. Usually it will just create a solid light when it should be blinking. Do you have any suggestions?

Also sorry for posting this so late. I've been out of town for a while so I'm just now getting back to my normal routine.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Help with other switching to other types of pic controll

Post by bitfogav » Sat Jul 02, 2011 9:05 pm

Jumbosize did you try the pickit software I suggested above? it works better that using MPLAB to programme microchips.
you need to download "PICkit 2 V2.61 Install" and you might need to update your pickit2 firmware.
http://www.microchip.com/stellent/idcpl ... e=en023805

Heres some important factors:
The PIC 12F629 and 12F675 have a factory set oscillator calibration value written to the last program memory location during manufacture. When programming the PIC the programmer software should read this value out, merge it with the program data being written to the PIC, and then write it back.

The Microchip PICKit2 programmer with V2.61 application software will calculate and reprogram an erased OSCCAL in a single operation.

However, since this calibration value is in the normal program memory area of the PIC it is quite possible to erase it. Once you've done this, working out what the value should be is not easy and without it the internal 4Mhz oscillator will not run at the correct frequency. Worse still, any application code that expects to find the calibration value will most likely crash.

Therefore it is important to know the correct value for the internal oscillator calibration setting. It is a good idea you always know what the correct oscillator calibration value is so you can recover it and write it back should you accidentally erase it.


Also can you post your code?.

User avatar
brad
Site Admin
Site Admin
Posts: 2578
Joined: Fri Mar 26, 2010 10:30 pm
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by brad » Sat Jul 02, 2011 10:30 pm

I am 90% sure that to get it to work everytime, you just need to connect a resistor Anywhere between 1k and 10k will do) between the MCLR pin and VCC. This makes sure that the microcontroller does not reset.

User avatar
bitfogav
Moderator
Moderator
Posts: 915
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Re: Help with other switching to other types of pic controll

Post by bitfogav » Sat Jul 02, 2011 11:03 pm

brad wrote:I am 90% sure that to get it to work everytime, you just need to connect a resistor Anywhere between 1k and 10k will do) between the MCLR pin and VCC. This makes sure that the microcontroller does not reset.

yeah thats another possibility, the PIC is in reset mode.

User avatar
sdudley
Moderator
Moderator
Posts: 337
Joined: Sun Mar 28, 2010 1:33 pm
Location: Florida, U.S.A.
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by sdudley » Sun Jul 10, 2011 1:29 pm

Hey guys,

Sorry I am late to the party.

I am really surprised that no one has mentioned (or asked) if Jumbosize changed the processor in the include directive, or even bothered changing the configuration settings to match the new processor?
config-settings.png
config-settings.png (206.67 KiB) Viewed 28053 times
The above should read:

include "P12F629.INC"
LIST P=PIC12F629
__config h'xxx'


The config settings should be set how you want the processor to work. For example, do you want to use the internal oscillator, disable the master clear, allow for low voltage programming, etc. This information is found on page 54 of the PIC12F629 data sheet.

Jumbosize,

If the LED flasher source code you downloaded was already written for the PIC12F629 then I guess my post is mute, but if it is a generic code or one of Brad's tutorials written for the PIC16F648A, then you will need to change this information for the new PIC you are using.

Stacy
Any time you deviate from sequential consistency, you increase the complexity of the problem by orders of magnitude.

MrDEB
I practically live here!
I practically live here!
Posts: 372
Joined: Fri Feb 18, 2011 4:24 am
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Re: Help with other switching to other types of pic controll

Post by MrDEB » Thu Nov 21, 2013 8:29 am

I am trying to learn ASM but using a different pic instead of the 16F684a.
I have a developement board (TAP-28) with an 18F2420. I have looked all over the data sheet for the config settings but?? maybe looking for the wrong thing. Right Church, Wrong Pew.
I am starting out with the LED flasher that I downloaded for tutorial 2.

Post Reply
[phpBB Debug] PHP Warning: in file [ROOT]/vendor/twig/twig/lib/Twig/Extension/Core.php on line 1266: count(): Parameter must be an array or an object that implements Countable

Who is online

Users browsing this forum: No registered users and 6 guests