Jump to content
Sign in to follow this  
stepava

PIC12C508A for TOP GUN AWS?

Recommended Posts

Hi all, i'm new in the forum.

I have a question about the TOP GUN AWS project: is it possible to use th PIC12C508 / 508A instead of the specified PIC12C509 / 509A.

It seems that the pics are pin to pin compatible and the main difference is in memory space, is this correct?

I normally work with "bigger" flash pics like 16F877 so i'm not expert in these smaller one.

Thank you for the help

Regards

Stefano

P.s. i program a first 12c509a and make the error to answer YES when ICprog ask me to use the osccal value from file. So then i try with another 12c509a and answer NO to the question, but respect to the "window" shown in the FAQ section my icprog says that it not find any osccal value (in the FAQ is shown that icprog find a "default factory" osccal). Can i have problem with this thing or is it normal?

Share this post


Link to post
Share on other sites

(1) The 12C508/508A does not have enough code memory or RAM, so it cannot be used.

(2) Do NOT allow the chip programmer to program the OSCCAL value.

Share this post


Link to post
Share on other sites
(1) The 12C508/508A does not have enough code memory or RAM, so it cannot be used.

(2) Do NOT allow the chip programmer to program the OSCCAL value.

Thank you for your very quick reply. I still have some problem with this project. I program, as written before, another PIC and this time I answer NO to the programmer regarding the osccal value, but when i try the circuit nothing happens. The pic seems "dead" and when i plug in the battery neither the blinking LED for the "I'm alive" appears. I double check the schematic and everything seems fine, my radio is Futaba so i set REV for that channel and +- 100% EPA. During programming i set INTRC, no WDT, no MCLR and yes for CP. How can i check if the PIC is "running" or if it is stucked due to bad programming.

I have another question, probably a silly question, but i'm not so expert with pic programming: why the hex file is "code protected"? I think that code protection is useful to avoid that someone can "grab" the source code reading the internal hex code of an already programmed pic. In this case you are already providing the hex code that can be related directly to its assembly counterpart, so i don't clearly understand the need for code protection. The point is that the code protection avoid the automatic programmer verification, so it is difficult to know if the pic is burned correctly. Please don't think that is a critic, it is only to understand the best way to proceed for make the top gun aws working, i think that your projects are very awesome, so i hope to be able to make combat with my friends as soon as possible :-) :-)

P.s. I have an ICD2 clone and i want to order some PIC12F509, is it the code for top gun aws directly portable to this flash device? In this case it can be more easy for me to try different configurations without burning too many pics (i burn today my last pic12c509a :-) :-))

Thank you

Regards

Share this post


Link to post
Share on other sites

1) Upon boot, two LED winks will confirm the PIC is running. All you need is 5VDC power for this (on the correct pins of course). Before blaming the PIC programmer, I would recommend that you check to see that you have 5VDC power and the LED connected to the correct pins. I've seen several builders connect these wrong, even after confirming all was fine. So, check again against the PIC data sheet and the project's schematic.

2) The code protection is so that project builders will always use the distributed files rather than copy from a programmed PIC. It also reminds them that the code cannot be freely copied or distributed. Using the hex file at no charge has requirements that must be met, as discussed in the file distribution (see readme file).

3) You can use the PIC12F509. Keep in mind that erasing a PIC12F509 so that you can try programming it again will certainly destroy the factory OSCCAL word. So you will need to restore the original value back into the chip with each use. This is where many PIC users get into trouble.

Share this post


Link to post
Share on other sites
1) Upon boot, two LED winks will confirm the PIC is running. All you need is 5VDC power for this (on the correct pins of course). Before blaming the PIC programmer, I would recommend that you check to see that you have 5VDC power and the LED connected to the correct pins. I've seen several builders connect these wrong, even after confirming all was fine. So, check again against the PIC data sheet and the project's schematic.

2) The code protection is so that project builders will always use the distributed files rather than copy from a programmed PIC. It also reminds them that the code cannot be freely copied or distributed. Using the hex file at no charge has requirements that must be met, as discussed in the file distribution (see readme file).

3) You can use the PIC12F509. Keep in mind that erasing a PIC12F509 so that you can try programming it again will certainly destroy the factory OSCCAL word. So you will need to restore the original value back into the chip with each use. This is where many PIC users get into trouble.

Thank you again for your quick and clear reply.

I will double check my schematic and my built circuit in order to be sure that everything is connected correctly, I start from your schematic and built the PCB with eagle software:

http://picasaweb.google.com/lh/photo/Td8Ed...feat=directlink

I hope to had made every connection correctly.

(The LED is lighted with "inverse" logic, is it correct? when the PIC port is 0 the LED is ON, when the port is 1 the LED is OFF?)

