0% found this document useful (0 votes)
16 views15 pages

8051 Microcontroller Basics, STM32CubeIDE, and Use

The document provides an overview of the 8051 microcontroller, including its architecture, features, pin diagram, and applications in various fields such as robotics and automotive. It also introduces the STM32 microcontroller and STM32CubeIDE, highlighting their functionalities and use cases. Additionally, it details the process of interfacing components like LEDs, buttons, and buzzers with the 8051 microcontroller using Keil and Proteus software.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views15 pages

8051 Microcontroller Basics, STM32CubeIDE, and Use

The document provides an overview of the 8051 microcontroller, including its architecture, features, pin diagram, and applications in various fields such as robotics and automotive. It also introduces the STM32 microcontroller and STM32CubeIDE, highlighting their functionalities and use cases. Additionally, it details the process of interfacing components like LEDs, buttons, and buzzers with the 8051 microcontroller using Keil and Proteus software.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 15

8051 Microcontroller Basics,

STM32CubeIDE, and Use Cases


COURS E : A R M - ESD
T EA M MATES :
R AVI L A NGADE 2 0 2 3 0 1 0 60 0 4 6
N ACHI KET MA HA JAN 2 0 2 30 1 0 6 0 047
R A J ME DA NKAR 2 0 2 3 0 1 0 6 0 04 8
Microcontroller architecture
Memory Memory
Introduction to Address bus
Program
8051 CPU
Address bus Program
+ data
CPU
Data Bus
Address bus
Data Bus Data Bus
Data

Von Neuman Architecture HarwardArchitecture

Introduction of 8051 microcontroller Features of 8051 microcontroller


▪ 8051 is a popular microcontroller, also ▪ 4K bytes ROM
called MCS-51.
▪ 128 bytes RAM
▪ Introduced by Intel in 1981.
▪ Initially NMOS-based, later versions ▪ Four 8-bit I/O ports
CMOS-based (80C51). ▪ Two 16-bit timers
▪ 8-bit microcontroller → Processes 8 ▪ Serial interface
bits at a time. ▪ 64K external code memory
▪ Used in embedded systems: space
Robotics, remote controls, automotive, ▪ 64K data memory space
telecom, power tools.
Pin diagram of 8051
▪ The 8051 is a 40 pin device, but out of these 40 pins, 32 are
used for I/O.
▪ 24 of these are dual purpose, i.e. they can operate as I/O or
a control line or as part of address or data bus.
Pins explained :-
Pin Function
Pins 1-8 Port 1 (P1.0 – P1.7) Simple 8-bit I/O port.
Pin 9 RST (Reset) it Resets the microcontroller (active high).
Port 3 (P3.0 – P3.7) I/O port with special functions (e.g., serial, interrupts,
Pins 10-17 timers).
Pins 18-19 XTAL1, XTAL2 Connect to crystal oscillator for clock.
Pin 20 GND Ground (0V).
Pins 21-28 Port 2 (P2.0 – P2.7) I/O or high-order address bus.
Pin 29 PSEN Reads external program memory.
Pin 30 ALE Latch signal for address and data separation.
Pin 31 EA External Access (GND = external memory, VCC = internal).
Pins 32-39 Port 0 (P0.0 – P0.7) I/O or lower-order address/data bus.

Pin 40 VCC Power supply (+5V).


Block diagram of 8051
External interrupts On – chip
ROM for Timer/counter
Interupt programming On – Chip
Timer 1 Counter
Control code RAM Timer 0 Inputs

CPU

OSC Bus Control 4 I/O Ports Serial port

P0 P1 P2 P3 TxD RxD

