How to program a 12F508

Thread Starter

q12x

Joined Sep 25, 2015
1,693
Thank you !
I will look over the new MPLAB X.
But I did manage to make my program with the help of mister Steve (sghioto). Fantastic project we did and now it is working smooth. And a TON of bugs. We overcome them, but boy it was a ride.
By the way, I look into my *.h (header) files inside hitech-c folder and there is no mention about my pic 12f508 there. I did find it mentioned only inside a single htc.h||pic.h header file and they are the only headers i use in my program. But that mention, is of no help to me.
I couldn't find 12f508 configuration attributes at all, ANYWHERE ! They are a mystery. See if you can find them for me, please. It would be nice to have the configuration for both the ASM and hitechC.
And thank you !
 

Thread Starter

q12x

Joined Sep 25, 2015
1,693
US $4.50 for 10PCS 12F508 and the order was on Dec 29, 2020 and arrived after 3months ++.
I remember I only searched for the cheapest PIC's I could find on ebay market back then.
After that I thought I will never get those pics since exagerated mail delivery delay, and I ordered another 10pcs but this time with better price: $ 2.88 10pcs PIC12F508 but from aliexpress and not from ebay that become STUPID expensive from 2020 up. And ofcourse, after that, they arrived. But I learned not to trust ebay with time, because they have stupid politics for money back after exactly 3 months. There are way more cheaper markets out there! If you know more cheaper markets I am very interested to know, I dont care which country is from. I only care for the cheapest product. THat is my only prerogative ! I think yours as well.
I just did a quick search now about your PIC's on both my markets:

10pcs 12f675 the cheapest on ebay
US $3.78 + Shipping $1.80 = 5.58 total
10pcs 12f675 the cheapest on aliexpress
US $4.00 + Shipping $4.08 = 8.08 total
and
10pcs PIC12F1840 the cheapest on ebay
US $9.77 + Shipping 0 = 9.77 total
10pcs PIC12F1840 the cheapest on aliexpress
US $5.00 + Shipping $3.59 = 8.59 total

Not terrible expensive I admit. I personally started programming MCU's around 2001 - I think... And back then, the most popular was pic 16f84. I loved that pic and I learned everything I know from the tutorials about it, which they were quite a lot in those times. A ton of time for learning as well back then. Now I recuperate quite quickly in about 1 or 2 weeks. Now, at this hour, I already programmed 1 of my pic 12f508 and made a circuit with it and using it outside experimental boards. I call this, a Big success.

Please make me a list with all your MOST used PIC's or/and picaxe or/and anything else that you usually use.
I want to get updated on what is common these days. Im not that old, but I use them quite rarely. This period I have a big personal projeckt I am working day by day with also a friend from AAC as well who helped me a ton already.
I don't mind another friend, you know?
 
Last edited:

Ian Rogers

Joined Dec 12, 2012
1,136
I don't know where you are in the world... so I'm sorry if you have to wait an age for parts.. I sit comfortably as I order before 6:00 and it arrives next day... As I have an account delivery is free... Even if I buy 1 thing..

I use pic18f4520 for one product... pic18f26k80 on another.. and pic32mx575h256 on the big one.. most are now in full production, so I receive ready made boards..
 

trebla

Joined Jun 29, 2019
547
I change time-to-time the PIC families what i use in my common designs because older ones become more costly than newer ones and because newer ones offer more peripherials. I quess, you are living in Romania, there i sorted 8-bit Microchip MCUs by cheapest first.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,693
I will answer both mister @Ian Rogers and mister @trebla
-
I am sorry I am in romania as well, we are on the same line of thought. Haha.
Thank you mister Ian for your specific most used pic list. Very nice and to the point answer !
I am actually making a list.txt with both your answers and store it in my PIC folder to have it as reference in the future.
So your answers are well stored (and used) !
-
Thank you mister trebla ! Don't convert anything in other curencies ! I use the american USD standard curency always, especially online.
Mister trebla; That list that you give me has 68pages more and is having 50 chips per page. Is impossible that you are using ALL !!!
I asked for your most used PIC's that YOU personally, use most of the time.
Exactly like mister IAN answered before you.
 
Last edited:

trebla

Joined Jun 29, 2019
547
I asked for your most used PIC's that YOU personally, use most of the time
Sorry about this mess, but i want to show how PIC prices are related.

If i look at the quantities then i use mostly PIC12F1822 (before it was PIC12F615) because it is in the most demanded product i produce. But i don't use this for new developments much. Second chip i mostly use is PIC16F1615, then follows PIC16f18877, PIC18F46K22, PIC18F67K40 and PIC18F2550. I use 16bit PIC24 and dsPIC as well but not in large quantities and the chips nomenclature is about 20 different names.
 

Ian Rogers

Joined Dec 12, 2012
1,136
dsPic is the 33 series.. of 16 bit DSP chips dspic33fxxxx... DSP is Digital Signal Processing.. I think its the same core ( If I'm wrong we'll soon know ).. I never had the need to try one of these out.. I believe the processing is in real time so theoretically digital amplifiers can be made.. But again.. never even read up on them...
 

Thread Starter

q12x

