Professional Documents
Culture Documents
Lecture 3 - Additional System Components
Lecture 3 - Additional System Components
OSCILLATOR CIRCUIT
• A microprocessor / microcontroller is a digital
device made up of digital combinational and
sequential circuits.
• The instruction execution of a microprocessor /
controller occurs in sync with a clock signal.
• It is analogous to the heartbeat for the generation of
the beat whereas the oscillator unit is responsible
for generating precise clock for the processor.
WATCHDOG TIMER
• In desktop window system, if user feel application is
behaving in abnormal way or if the system hangs
up, ‘Ctrl+Alt+Del’ take control of the situation.
• In embedded system, watch dog monitor the
firmware execution and reset the system
processor/microcontroller when the program
• Initial condition, Input = LOW(0V), Output = execution hangs up.
HIGH(5V). Current flow from inverter output and • Watch dog is a hardware time for monitoring the
distributed to 1M-ohm and 270-ohm resistor. firmware execution
Current flowing through 270ohm resistor, applied to
crystal, and create positive pulse.
• Since output has higher potential, current flow from
higher potential (5V) and applied to the input.
• Through inverter, output set to LOW.
Two basic approaches are used for Embedded firmware val = map(val, 0, 1023, 0, 180);
design: myservo.write(val);
delay(15);
1. The Super Loop Based Approach
}
2. The Embedded Operating System Based
Approach
Code Sample 3:
int RELAY1 = A0;
The Superloop Based Approach int RELAY2 = A1;
• Adopted for applications that are not time critical int LED1 = 13;
and where the response time is not so important int LED2 = 12;
(embedded systems where missing deadlines are int delayValue = 1000;
acceptable)
void setup() {
• Similar to conventional procedural programming
pinMode(RELAY1, OUTPUT);
where the code is executed task by task. pinMode(LED1, OUTPUT);
• Task listed at the top of the program code is pinMode(RELAY2, OUTPUT);
executed first and tasks just below the top are pinMode(LED2, OUTPUT);
executed after completing the first task.
• In multiple tasks, each task is executed in serial in digitalWrite(RELAY1, HIGH);
this approach. digitalWrite(RELAY2, HIGH);
digitalWrite(LED1, HIGH);
Firmware Execution Flow: digitalWrite(LED2, HIGH);
1. Configure the common parameters and perform Serial.begin(9600);
initialization for various hardware components, }
memory, registers, etc.
2. Start the first task and execute it void loop() {
3. Execute the second task
4. Execute the next task digitalWrite(RELAY1, LOW);
digitalWrite(LED1, HIGH);
5. : Serial.println("RELAY1 ON");
6. : delay(delayValue);
7. Execute the last defined task
8. Jump back to the first task and follow the same flow digitalWrite(RELAY1, HIGH);
digitalWrite(LED1, LOW);
• The order in which the tasks to be executed are Serial.println("RELAY1 OFF");
fixed, and the operation is an infinite loop based
digitalWrite(RELAY2, LOW);
approach
digitalWrite(LED2, HIGH);
Serial.println("RELAY2 ON");
Code Sample 1: delay(delayValue);
float temp;
int tempPin = 0; digitalWrite(RELAY2, HIGH);
digitalWrite(LED2, LOW);
void setup() { Serial.println("RELAY2 OFF");
Serial.begin(9600); }
}
o Java. Known for its “write once, run 3. The investment required is high compared to
anywhere”, commonly used for enterprise Assembly Language based firmware development
application, android app development, and tools.
server-side programming
o C#. Widely used for window applications, Integrating Activity 3
game development, and web development Using https://www.falstad.com/circuit/, simulate the
o C / C++. Used for system programming, reset circuit, brown-out circuit, and oscillator circuit. Add
game development, embedded systems, last 2 digit of student number on the decimal places of
and high-performance applications all capacitors and resistors in the circuit (e.g. 1.36k,
o SQL. Standard language for managing and 10.36pF, 270.36k). Analyze and discuss the observed
querying relational databases. output from the provided circuit. Use the outline below.
o MATLAB. Used in scientific and
engineering fields for numerical computing, I. Reset Circuit
data analysis, and simulation a. Active High (Initial and Toggle State)
• Conversion of source file written in high level b. Active Low (Initial and Toggle State)
language to object file is done by cross-compiler, II. Brown – out Circuit
where as in assembly language based a. VCC is below Zener Threshold Voltage
development, it is carried out by an assembler. b. VCC is above Zener Threshold Voltage
III. Oscillator Circuit
a. No – load capacitors
b. Loaded parallel capacitors