In: Electrical Engineering
thanks alot! Scenario: You are a development engineer at a toy company that manufactures remote control cars using microcontrollers. Your R&D team is currently working on designing a new line of remote control cars, which requires your knowledge to make certain design decisions. The new design has the following requirements:
- Driving a motor for the wheels
- Buttons on the remote control to accelerate, brake and reverse
- LEDs to indicate forward and reverse
You are required to determine the appropriate microcontroller for this project
(Task 1) For this task, you are required to perform the following: Compare one member of each of the PIC12, PIC16, PIC18, PIC24 and dsPIC families (datasheets are available at http://www.microchip.com/doclisting/TechDoc.aspx?type=datasheet) and determine which is the most economical option to meet the project requirements. You must give an indication of the following metrics: clock speed, internal architecture, on-board memory, IO ports, instruction size, interrupt capabilities, additional features, cost and physical size.
(D1) Provide proper engineering justification. You must develop proper system requirements and show how your microcontroller and external hardware selection would meet the design requirements. Select the microcontroller which would be ideal for this project, show how you developed the system requirements and what they are, and justify your microcontroller selection.
The specifications needed for this project are very minimal.
As it is a toy, we don't need a microcontroller with very high processing power. Not much calculation or signal processing is required for the project. So the option of DSPIC is eliminated. By the way, the cost of DSPIC is very high compared to normal PIC microcontroller. Also, PIC24 is a 16-bit microcontroller family from microchip which has a higher clock speed and intended for more sophisticated works like graphics processing and mobile phones.
Let us analyze the no of pins and other requirements for the project before going to the selection of the microcontroller.
processing power: minimal
minimum no of input pins required: We have three inputs namely forward, reverse and brake. So we can manage with 2 input pins (in binary, two bits can represent a maximum of four different inputs 00 01 10 and 11).
Minimum no of output pins required: We need 3 output pins to represent 3 different modes of operation ( note that the LED's and motors can be controlled by a single pin for each mode i.e forward control of the motor and turning ON of forward indication LED requires only one LED).
8-bit/16-bit: There is no need of 16-bit microcontroller.8 bit microcontroller is sufficient.
on-board memory requirement: The code is obviously going to be small as it is a toy and not a critical application and also the no of modes of operations and functionality needed is minimal.
Interrupt capabilities: We don't need any interrupt for this application and the reason again is the application is not very critical and the code is small so that we can have satisfactory working with polling instead of the interrupt.
size constraints: As the application is a toy, we need to select a microcontroller which is as small as possible so that the size of the toy is small.
Now let's start the selection of microcontroller
PIC12 is a basic series. So the cost is LOW. It is available in 8 PIN DIP package so the size is also small. If we were able to meet our requirement using PIC12 then we need not even look at 16 and 18 series as the cost is more, sizes are more ( PIC16 is available in a minimum size of 20 pin DIP package)
Two of the options DSPIC, PIC24 were eliminated. So we were left with PIC12, PIC16, PIC18.
PIC12 has 8 pins. you can just type in pic12 pinout in google to find out (I cannot provide pinout due to copyright reasons). We have a 5 pin port of which 1 pin is for clock. Again as the application is a toy, We can use the internal clock which is available in the PIC12 to save one pin and also avoid external clock circuitry thereby reducing the size of the circuit.
So We have 5 pins also we only need 5 pins (2 for input, 3 for output) as mentioned above.
The clock speed of 4MHZ is sufficient for the application mentioned.
So we can use PIC12 for this particular application.
Hope you like the explanation and give a thumbs up