Making a small robot with a pic

Hi,

I've had lots of success with the PIC16F886. It's s 40 pin PIC with many ADC channels, two bult in comparators (with outputs that can be assigned to a pin or read in software), and two PWM channels (actually CCP modules, one of which is enhanced).

It also has synchronous and asynchronous communications ports, so you can use I2C or pretty much any serial protocol without bit banging.

Thanks,
Barnaby
 

jwilk13

Joined Jun 15, 2011
228
I like the PIC18F series of microcontrollers. I've been using the PIC18F45K20 most recently with quite a bit of success. Maybe the best thing about going with this one is that it's available mounted on a demo board, which makes starting out with it fairly simple.

The PIC18F45K20 can generate PWM on up to 4 different output pins with up to 10 bits of resolution and can operate in multiple modes (single pwm, half bridge, full bridge forward, full bridge reverse). If you don't have a programmer, the whole dev kit can be purchased here for ~$70 USD.
 

t06afre

Joined May 11, 2009
5,934
Microchip do have a lot of controllers. You can go here http://www.microchip.com/productselector/MCUProductSelector.html and play around with settings. Not a problem to find a microcontroller with 8 bit core and up to 10 PWM channels. But most important. Ask your self two questions. What kind of controller is compatible with my programmer, and what kind of controllers can I easy get my hands on. If you do not have a PIC programmer. I would recommend a Pickit 3
 

ErnieM

Joined Apr 24, 2011
8,011
how can i know and be shure before buying how many pwm, adc and pins i will need when choosing my micro controller please?
Consider Hofstadter's Law:
Douglas Hofstadter said:
It always takes longer than you expect, even when you take into account Hofstadter's Law.
It is also applicable to unknown designs with unknown parameters.
ErnieM's corollary to Douglas Hofstadter's Law: said:
It always takes more parts than you expect, even when you take into account ErnieM's corollary to Hofstadter's Law.
The best you can do is hold your horse there pardner and finish the entire design first. That means don't pick the PIC first, pick the PIC last, after you have determined how many input of what type you need, how many outputs (simple hi/low, PWM, etc).

Anything else and you risk having to toss your PIC away and buy a new one.

I have a pile of parts here from not following my own advice. And a few months from now when the robot is done but you decide to add a range finder/laser cannon you'll need some more I/O anyway.

That said, as long as you are prepared to toss your PIC just get any decent looking device and go for it. No matter where you start you'll have fun and learn something too.
 

ftsolutions

Joined Nov 21, 2009
48
You need to first do what engineers call 'getting the system requirements' so that you can design things logically, which includes determining what you need for a processor and its resources. For example,

How may motors must you control to move the robot? How about steering the robot? Will you use motors with encoder feedback for more precise speed control?

What sensors do you plan to use (light, infrared, laser, microphone, etc. and how will they be mounted (and/or aimed?) Other kinds of sensors needed which require A/D conversion, or simple I/O?

Do you plan to use more sophisticated electronics modules/boards to give you GPS reception capability, electronic compass, or some sort of wireless communications capability? Many of these modules need either serial port or SPI or I2C port.

Will there by grippers/arms on the robot? Will they be servos or simple gear motors?

These are just questions to get you thinking. Start by sketching out a block diagram of the things you plan to have, and research what sorts control interface is required to support each function. Then, after you've got at least these basic requirements together, you can look for processors that meet (or nearly meet) them. The more complex the robot, the more program memory space you will need as well. Pick a processor with the peripherals set that most nearly matches your needs with the largest amount of memory you can afford.
 

ErnieM

Joined Apr 24, 2011
8,011
Thanks for the info, this question is really important for me to understand how to build a robot. Do you look at the number of pins or do you look at the number of A/D channels that it takes for a general sensor to find the maximum number of sensor you can install on a pic. For exemple this one: http://www.robotshop.com/sfe-acs712-low-current-sensor-breakout.html
First you do the entire robot design, then you count up how many signals you need to control it, then you find something that can provide that and maybe some more.

Pick the PIC last.

BTW, that's a SparkFun.com part you link to, guess they have resellers too. Good shop. But if you don't absolutely need the isolation it provides you're overpaying about 14,000% over the resistor you could use instead.
 
Top