Interrupt control logic with five sources of interruptĪll arithmetic and logical functions are carried out by the ALU.Īddition, subtraction with carry, and multiplication come under arithmetic operations. Four general purpose parallel input/output portsħ. Let us see the major components of 8051 microcontroller and their functions.Īn 8051 microcontroller has the following 12 major components:Ħ. The 8051 microcontroller is an 8-bit microcontroller. Pin 40 − This pin is used to provide power supply to the circuit. Lower order address and data bus signals are multiplexed using this port. Pins 32 to 39 − These pins are known as Port 0. It is used to demultiplex the address-data signal of port. Pin 31 − This is ALE pin which stands for Address Latch Enable. It is used to enable/disable the external memory interfacing. Pin 30 − This is EA pin which stands for External Access input. It is used to read a signal from the external program memory. Pin 29 − This is PSEN pin which stands for Program Store Enable. Higher order address bus signals are also multiplexed using this port. Pins 21 to 28 − These pins are known as Port 2. Pin 20 − This pin provides the power supply to the circuit. Pins 18 & 19 − These pins are used for interfacing an external crystal to get the system clock. This port serves some functions like interrupts, timer input, control signals, serial communication signals RxD and TxD, etc. Pins 10 to 17 − These pins are known as Port 3. Pin 9 − It is a RESET pin, which is used to reset the microcontroller to its initial values. It is internally pulled up, bi-directional I/O port. This port doesn’t serve any other functions. Pins 1 to 8 − These pins are known as Port 1. The pin diagram of 8051 microcontroller looks as follows − Problem 4.11: Write a C code that implements ANN machine learning (ML) algorithm to first train with a set of given data in the code, then runs the ANN ML to monitor 3 analog input values (A0–A2) to turn ON/OFF two LEDs (connected to D6–D7).Comparison of Microprocessor and Microcontroller - Block diagram of Microcontroller –Functions of each block - Pin details of 8051 – ALU –ROM– RAM – Memory Organization of 8051 - Special function registers –Program Counter – PSW register – Stack - I/O Ports – Timer – Interrupt – Serial Port – Oscillator and Clock - Clock Cycle – State - Machine Cycle –Instruction cycle – Reset – Power on Reset – Overview of 8051 family Write a code to implement a IIR LPF for a push button input that turns on an LED. Problem 4.9: Write a C code that utilizes timer/counter hardware of ATmega328 of Arduino Uno, employs extended standby sleep mode, and generates an output pulse of 10 Hz through pin 13. Problem 4.8: What are two main type of software buffer? Describe relative advantages and disadvantages. First implement the code with delay function, then implement with Timer2 and PCINT interrupt, with lowest current sleep mode. Problem 4.7: Write a code for a traffic light (using Red, Yellow, Green LEDs) and a pedestrian switch (using a push button). Write another code using bitmath to toggle the pin 5 output value. Problem 4.6: Write a bitmath code to set the digital pin 5 to output mode without changing any other pin modes. Problem 4.5: What is time service? What module you will need for time service in Arduino Uno? Why interrupt is suitable for sleeping modes? Problem 4.4: Describe the 6 sleeping modes of Arduino Uno in order of lower current consumption. Provide two examples where each of them is more suitable. Problem 4.3: What are different queueing mechanisms in ES? Discuss relative advantages and disadvantages. Display the temperature readings on an LCD display. The analog data from the sensor must be converted to Fahrenheit and Centigrade. Problem 4.2: Write an Arduino Uno code for Temperature measurement with a thermistor. Problem 4.1: Write an Arduino Uno code for Morse Code of "SOS" by blinking the internal LED (connected to Pin 13).