Choice of Microcontroller

Thread Starter

knibknob

Joined Apr 22, 2010
15
Haha I just noticed, maxpower, is your name from a hairdryer or the simpsons? =P Well any advice you have would be much appreciated, and yes, I am very confused. Thank you in advance for the help.
 

maxpower097

Joined Feb 20, 2009
816
Hairdryer of coarse! :) . Ok heres what I think I know. It may all be wrong but I've gotta say it before some smart guy can correct me. You have 3 basic popular types of chips out there PIC, AVR, and ARM. PIC and AVR are powerful low cost chips made by two companies. Atmel and Microchip. The arduino and PICAXE are development systems that actually compile and use a different language then their chips. The PICAXE is just a PIC chip that runs on a basic type code. The arduino is just an AVR chip that runs on a simplified C code. PIC chips can be programmed with ASM (Assembly) or C. Not real familiar with AVR chips but I think they run on ASM, C, or thumb(which is another language). Someone more familiar with AVR chips will have to tell you more about the languages cause I don't know. These chips will run you from $0.50 for a low end 8 bit chip up to $10 for a high end 32bit chip. Now the 3rd major type is the ARM. This is made by many manufacturers and has many types of speeds so it can be very confusing. I'm just now digging into these so my knowledge of them is limited. They tend to be more power full then the PIC and AVR chips but are more expensive.

So now to actually pick a chip we need to know a couple things. What do you need your chip to do? What type of sensors do you need it to hook up too? What protocol do they use? How many LED's, etc... I don't want you to post too much confidential data so feel free to PM me with the details of your project. We need to know what your hooking up to it and what you want it to do so we know how much power you need, and how many pins you will need. You said the arduino didn't have enough power, can you eleberate on this? Was it preventing you from doing something? Or were operations just too slow? This will be the first step so we can see what families we should be looking at. Also what is your price limit per chip?
 

Thread Starter

knibknob

Joined Apr 22, 2010
15
Thank you very much. The information on the different types of chips is good to know, and it will prove useful if we actually do decide to replace with new chips. However, right now, I am still unsure what the plan is, and will update in a couple days when I know more. Similarly, I am unsure why the Arduino is unable to work, since it did the basic operations fine; I currently querying as to what problems they foresee.

Basically the chip needs to be able to control a stepper motor, an encoder, two limit switches, and a sensor. The sensor is high-end (i.e. expensive) and hasn't been purchased yet, so as long as we leave a few pins to read the measurements that's enough for now. I'm sorry, I don't know what you mean by protocols; for example i think the limit switches simply work by a high or a low. Well, no LED's, simply the components I have already listed. I know I'm being vague, so feel free to ask for any clarifications. Thank you very much
 

maxpower097

Joined Feb 20, 2009
816
I don't know what you mean by protocols;
Ok I say protocol meaning i2c, SPI, UART, etc.... These are basically communication specs and languages used so two electronic chips can talk back and forth. They litterally write books on each so its way too much info for me to post. But you will need to find out what IC's(integrated chips) you need, then find one with a matching protocol. If you look at your datasheet for your uC you will see in the specs it will list how many of each it can support.

If your bosses are wanting to dump the arduino just because it expensive and big don't worry about it. You can easily just buy the chip and program the arduino language yourself and put it on your own PCB. You can also get it in a small form factor 5mm x 5mm. But I think if you use the arduino code you have to post it for all to use as public domain. Thats the trade off for using their OS, or Bootloader.
 

rjenkins

Joined Nov 6, 2005
1,013
Things look to be getting over-complex here...

The original request, for an MCU capable of driving a stepper with encoder, limits and sensors does not need an ultra-fast or high-power controller.

A basic PIC16 or PIC18 can easily do that in software.

If you want to do as much in hardware as possible, go for one the the DSPIC series intended for motor control, such as the dsPIC30F2010 - that has both motor PWM (allowing for future flexibility) and quadrature encoder input.

Use one of the larger chips if you need more i/o lines.

For development support, you can use whichever Pickit (2/3) supports that chip, or for more flexibility go for the ICD3 package.
 

Thread Starter

knibknob

Joined Apr 22, 2010
15
To maxpower, I will look into the protocols, although maybe it would be easier to simply find an adequate development board (would that eliminate the protocol issue?). Actually, i believe protocols used for connectivity (in which case it would be probably easiest to use usb)? Also, I don't believe it's an issue of size or expense, because we have the chip and size isnt that much of an issue.

To rjenkins, thank you for the advice on mcu's that could work. However, I am still unsure if we will be replacing just the MCU or the entire development board. Is there any way to pick the PIC that is best suited for this task? Would this be a good site to find the correct PIC and purchase it? (http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2556109&k=pic16) Well all the operations should be controlled via computer, so that would be more software oriented (sorry I just don't quite understand if that's what you mean by working in software/hardware)? Also, would the MCU's you listed be programmable with C# on the pc interface (it's a requirement =/).

Thank you two very much for your assistance, and I will update once I get more information.
 

retched

Joined Dec 5, 2009
5,207
If you have a computer, why are you using a uC?

You can just use the parallel port for your communication and control.

I see no need to add complexity to the equation.
 

maxpower097

