Mech Microcontroller
Mech Microcontroller
Microcontrollers are used in a wide array of systems and devices. Devices often utilize multiple
microcontrollers that work together within the device to handle their respective tasks.
For example, a car might have many microcontrollers that control various individual systems
within, such as the anti-lock braking system, traction control, fuel injection or suspension
control. All the microcontrollers communicate with each other to inform the correct actions.
Some might communicate with a more complex central computer within the car, and others
might only communicate with other microcontrollers. They send and receive data using their I/O
peripherals and process that data to perform their designated tasks.
Memory -- A microcontroller's memory is used to store the data that the processor receives
and uses to respond to instructions that it's been programmed to carry out. A microcontroller
has two main memory types:
1. Program memory, which stores long-term information about the instructions that the
CPU carries out. Program memory is non-volatile memory, meaning it holds information
over time without needing a power source.
2. Data memory, which is required for temporary data storage while the instructions are
being executed. Data memory is volatile, meaning the data it holds is temporary and is
only maintained if the device is connected to a power source.
I/O peripherals -- The input and output devices are the interface for the processor to the
outside world. The input ports receive information and send it to the processor in the form of
binary data. The processor receives that data and sends the necessary instructions to output
devices that execute tasks external to the microcontroller.
While the processor, memory and I/O peripherals are the defining elements of the
microprocessor, there are other elements that are frequently included. The term I/O
peripherals itself simply refers to supporting components that interface with the memory and
processor. There are many supporting components that can be classified as peripherals. Having
some manifestation of an I/O peripheral is elemental to a microprocessor, because they are the
mechanism through which the processor is applied.
Analog to Digital Converter (ADC) -- An ADC is a circuit that converts analog signals to
digital signals. It allows the processor at the center of the microcontroller to interface with
external analog devices, such as sensors.
Digital to Analog Converter (DAC) -- A DAC performs the inverse function of an ADC and
allows the processor at the center of the microcontroller to communicate its outgoing signals
to external analog components.
System bus -- The system bus is the connective wire that links all components of the
microcontroller together.
Serial port -- The serial port is one example of an I/O port that allows the microcontroller to
connect to external components. It has a similar function to a USB or a parallel port but
differs in the way it exchanges bits.
Microcontroller features
A microcontroller's processor will vary by application. Options range from the simple 4-bit, 8-bit
or 16-bit processors to more complex 32-bit or 64-bit processors. Microcontrollers can use
volatile memory types such as random access memory (RAM) and non-volatile memory types --
this includes flash memory, erasable programmable read-only memory (EPROM) and
electrically erasable programmable read-only memory (EEPROM).
MCUs feature input and output pins to implement peripheral functions. Such functions include
analog-to-digital converters, liquid crystal display (LCD) controllers, real-time clock (RTC),
universal synchronous/asynchronous receiver transmitter (USART), timers, universal
asynchronous receiver transmitter (UART) and universal serial bus (USB) connectivity. Sensors
gathering data related to humidity and temperature, among others, are also often attached to
microcontrollers.
Types of microcontrollers
Common MCUs include the Intel MCS-51, often referred to as an 8051 microcontroller, which
was first developed in 1985; the AVR microcontroller developed by Atmel in 1996; the
programmable interface controller (PIC) from Microchip Technology; and various licensed
Advanced RISC Machines (ARM) microcontrollers.
Microcontroller applications
Microcontrollers are used in multiple industries and applications, including in the home and
enterprise, building automation, manufacturing, robotics, automotive, lighting, smart energy,
industrial automation, communications and internet of things (IoT) deployments.
One very specific application of a microcontroller is its use as a digital signal processor.
Frequently, incoming analog signals come with a certain level of noise. Noise in this context
means ambiguous values that cannot be readily translated into standard digital values. A
microcontroller can use its ADC and DAC to convert the incoming noisy analog signal into an
even outgoing digital signal.
The distinction between microcontrollers and microprocessors has gotten less clear as chip
density and complexity has become relatively cheap to manufacture and microcontrollers have
thus integrated more "general computer" types of functionality. On the whole, though,
microcontrollers can be said to function usefully on their own, with a direct connection to
sensors and actuators, where microprocessors are designed to maximize compute power on the
chip, with internal bus connections (rather than direct I/O) to supporting hardware such as RAM
and serial ports. Simply put, coffee makers use microcontrollers; desktop computers use
microprocessors.
Microcontrollers are less expensive and use less power than microprocessors. Microprocessors
do not have built-in RAM, read-only memory (ROM) or other peripherals on the chip, but rather
attach to these with their pins. A microprocessor can be considered the heart of a computer
system, whereas a microcontroller can be considered the heart of an embedded system.
Choosing the right microcontroller
There are a number of technology and business considerations to keep in mind when choosing a
microcontroller for a project.
Beyond cost, it is important to consider the maximum speed, amount of RAM or ROM, number
or types of I/O pins on an MCU, as well as power consumption and constraints and development
support. Be sure to ask questions such as:
Introduction to PIC16F84
PIC16F84 belongs to a class of 8-bit microcontrollers of RISC architecture. Its general structure
is shown on the following map representing basic blocks. Program memory (FLASH)- for
storing a written program. Since memory made in FLASH technology can be programmed and
cleared more than once, it makes this microcontroller suitable for device development. EEPROM
- data memory that needs to be saved when there is no supply. It is usually used for storing
important data that must not be lost if power supply suddenly stops. For instance, one such data
is an assigned temperature in temperature regulators. If during a loss of power supply this data
was lost, we would have to make the adjustment once again upon return of supply.
Thus our device looses on self-reliance. RAM - data memory used by a program during its
execution. In RAM are stored all inter-results or temporary data during run-time. PORTA and
PORTB are physical connections between the microcontroller and the outside world. Port A has
five, and port B has eight pins. FREE-RUN TIMER is an 8-bit register inside a microcontroller
that works independently of the program. On every fourth clock of the oscillator it increments its
value until it reaches the maximum (255), and then it starts counting over again from zero. As we
know the exact timing between each two increments of the timer contents, timer can be used for
measuring time which is very useful with some devices. CENTRAL PROCESSING UNIT has a
role of connective element between other blocks in the microcontroller. It coordinates the work
of other blocks and executes the user program.
Applications
PIC16F84 perfectly fits many uses, from automotive industries and controlling home appliances
to industrial instruments, remote sensors, electrical door locks and safety devices. It is also ideal
for smart cards as well as for battery supplied devices because of its low consumption.
EEPROM memory makes it easier to apply microcontrollers to devices where permanent storage
of various parameters is needed (codes for transmitters, motor speed, receiver frequencies, etc.).
Low cost, low consumption, easy handling and flexibility make PIC16F84 applicable even in
areas where microcontrollers had not previously been considered (example: timer functions,
interface replacement in larger systems, coprocessor applications, etc.).
In System Programmability of this chip (along with using only two pins in data transfer) makes
possible the flexibility of a product, after assembling and testing have been completed. This
capability can be used to create assembly-line production, to store calibration data available only
after final testing, or it can be used to improve programs on finished products.
Pin description
PIC16F84 has a total of 18 pins. It is most frequently found in a DIP18 type of case but can also
be found in SMD case which is smaller from a DIP. DIP is an abbreviation for Dual In Package.
SMD is an abbreviation for Surface Mount Devices suggesting that holes for pins to go through
when mounting, aren't necessary in soldering this type of a component.
Pins on PIC16F84 microcontroller have the following meaning: