When reading pin state it is often needed to react very fast on pin state change.
For this purpose external interrupt is used. External interrupt occurs when dedicated pin changes state. It can be triggered on rising, falling, or both edges of signal state. In this example we will use external interrupt of AVR microcontroller INT0.
Using PWM with microcontroller is often needed in projects. Whether you want fine control of electromotor speed, or you want to change intensity of LED lamp or you simply need analog output and do not want to buy expensive Digital/Analog converter (DAC), PWM is ideal solution. In this example we will show how to configure and change parameters of PWM output on AVR microcontroller.
In electronics, a switch is an electrical component that can break an electrical circuit, interrupting the current or diverting it from one conductor to another. A switch may be directly manipulated by a human as a control signal to a system, such as a computer keyboard button, or to control power flow in a circuit, such as a light switch. Automatically operated switches can be used to control the motions of machines, for example, to indicate that a garage door has reached its full open position or that a machine tool is in a position to accept another workpiece. Switches may be operated by process variables such as pressure, temperature, flow, current, voltage, and force, acting as sensors in a process and used to automatically control a system.
There are a lot of types of switches. We will explain a few common used in microcontroller based systems.
The Universal Asynchronous Receiver Transmitter (UART) module is one of the serial I/O modules available in the dsPIC30F device family. The UART is a full-duplex asynchronous system that can communicate with peripheral devices, such as personal computers, RS-232 and RS-485 interfaces.
The primary features of the UART module are: