What 8 pin pic do I use for this?

Thread Starter

stanman11

Joined Nov 23, 2010
228
Im trying to come up with a design to run a servo with an 8 pin pic microchip
nothing over $4
how it will work is I press a button and it moves the servo one way then when i release the button the servo returns
press it again the servo spins the opposite way. release and it returns

Press:spin left
Release center
Press: spin right
Release center.

But I dont know which chip to use.
FLash chip?
find one off ebay for me please?
 

eblc1388

Joined Nov 28, 2008
1,542
But I dont know which chip to use.
FLash chip?
Basically any 6 pin or 8 bit PIC will do what you wanted, but you must have the hardware programmer setup to program it. Suitable chips like 12F629, 12F675, 12F683....

The actual requirement is in the software inside the PIC, which you have to come up with yourself.

Basic hobby servo requires a continuous pulse signal every 20ms to work, even when it is in the neutral position. For the servo to stay in the neutral position, the pulse width is 1.5ms. If the pulse width is shorter, the servo moves to the left, and if longer than 1.5ms, it moves to the right. The normal pulse width range is 1ms~2ms, corresponding to the extreme of travel in either direction, with 1.5ms being the "center" or "neutral" position.

Therefore your PIC must provide this continuous pulse signal without interruption every 20ms, in addition to sensing the user key input and acts accordingly.

The easiest way to provide the pulse signal is to use PWM, whether 8-bit PWM or higher would depends on your requirement. Some PICs do have PWM inbuilt to their timers, so it is easy to setup. Then the main program loop will be checking the key input and adjusting the PWM parameters.

Or, the PIC can generate the required servo pulse via an infinite loop without even using timers or PWM. The sensing of the user key press can then be done in between the 1.5ms servo pulse and there is plenty of time (18ms) to check user key input and acts accordingly.

Takes your pick with PIC that fits.
 

ErnieM

Joined Apr 24, 2011
8,377
I've used a PIC12F615 or PIC12HV615 in several projects now. 8 pins, PWM, A2D, other goodies for about a buck single quantities.

I keep using it as the HV type features an internal current shunt regulator that can save a part or two in very tiny applications (which as my specialty).
 

Thread Starter

stanman11

Joined Nov 23, 2010
228
I placed the programmer on orderlast night same time as i posted this question.
its just a cheapo with usb for 17 bucks but I really only need to have it for the project and maybe some future projects.

The link the last answer gave me to ebay seems like it will work and is a damn good price. I dont know how you found them pecause i entered 8pin pic in to the search and only got a few shopping from lowest price first.
I'm going to place those on order here in about 15 minutes unless some one has another say in the matter.

I have to finish this before holloween so i hope i can. I might need some of you guys's help.

I set up a pulse switch with a 555 timer. If I use an up down counter switch with the timer ic, would it be possable to acheive the fuctions that I need or would i need to go in to extensive programming?
 

Markd77

Joined Sep 7, 2009
2,806
Have you got a link to the programmer you bought?
Some of them don't program the whole range of PICs.
Hopefully you didn't get this one because it doesn't program any PICs:
<ed>I should add that if you got this one all is not lost, because it programs some ATMEL microcontrollers which will do the same job </ed>
http://www.ebay.com/itm/USB-PIC-Programmer-ATMEL-MICROCHIP-SST-SCM-SP200S-/370529600222?_trksid=p4340.m1374&_trkparms=algo%3DPI.WATCH%26its%3DC%252BS%26itu%3DUCC%26otn%3D15%26ps%3D63%26clkid%3D2779943901988251688

It might be possible to do what you want with a 555 chip and a few other components, we have some 555 experts on here.
 
Last edited:

Thread Starter

stanman11

Joined Nov 23, 2010
228
I wish thie stuff would get here sooner. Taskes 2-4 weeks.last time i ordered from china it took 22 days which would leave me about 10 days to finish setting up te mechanicle fuetures and programming the servo.
 

Markd77

Joined Sep 7, 2009
2,806
MPLAB has a pretty good simulator built in, so it should be possible to write the program now and be fairly confident that it will work on a real chip.
Is it for a halloween project?
 

Thread Starter

stanman11

Joined Nov 23, 2010
228
got the chips in today and the programmer i got last week.
the chips are the size of an adult flee. tiny chips.
I've never worked with something this small

I think this project is a fail though. My 3 cylinder piston isnt working properly
might have to scrap it
 

Thread Starter

stanman11

Joined Nov 23, 2010
228
this chips can be used on my programmer but how the hell do i put these things on there?
there so tiny they dont fit on the DIN
 

ErnieM

Joined Apr 24, 2011
8,377
I'm guessing here but.
Run wires from the Din to a bread board to the correct corrisponding pins on the chip?
Yeah, that should work, except I can't tell what chip or what programmer you have.

Not that *I* have ever ordered the wrong parts. Twice. In lots of 50 each time.

Not me. Nope.
 
Hey Mark, This is the one i bought

http://www.ebay.com/itm/30058180652...X:IT&_trksid=p3984.m1423.l2649#ht_2824wt_1037

I treied to order those chips but right when i tried to order the seller took them down. I found more but there from china so i gotta wait longer to get the chips.
I would opt for a microchip programmer, if they cant get it right then no one can !
I use a second hand picstart and it has been trouble free. You can alos update the firmware in it as new pics come out.
 

Markd77

Joined Sep 7, 2009
2,806
Surface mount parts normally end in /IOT, through hole parts end in /IP or /EP
If you ordered the surface mount version instead of the through hole version it should be possible to solder wires to the pins if you have a steady hand. The normal way is to make a board like this:
 
Top