Joined Feb 20, 2009
816
Things look to be getting over-complex here...

The original request, for an MCU capable of driving a stepper with encoder, limits and sensors does not need an ultra-fast or high-power controller.

A basic PIC16 or PIC18 can easily do that in software.

If you want to do as much in hardware as possible, go for one the the DSPIC series intended for motor control, such as the dsPIC30F2010 - that has both motor PWM (allowing for future flexibility) and quadrature encoder input.

Use one of the larger chips if you need more i/o lines.

For development support, you can use whichever Pickit (2/3) supports that chip, or for more flexibility go for the ICD3 package.
That helped make things clear. LOL.
 

rjenkins

Joined Nov 6, 2005
1,013
To rjenkins, thank you for the advice on mcu's that could work. However, I am still unsure if we will be replacing just the MCU or the entire development board. Is there any way to pick the PIC that is best suited for this task? Would this be a good site to find the correct PIC and purchase it? (http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2556109&k=pic16) Well all the operations should be controlled via computer, so that would be more software oriented (sorry I just don't quite understand if that's what you mean by working in software/hardware)? Also, would the MCU's you listed be programmable with C# on the pc interface (it's a requirement =/).
I'd go for either the dsPIC30F2010 or dsPIC30F4011.
The 2010 is a 28 pin chip, the 4011 is a 40 pin. They have generally similar capabilites but the 4011 has more general I/O pins.

Nothing other than a PC is programmable with C#.
C# is Microsoft's proprietry language so only works on Windows systems.

You can write the PC end of the control link in C# if required, but the actual microcontroller can only be programmed in it's own assembly language or optionally in C.

This may be a reasonable development board:
http://www.microchip.com/stellent/i...E&nodeId=1406&dDocName=en023561&part=DM300018

You could just build on prototyping board / stripboard, but the dev kit is a good long term teaching aid.

You would still need either a PicKit or ICD programming / debugging interface.


For a slightly lower cost setup, you could use the PIC18. Microchip do a full development kit with a PicKit 3 and a dev board, here:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1406&dDocName=en535770
 

retched

Joined Dec 5, 2009
5,207
If you are goint to spend $99 on a dev board, drop the additional $40 and get the BIGPIC6 or the EasyPIC6.

But, you can just as easily control your devices via the PC. You can use a few dollar breakout board for the parallel port and use C#. That way, you dont ned to recieve commands to the PIC then transfer it to the PC program then back out to the PIC over and over.

But, if you are SURE you want to go that route, ok. You are going to have to spend some money if you want somthing more than a Arduino. You need a programmer, and dev board, and software and the such.

The EasyPIC6 has all that for $139. And is expandable to huge lengths.

Talk to your boss. If you are doing this for a one-off project, I dont see the need for the microcontroller. If you want a PC-less design, then yes. Or if you wanted a datalogger that would report to the PC every so often, OK too. But if every command for the uC will be communicated by the PC and ever sensor reading communicated back to the PC, I would skip the uC all together.
 

rjenkins

Joined Nov 6, 2005
1,013
I would advise a separate PicKit or ICD3 programmer/debugger.

That can be used with either a dev kit board or any other PIC based device you build, for in-circuit programming and debugging. All you need to do is add a socket on your prototype to plug the ICD link cable in.

Also, the Microchip PicKit/ICD integrate with MPLab and allow full programming, trace and debugging from within that.
 

thatoneguy

Joined Feb 19, 2009
6,359
Is the "Speed Problem" you mention an issue with the serial port baud rate/date transfer speed, or the speed of the uC controlling the motor and gathering data?

What information needs to be sent to the PC?

If you are using a PC in the loop anyway, you could use the parallel port as digital I/O lines for controlling the motor and reading digital sensors, then have the arduino do only the ADC and send the sensor value over the RS-232 line. Or you could have an 18F series PIC hooked to the USB port and do nearly everything, including sending data to the PC.

Essentially, I'm wondering how much of a role the PC is desired or required to play in the overall system.
 

retched

Joined Dec 5, 2009
5,207
That is basically my concern. It seems to me, the arduino was a way to get the sensor attached to the computer via usb.

And that was the part slowing down the process.
 

Thread Starter

knibknob

Joined Apr 22, 2010
15
Thank you guys very much for your suggestions on development boards, I am sure if we end up using one it will be one of those suggested. However, if I am correct, the entire thing can be controlled by the PC; which means the method of simply connecting the PC to the components via the parallel port actually seems the most logical (Sorry for the overcomplication). However, how would all the parts be connected to the parallel port? I am looking at this site, (http://www.beyondlogic.org/serial/serial.htm) and it looks really confusing. Is it possible to hook up all the parts to a rs232 port, and then connect it to a computer, because obviously we want it to work for any computer, so long as it has the correct software. Thanks for all the help, I should be getting some answers from my mentors in half a day.
 

Thread Starter

knibknob

Joined Apr 22, 2010
15
Thank you all, the advice provided helped a lot. I honestly learned a lot. I think we will be trying to use the parallel port, and simply using the pc instead of the uC. However, later on they may want a stand-alone project, and then the suggested development boards will prove quite useful. Once again, thanks all =D
 
Top