Professional Documents
Culture Documents
Embedded 2
Embedded 2
Embedded 2
• Serial communication sends data bit by bit over a single channel, while
parallel communication sends multiple bits at the same time over multiple
channels.
1.Serial Communication: This refers to the method of transferring data one bit at a
time sequentially over a communication channel or computer bus. In serial
communication, data is transmitted using a single communication line, which reduces
the number of wires required for communication compared to parallel
communication. Serial communication can occur over various physical mediums such
as wires, optical fibers, or even wirelessly.
2.Serial Communication Protocol: A protocol defines the rules and conventions for
communication between devices. In the context of serial communication, a protocol
specifies how data is framed, encoded, transmitted, received, and interpreted. It
includes details such as start and stop bits, baud rate (data transmission speed), error
detection and correction mechanisms, data packet structure, and flow control.
Popular serial communication protocols include UART (Universal Asynchronous
Receiver/Transmitter), SPI (Serial Peripheral Interface), I2C (Inter-Integrated Circuit),
RS-232, and RS-485.
Bus Protocols
four-cycle handshake
enq ack
• The microprocessor obviously is not used as a single unit.
• I/O interfacing is the link between the processor or CPU and the
various I/O peripherals such as the keyboard, printer, mouse, etc. Such
type of interfacing is referred to as I/O Interfacing.
When we want to count events, we connect external event (e.g. event : rising edge
or falling edge) source to input pin of timer/counter module.
When external event occurs the value of counter increments.
Value of counter represents no. of external events.
E.g. A IR sensor is connected to wheel of vehicle, to calculate speed to vehicle. For
1 rotation of wheel sensor gives 100 pulses. So in this case counter will come in
picture and let us assume counter is configured to calculate events for rising edge.
counter will calculate no. of input pulses.
Timer:
1. A timer uses the frequency of the internal clock, and generates delay.
2. The register incremented for every machine cycle
3. Maximum count rate is 1/12 of the oscillator frequency.
Counter:
1. A counter uses an external signal to count pulses.
2. The register is incremented considering 1 to 0 transition at its
corresponding to an external input pin (T0, T1).
3. Maximum count rate is 1/24 of the oscillator frequency.
A watchdog timer (WDT) is a timer that monitors microcontroller (MCU)
programs to see if they are out of control or have stopped operating. It acts as a
“watchdog” watching over MCU operation. (or)
Generally speaking, a watchdog timer is based on a counter that counts down from
some initial value to zero. The embedded software selects the counter’s initial value
and periodically restarts it. If the counter ever reaches zero before the software
restarts it, the software is presumed to be malfunctioning and the processor’s reset
signal is asserted. The processor (and the embedded software it’s running) will be
restarted as if a human operator had cycled the power.
As shown, the watchdog timer is a chip external to the processor. However, it could
also be included within the same chip as the CPU. This is done in many
microcontrollers. In either case, the output from the watchdog timer is tied directly
to the processor’s reset signal.
Interrupt
Interrupt Service Routine (ISR) or Interrupt Handler
Hardware Interrupt
Software Interrupt
Polling
Steps to Execute an Interrupt
When an interrupt gets active, the microcontroller goes through the following
steps −
• The microcontroller closes the currently executing instruction and saves the
address of the next instruction (PC) on the stack.
• It also saves the current status of all the interrupts internally (i.e., not on the
stack).
• It jumps to the memory location of the interrupt vector table that holds the
address of the interrupts service routine.
• The microcontroller gets the address of the ISR from the interrupt vector
table and jumps to it. It starts to execute the interrupt service subroutine,
which is RETI (return from interrupt).
• Upon executing the RETI instruction, the microcontroller returns to the
location where it was interrupted. First, it gets the program counter (PC)
address from the stack by popping the top bytes of the stack into the PC.
Then, it start to execute from that address.
Edge Triggering vs. Level Triggering
Interrupt modules are of two types − level-triggered or edge-triggered.
If the interrupt source is still asserted when the Edge-triggered interrupt modules can be acted
firmware interrupt handler handles the interrupt, immediately, no matter how the interrupt source
the interrupt module will regenerate the interrupt, behaves.
causing the interrupt handler to be invoked again.
Latency
The interrupt latency is the interval of time measured from the instant an
interrupt is asserted until the corresponding ISR begins to execute. The worst-
case latency for any given interrupt is a sum of many things, from longest to
shortest:
Standby Power
Peripheral Power
Battery Life
Mixed-signal integrated circuit
The particular challenges of mixed signal include:
• CMOS technology is usually optimal for digital performance and scaling
while bipolar transistors are usually optimal for analog performance, yet until
the last decade it has been difficult to either combine these cost-effectively or
to design both analog and digital in a single technology without serious
performance compromises. The advent of technologies like high
performance CMOS, BiCMOS, CMOS SOI and SiGe have removed many of
the compromises that previously had to be made.
• Testing functional operation of mixed-signal ICs remains complex, expensive
and often a "one-off" implementation task.
• Systematic design methodologies comparable to digital design methods are
far more primitive in the analog and mixed-signal arena. Analog circuit design
can not generally be automated to nearly the extent that digital circuit design
can. Combining the two technologies multiplies this complication.
• Fast-changing digital signals send noise to sensitive analog inputs. One path
for this noise is substrate coupling. A variety of techniques are used to attempt
to block or cancel this noise coupling, such as fully differential amplifiers,[5] P+
guard-rings,[6] differential topology, on-chip decoupling, and triple-well
isolation.[7]