Address/ Data
Registers used in Timers/counters
▪Two 16-bit Timer Registers: TMOD Register :
▪ Timer 0 & Timer 1. ▪Same TMOD Register for Timer 0 & Timer 1
▪Each 16-bit Timer is divided into two 8-bit ▪It is not Bit Addressible
registers: ▪8 Bit Register :
▪ Timer 0 → TH0 (High Byte) & TL0 (Low ▪ Lower 4-Bits -> Timer 0
Byte) ▪ Upper 4-Bits -> Timer 1
▪ Timer 1 → TH1 (High Byte) & TL1 (Low
Byte) TCON Register :
▪ 8-bit, bit-addressable.
▪TMOD (Timer Mode Register): ▪ Timer & Interrupt Control.
▪ 8-bit register → Selects timer mode. ▪ Main Bits :
▪ TF1, TF0 → Overflow flags.
▪TCON (Timer Control Register): ▪ TR1, TR0 → Timer start/stop.
▪ 8-bit register → Controls timer operations ▪ IE1, IE0 → Interrupt flags.
(e.g., start, stop, overflow). ▪ IT1, IT0 → Interrupt trigger type.
Applications & Uses of 8051
Microcontroller

Robotics Automotive industry Home appliances Industrial automation

Medical devices Security systems Communication systems Power tools


Process of Converting Keil Code to HEX File & Using in
Proteus
Select 8051 Write & Save Add Code File to
Open Keil Create a New Source Group in
Microcontroll Code Project
uVision IDE Project
er (.c or .asm) Workspace
Set Output to
HEX File

Check Create Options for


Output Tab Project
HEX File Target

Compile & Build


(F7 Key)
Place 8051
Generate .HEX Open Proteus Microcontroller
File Design Suite Design Circuit & Other
Components
Double Click on
8051

Browse & Load


Run Simulation
the HEX File
Code on keil software
LED Blinking
interfacing with
8051
microcontroller
using proteus
In this experiment, an LED was
connected to the 8051
microcontroller to learn basic
output control. A code was created
in Keil to blink the LED with a delay.
The code was compiled, and a HEX
file was created. This HEX file was
O/P on Proteus
uploaded to Proteus, and a circuit
was created using the 8051 and LED.
When the simulation was executed,
the LED blinked on and off according
to the program, showing the
operation of 8051 output ports and
timing delays.
Code on keil software
Interfacing a
button with 8051
microcontroller
using proteus

A button was connected to the


8051 microcontroller in this
experiment as an input. A
program was written in Keil to
check if the button was pressed
or not. The HEX file was made O/P on Proteus
and loaded into Proteus. The
circuit was tested by pressing
the button, and it gave the
correct result. This showed how
the 8051 microcontroller reads
inputs through its ports.
Interfacing a
buzzer with 8051
microcontroller
using proteus

A buzzer was connected to the


8051 microcontroller in this
experiment. A program was
written in Keil to turn the buzzer
ON and OFF after some time.
O/P
The HEX file was made and
loaded into Proteus. When the
simulation was run, the buzzer
made a sound, showing how
the 8051 can control a buzzer.
Introduction to Stm 32 & STM-32 CUBE
IDE
STM-32 STM-32 –Cube IDE
32-Bit ARM Cortex Microcontroller Free All-in-One Development Tool

Developed by Stm Electonics C/C++ Code Writing, Compilation, Debugging

High performance, low power Generates Initialization Code Automatically

Used in robotics,,Iot,Automation Integrated Debugger with Real-time Testing

Wide range of series Cross-platform (Windows, Linux, macOS)

Rich Peripherals User-friendly Interface


Pin diagram of STM-32
Pin Name Function
VDD / VSS Power supply pins (VDD = Positive, VSS = Ground).

NRST Reset pin (Active low, restarts the microcontroller).

GPIO General-purpose I/O pins (Input, Output, Analog, Alternate).

OSC_IN / OSC_OUT External clock oscillator input and output pins.

BOOT Selects boot mode (Flash, RAM, or System Memory).

USART / UART Serial communication pins (TX for transmit, RX for receive).

I2C Data (SDA) and Clock (SCL) lines for I2C communication.

SPI Serial communication (MOSI, MISO, SCK, CS).

ADC Analog input pins for Analog-to-Digital Conversion.

PWM Pulse Width Modulation output pins (for motors, LEDs, etc.).

SWD Serial Wire Debug interface (SWDIO, SWCLK) for programming.

VBAT Backup power supply pin for RTC (Real-Time Clock).


Ports are named as PA0, PB1, PC13, etc. (P = Port, Number =
Port Naming Pin).
led blinking
usein stm 32

O/P
Code O/P
4 - led blinking
using stm 32
Code
4 - led blinking
with button using
stm 32

O/P

You might also like