Help programming a Pic 12f675
W9GFO
Posts: 4,010
I'm working on a project where I need the Pic to read a servo pulse and then output a high or low depending on what that pulse value is. I would think that it would be a very simple program.
Last night I dug out my PicKit 1 (never used it) and downloaded the MPlab IDE. I expected that with a few years worth of experience using Basic Stamps and the Propeller chip that I would be able to muddle my way through this Pic thing. Not so.
Then I spend a couple hours searching the interwebs for a good tutorial. I find lots of info but it none of it is what I am looking for. I just need a sample program (in Basic or C) so that I can understand how to put together my own code.
A while back someone offered to help with Pic programming but I can't remember who that was. I really don't want to have to join another forum for something so simple when I know that there are many here that can help. That would be like telling someone to join a semiconductor forum when they have a question about a diode.
I really wish Parallax made a single cog, 8 pin, < 1$ Propeller chip. Then I wouldn't have to turn to MicroChip.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Last night I dug out my PicKit 1 (never used it) and downloaded the MPlab IDE. I expected that with a few years worth of experience using Basic Stamps and the Propeller chip that I would be able to muddle my way through this Pic thing. Not so.
Then I spend a couple hours searching the interwebs for a good tutorial. I find lots of info but it none of it is what I am looking for. I just need a sample program (in Basic or C) so that I can understand how to put together my own code.
A while back someone offered to help with Pic programming but I can't remember who that was. I really don't want to have to join another forum for something so simple when I know that there are many here that can help. That would be like telling someone to join a semiconductor forum when they have a question about a diode.
I really wish Parallax made a single cog, 8 pin, < 1$ Propeller chip. Then I wouldn't have to turn to MicroChip.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike2545
This message sent to you on 100% recycled electrons.
I can let you have the MPLAB project directory, if that helps.
Read-Modify-Write isn't a problem with this program because of the delays, but I've included some commented-out code that uses a shadow register to avoid R-M-W effects.
73, Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
Post Edited (Leon) : 11/22/2009 9:00:37 PM GMT
-Phil
PICBasic looks to be a good fit for me - wish they had a trial version. Would I need to purchase a programmer as well or is there a way I can use MPLab to to get the compiled code into the chip?
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Leon
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Amateur radio callsign: G1HSM
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Mike2545
This message sent to you on 100% recycled electrons.
I have found Proton PicBasic Lite which seems very similar to the MeLabs PicBasic and it does support the 12f675 - the PicBasic Pro demo does not.
I'm geting closer, Proton's PicBasis is supposed to be accessible from within MPlab, I'll see if I can get it to work soon.
I requested some AtTiny 13a samples to see how I get along with those but for now I want to see if I can use these 12f675s.
Here is what I have so far, it compiles fine but I have yet to put it on a chip. I would be surprised if it worked - seems like there is configurations missing, ie., the XTal freq.
I'll replace the "GoTo" when I figure out the equivalent of a DO - LOOP.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.