Joined Sep 25, 2015
1,693
Thank you mister @Ian Rogers and mister @bertus
I am looking quickly into MPLAB X now and I'm searching for the option/setting to add my pickit2 to the program. Where can I detect my pickit2? Is there even an option for detecting it?
Thank you.
In mplab v8.92 I could select pickit2 programer device like this:

Screenshot_3.jpg

-new edit:
I write to microchip forums about this exact problem and they told me the newest version on mplabX does NOT support pickit2 anymore.
The solution is to find a older version that does support my pickit2.
They give me this page: https://www.microchip.com/en-us/dev...nd-software/mplab-ecosystem-downloads-archive
Now I have to figure out which mplab x is the one that supports it. So much FUN with them, right?
 
Last edited:

trebla

Joined Jun 29, 2019
547
I think PICkit2 is supported up to version 5.00. I have on second PC MPLABX v4.05 and there is PICkit2 supported. On the main PC is MPLABX v5.34 and there is PICkit2 not supported.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,693
Is there such a thing? An external IC memory to attach to a PIC circuit and retain more programming instructions in it?
I want to add more memory to my 12f508 PIC's. Give me links if you know something.
Thank you !
 

sagor

Joined Mar 10, 2019
912
Is there such a thing? An external IC memory to attach to a PIC circuit and retain more programming instructions in it?
I want to add more memory to my 12f508 PIC's. Give me links if you know something.
Thank you !
You can add EEPROM memory, but you cannot directly program "running" code into it. Program space is what you get on the 12F508 only. The 12F509 has 1024 words program space vs the 508's 512 words, and a bit more RAM (41 bytes vs 25 bytes). Neither one has built in EEPROM. For simple 8 bit PIC, you could step up to a 12F683 which has 2k program space, 128 bytes of RAM and 256 bytes EEPROM.
Also, you could look at the older 12F629/675 chips. They have 1k word program space, 64 bytes of RAM and 128 bytes EEPROM.
The 12F508 is about a basic a chip as you can get, and the 12F675/683 chips cost about the same, so why bother with lowest end chip.
Beyond that, you will have to look at the newer series of 8 pin PICs. However, the PICKIT2 may not handle the newer chips. The PICKIT2 will handle all the chips I mention above.
 

Ian Rogers

Joined Dec 12, 2012
1,136
Is there such a thing? An external IC memory to attach to a PIC circuit and retain more programming instructions in it?
I want to add more memory to my 12f508 PIC's. Give me links if you know something.
Thank you !
I know what you are thinking, but no! There is no pointer system ( unlike the intel 8052 ) on the small miros... There is on some of the extended range and on pic32, but as already pointed out "many" times... The pic12f508 only has 1kb of memory.. The pic12f1840 (pin compatible) has 7kb ( Remember that the size of an instruction is 14 bits ie half the memory..) So the pic12f508 has 512 "useable" words And the pic12f1840 ( and the newer types ) have 2k or 3.5k

But more than double..
 

BobaMosfet

Joined Jul 1, 2009
2,113
Im not sure exactly what i did back then. I think those saved (working) files were working for this pickit2? or for a serial port? I am not sure.
This has nothing to do with your PIC. go slowly. Don't create problems. if you do, like this one- fix it first:
1619380480859.png

That message is telling you that the programmer cannot see 5V on the board- so either your shorted on the board, or you have removed a connection to one of the rails.
 

Thread Starter

q12x

Joined Sep 25, 2015
1,693
Ok... Thank you for your answers. I really wanted an external memory for my dinky PIC.
But we can not have everything we want, correct?
I will buy some other more powerful PICs in the future as you are telling me, and I believe you all, and I know it as well too. But for now I have to work with these dinky 12f508 pics I have. And I have a good bunch of them.

Now, on another subject, related to my external memory request. I made this 3 leds blinker.
It works fine. I programmed the PIC and it does the job fine. No problem. Also tested in proteus simulator and also is good there as well.
1. The problem I get from it is like this:
If you look with attention to my code, the last lines of code is not a "for" as the others.
THat's because I got an error:
Error [1360] C:\Prog\mplab\HiTechC-PIC12F508-05\05.c; 50. no space for auto/param main@i_57
If you look on the "Memory Usage Gauge" window, the one with the green circles-pies, you will notice that "Data Memory" is almost full. I didn't know what that thing is, until this error.
That is why I used that repeated code in the end. Because it is using the "Program Memory" circle-pie.
I notice if im making a simple variable, it is using considerable space from "Data Memory". That sucks !!!
In the end I figure out the way to make it work as in the image. But I was very lucky this time.

Screenshot_4.jpg
This is the visual led configuration and functionality:
look at the code and look at this image pattern and you will get what i want to make.
It's a very simple thing.
q20210323- design copy 1.jpg


2.Another problem is this hitech C that I work with.
- I dont have the professional version of it:
After each successful built it is telling me (the red arrows) that the code is not cleaned. Only the Pro version will clean it. This sucks even harder.
Screenshot_5.jpg

In conclusion, the only PROPER WAY to do it, is in Assembler.
Correct?
I understand it is harder to do it, but I will fit more code into the pic and also more carefully , than letting some automatic nutjob like hitechC do it's thing.
I want your opinion on this last one.
Thank you.
 
Top