Io Ports - Communication
Io Ports - Communication
Io Ports - Communication
void loop()
{
if (duty_cycle<=255)
{
analogWrite(motor, duty_cycle);
delay(3000);
duty_cycle++;
}
}
• Parallel Port Input- multi-bit
ADC input from liquid level measuring sensor or
temperature sensor or pressure sensor Encoder inputs
for bits for angular position of a rotating shaft or a
linear displacement of an object.
Parallel Port Output- multi-bit
• LCD controller - display on the screen the
phone number, time, messages, character
outputs
• Stepper-motor coil driving bits
• The processing element at the port (peripheral)sends and receives the byte at a
port register to or from where the microprocessor writes or reads the byte
UART
UART
• Does not receive the clock pulses or clock
information along with the bits.
• Each bit is received in each byte at fixed
intervals but each received byte is not in
synchronization.
• Bytes separate by the variable intervals or
phase differences.
• Minimum separation is 1 stop bit interval TxD.
1 Start bit Interval RXD
The control signals are implemented mainly for modem
communication and some of them may be irrelevant for
other type of devices.
The Request to Send (RTS) and Clear To Send (CTS) signals
co-ordinate the communication between DTE and DCE.
Whenever the DTE has a data to send, it activates the RTS
line and if the DCE is ready to accept the data, it activates
the CTS line.
The Data Terminal Ready (DTR) signal is activated by DTE
when it is ready to accept data.
The Data Set Ready (DSR) is activated by DCE when it is
ready for establishing a communication link.
DTR should be in the activated state before the activation
of DSR.
The Data Carrier Detect (DCD) is used by the DCE to
indicate the DTE that a good signal is being received.
Communication Interface
The communication interface can be viewed in
two different perspectives
• As per EIA standard, a logic „0‟ is represented with voltage between +3 and
+25V and a logic „1‟ is represented with voltage between -3 and -25V.
• In EIA standard, logic „0‟ is known as “Space‟ and logic „1‟ as “Mark‟.
• The RS232 interface define various handshaking and control signals for
communication apart from the „Transmit‟ and „Receive‟ signal lines for
data communication
• Bluetooth is a low cost, low power, short range wireless technology for data
and voice communication.
• Bluetooth supports point-to-point (device to device) and point-to-multipoint
(device to multiple device broadcasting) wireless communication.
• one Bluetooth device as master and more than one device as slaves, it is
called a Piconet.
• A Piconet supports a maximum of seven slave devices.
• A Wi-Fi network is identified with a Service Set Identifier (SSID). A Wi-Fi device
can connect to a network by selecting the SSID of the network and by providing
the credentials if the network is security enabled.
Real Time Clock
• A real-time clock (RTC) is a computer clock, usually in the form of
an integrated circuit that is solely built for keeping time.
• Real tome clock is a clock that occurrences of regular interval
interrupts on each tick.
• An Interrupt Service Routine Executes on each time out(overflow)
of this clock.
• This Timing Device once Started never Resets or never reloaded
with another value.
• Once it is set, It is not modified Later
• They usually interface to a microprocessor circuit by an SPI or I2C
serial bus.
• An RTC maintains its clock by counting the cycles of an oscillator –
usually an external 32.768kHz crystal oscillator circuit, an internal
capacitor based oscillator
WatchDog Timer
• Watch Dog Timer is Hardware Timer for monitoring Firmware
Execution.
• If the firmware execution does not complete due to malfunctioning
within the time required by watch dog to reach the maximum
count.
• The counter will generate the reset pulse, it will reset the processor.
• If the Firmware execution completes before expiration of watchdog
timer, you can resetting the counter by writing ‘0’.
Example:
• Assume that we anticipate that a set of tasks must finish in
100ms interval.
• The Watchdog timer disabled and stopped by the program
instruction in case the tasks finish within 100ms interval
• If task does not finish, Watchdog timer generated interrupts
after 100ms and executes a routine.
Application -1:
Mobile phone display is OFF in case of NO GUI interaction
takes place within a watched time interval.
i.e; 10 Sec, 15 Sec..30 Sec. It saves Power
Application – 2:
• An application in temperature controller is that if
controller No action to switch off the current within the
preset watched Interval
• The Current is switched off and warning signal raised as
indication of controller failure.
• Failure to switch off current may burst a boiler in which
water is heated