By Solid State Workshop. ● A microcontroller is an integrated circuit that is programmed to do a...

Preview:

Citation preview

By Solid State WorkshopBy Solid State Workshop

A microcontroller is an A microcontroller is an integrated circuit that is integrated circuit that is programmed to do a specific programmed to do a specific task. task.

Microcontrollers are really Microcontrollers are really just just “ “mini-computers”.mini-computers”.

Microcontrollers are hidden in tons of Microcontrollers are hidden in tons of appliances, appliances, gadgets, and other gadgets, and other electronics.electronics.

They’re They’re everywhere! everywhere!

MicrocontrollerMicrocontroller19711971

Logic GateLogic Gate19601960

TransistorTransistor19471947

Vacuum TubeVacuum Tube 19391939

SpeeSpeedd

Very Very fastfast

Relatively slowRelatively slow

ApplicatioApplicationsns

General computing General computing (i.e. Laptops, tablets)(i.e. Laptops, tablets)

Appliances, Appliances, specialized devices specialized devices

External External PartsParts

ManManyy

FeFeww

CosCostt

HigHighh

LoLoww

Energy Energy UseUse

Medium to Medium to highhigh

Very low to Very low to lowlow

VendorVendorss

MicroprocessorMicroprocessor

ClockClock

Peripheral BusPeripheral Bus

RAMRAM Data StorageData Storage

SPI, USBSPI, USB DAC,ADCDAC,ADC EthernetEthernet SD/MMCSD/MMC

System BusSystem Bus

Processor CoreProcessor Core

ClockClock

Peripheral BusPeripheral Bus

RAMRAM Data StorageData Storage

SPI, USBSPI, USB DAC,ADCDAC,ADC EthernetEthernet SD/MMCSD/MMC

System BusSystem Bus

Microcontrollers are used for specific applications.Microcontrollers are used for specific applications. They do not need to be powerful because most They do not need to be powerful because most applications only require a clock of a few MHz and applications only require a clock of a few MHz and small amount of storage.small amount of storage. A microcontroller needs to be programmed to be A microcontroller needs to be programmed to be useful.useful. A microcontroller is only as useful as the code A microcontroller is only as useful as the code written for it. If you wanted to turn on a red light when written for it. If you wanted to turn on a red light when a temperature reached a certain point, the a temperature reached a certain point, the programmer would have to explicitly specify how that programmer would have to explicitly specify how that will happen through his codewill happen through his code..

1.) Code is written for the microcontroller in an integrated 1.) Code is written for the microcontroller in an integrated development environment, a PC program. The code is written in a development environment, a PC program. The code is written in a programming language. (e.g. C, BASIC or Assembly).programming language. (e.g. C, BASIC or Assembly).

2.) The IDE debugs the code for errors, and then compiles it into 2.) The IDE debugs the code for errors, and then compiles it into binary code which the microcontroller can execute.binary code which the microcontroller can execute.

3.) A programmer (a piece of hardware, not a person) is used to 3.) A programmer (a piece of hardware, not a person) is used to transfer the code from the PC to the microcontroller. The most transfer the code from the PC to the microcontroller. The most common type of programmer is an ICSP (In-circuit serial common type of programmer is an ICSP (In-circuit serial programmer).programmer).

Just about every modern microcontroller contains an Just about every modern microcontroller contains an ADC(s).ADC(s). It converts analog voltages into digital values.It converts analog voltages into digital values.

These digital representations of the signal at hand can These digital representations of the signal at hand can be analyzed in code, logged in memory, or used in be analyzed in code, logged in memory, or used in practically any other way possible.practically any other way possible.

PTC

5V

μC ADC

PTC Specifications:

100Ω @ 25+ 1Ω/ 1

(ex. @ 26, R = 101Ω 24, R = 99Ω

Void Loop()Void Loop()

voltage25C = 512voltage25C = 512voltageADC = ADC.input(pin1)voltageADC = ADC.input(pin1)

ratio = voltageADC / voltage25Cratio = voltageADC / voltage25Ctemperature = ratio * 25 temperature = ratio * 25

A 10-bit ADC will represent a voltage between 0 to 5 as a number between 0 to 1024.

codecode

You guessed it! Microcontrollers have You guessed it! Microcontrollers have accompanying DACs.accompanying DACs.

It does exactly the opposite function of an ADC. It It does exactly the opposite function of an ADC. It takes a digital value and converts it into an pseudo-takes a digital value and converts it into an pseudo-analog voltage.analog voltage.

It can be used to do an enormous amount of things. It can be used to do an enormous amount of things. One example is to synthesize a waveform. We can One example is to synthesize a waveform. We can create an audio signal from a microcontroller. Imagine create an audio signal from a microcontroller. Imagine that!that!

This is the controller This is the controller board for a washing board for a washing machine. If a button is machine. If a button is pushed or if a knob is pushed or if a knob is turned, the microcontroller turned, the microcontroller knows how to react to the knows how to react to the event.event.

Ex. If “start” is pushed, Ex. If “start” is pushed, the microcontroller knows the microcontroller knows to switch a relay which to switch a relay which starts the motor.starts the motor.

This is the main This is the main controller from a Buick controller from a Buick Regal. This board has Regal. This board has several microcontrollers several microcontrollers each for a specific task.each for a specific task.

Ex. A microcontroller Ex. A microcontroller may handle dashboard may handle dashboard controls or it may even controls or it may even control something more control something more complex like the ignition complex like the ignition system.system.

Many robots use Many robots use microcontrollers to allow microcontrollers to allow robots to interact with the robots to interact with the real world.real world.

Ex. If a proximity sensor Ex. If a proximity sensor senses an object near by, senses an object near by, the microcontroller will know the microcontroller will know to stop its motors and then to stop its motors and then find an unobstructed path.find an unobstructed path.

BGABGA (Ball Grid Array)(Ball Grid Array)

Surface MountSurface Mount100 pins100 pins

6mm x 6mm6mm x 6mm2.78pins/mm2.78pins/mm22

QFPQFP (Quad Flat (Quad Flat Package)Package)

Surface MountSurface Mount32 pins32 pins

7mm x 7mm7mm x 7mm0.65pins/mm0.65pins/mm22

SOICSOIC (Small Outline IC)(Small Outline IC)

Surface MountSurface Mount18 pins18 pins

11mm x 7mm11mm x 7mm0.23pins/mm0.23pins/mm22

DIPDIP (Dual Inline Packag(Dual Inline Packagee))

Through holeThrough hole8 pins8 pins

9mm x 6mm9mm x 6mm0.15pins/mm0.15pins/mm22

If you want to develop If you want to develop for microcontrollers, you for microcontrollers, you can purchase a can purchase a development board development board which includes a which includes a microcontroller and all microcontroller and all of the necessary parts to of the necessary parts to get it working. (i.e. get it working. (i.e. power supply and a USB power supply and a USB interface)interface)

I’d love to hear your feedback!I’d love to hear your feedback!Thank you.Thank you.

Recommended