These are the 3 PCB that i built for me and the two other friends of mine:

http://picasaweb.google.com/lh/photo/ErrSB...feat=directlink

For information I use a ProPic2 programmer with ICprog, as i write in my first post, during programming, the programmer ask me if I want to write OSCCAL from file and i answer NO. But the strange thing is that in your FAQ section the "message window" says:

osc_cal1.jpg

while my programmer ask something like: "OSCCAL value not found, Do you want to use value from file (3FFFh) instead?" (as is said I anyway answer NO, but to me it seems that something is not correct, because seems that there is no OSCCAL value, so the PIC won't run properly).

Why the programmer is not able to "find" the factory osccal? it is possible that the PIC is "bad" before programming? i make a blank check and the ICPROG says that the PIC is blanked. Do you, in your experience, seen something like this?

Regards

Share this post


Link to post
Share on other sites
The LED is lighted with "inverse" logic, is it correct? when the PIC port is 0 the LED is ON, when the port is 1 the LED is OFF?

Yes, LED is on when the pin is logic low.

Why the programmer is not able to "find" the factory osccal?

If it wants to, it can find it just find. The programming system's overall operation, and the OSCCAL warning message that your programmer says, is up to the authors of the programmer system's PC software. Basically, the authors have no idea if you want to retain the factory value, so they ask if you want to use the one in the file (which you would have had to edit into the hex file in order for it to be valid). It is up to you to decide what to do.

If you choose to use the value in the file, then it must be the value that was manually read from the PIC before it was used (virgin). YOU need to take extra steps to make sure it a correct value that came from the chip itself. The exact value will depend on the silicon's characteristics at the time the wafer was processed at Microchip's factory (batch/lot variation).

Honestly, I think the way some hobby quality (low cost) programming systems operate causes more confusion than they should. Sometimes I wonder if the programming system authors actually use the chip programmer they created.

it is possible that the PIC is "bad" before programming?

I have personally programmed over 50,000 (maybe more) PIC microcontrollers of various types. The only bad ones I have experienced were due to damage caused by the programmer system. So, if you have more than one "bad" PIC then I would suspect something other than the PIC. I am confident that the provided hex file is valid, so the problem is either the hardware or the programming system.

  • Like 1

Share this post


Link to post
Share on other sites
Honestly, I think the way some hobby quality (low cost) programming systems operate causes more confusion than they should. Sometimes I wonder if the programming system authors actually use the chip programmer they created.

Thank you, I agree with you, i built this "hobby" programmer and "sometimes" it works, but i had a lot of problem, I never switch to a more professional programmer because I start to work with "bigger" PICs that support the ICSP and i directly program them with ICD2.

This morning i tried some experiment to verify if my programmer is "good", but as you expected it seems something wrong: I read a brand new PIC12C508A and all the register are 3FF (or FFF) anyway the last address is NOT a "valid" OSCCAL value so i think that something is wrong in the "communication" between Programmer and PIC.

Share this post


Link to post
Share on other sites

I'm going a little OT but i try to go deep into this problem; I try a different software (WinPic800) and with the same hardware this time the last address is read correctly!!! The wordb is 0xC5C that is in the correct format of 0xCKK for MOVLW KK whit KK as the OSCCAL constant.

I will investigate......

Share this post


Link to post
Share on other sites

ICProg has various settings that relate to port access, signal inverting, delay times etc. I'd have a look there, maybe WinPIC is less aggressive on timing and things are going better, or you have inverted signals.

I gave up on homebuilt programmers quite some time ago after tearing my hair several times for many unexplained random failures and bought an ICD2. The $250 were very well spent, never had a problem again.

To me home-made programmers are (sometimes) OK if all you want to do is one project like this one, but if you intend to do anything more don't lose your time with them. Especially now that Microchip offers the $35 PicKit2...

Edited by Kilrah

Share this post


Link to post
Share on other sites

Hello everyone.
I'm new to the forum.
I'm in this fight to schedule PICs a year ago.
I am an Electrical Engineer, and I can evolve well.
I decided to start with PIC12C509A ... I realize after about 3 weeks, that was not a good choice.
But as challenges are needed in any learning, I insisted on the 509A
I had not noticed, nor read that it is OTP type.
Only after buying and using a K150, since PICKIT3 does not support the 509A, I noticed that it only records once and it is ready because its memory is not FLASH.
I also had huge problems with OSCCAL until I resolved to change the .hex to the OSCCAL value of the chip to be written. From that point, everything worked and I was able to program the blessed 12C509A ... but only once.
I learned doing and reading datashet, of course.
HAPPY NEW YEAR 2017, everyone

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×