RESEARCH

Microcontroller overview (Final)

Designing a Circuit



First, Think of what inputs and outputs your circuit will have: switches, sensors,lights, motors, etc. Then you can determine the power requirements. For simplicity, our circuit uses batteries, but a wallwart with a voltage regulator is more reliable.



Next, determine how your inputs will interface with the microcontroller.Some pins take only digital inputs. The general rule for this is that powerbrings the voltage up and ground draws it down. To make a button that changesan input pin from 0 to 1.


Some micro pins take analog as well as digital inputs; you can feed these fromanalog sensors that produce a range of electrical values. For example, a potentiometer'sknob changes its resistance, which changes a voltage fed through it. Connect a pot to a pinthat works as a ADC converter and the micro will convert the current position of the knob into a number you can program with.

An LEd will light up directly from a micro's output pins, but things like motors need more current. You can supply this by connecting an output pin tothe base of a transistor that has a higher current runing through it. Motors may generatevoltage spikes that can damage your chip, but a diode running in reverse across the transistorwill protect the circuit.
Once you know which sensors connect to which types of pins, you need to study your microcontroller's datasheet.As with most micros, pins on the PIC12F675 perform multiple tasks, and you set resisters in your software to tellthe pins how to behave in the resisters table from the PIC12F675 datasheet on Microchip's website.


0 comments:

Post a Comment