SlideShare a Scribd company logo
Single bit oprations in avr microcontroller
If you have forgotten
AND – Multiply OR – ADD
#define SETBIT(ADDRESS,BIT) (ADDRESS |= (1<<BIT))
• Understanding (1<<BIT)
• 1 = 00000001
• BIT = any = 4(Ex)
• 1<<4 = 00000001<<4 (1 is left shifted 4 times)
• (1<<BIT) = 00010000
#define SETBIT(ADDRESS,BIT) (ADDRESS |= (1<<BIT))
• ADDRESS = PORTX = 00100100 (suppose)
• ADDRESS |= (1<<BIT))
⇒ ADDRESS = ADDRESS | (1<<BIT)
• ADDRESS | (1<<BIT) ⇒ 00100100 | 00010000
• Updated ADDRESS = 00110100
Click here to visit -ROBO INDIA
#define CLEARBIT(ADDRESS,BIT) (ADDRESS &=~ (1<<BIT))
• ADDRESS = PORTX = 00110100 (suppose)
• ADDRESS &= ~(1<<BIT))
⇒ ADDRESS = ADDRESS & INVERTED(1<<BIT)
• ADDRESS & ~ (1<<BIT) ⇒ 00110100 & 11101111
• Updated ADDRESS = 00100100
Click here to visit -ROBO INDIA
To share your views and queries please write us-
Website: http://roboindia.com
Email- info@roboindia.com
Click here to visit -ROBO INDIA

More Related Content

Viewers also liked (18)

PPTX
Digital Voltmeter part 2
ruikarsachin
 
PPTX
Arduino uno lcd display 16x2
Robomart India
 
PDF
Construction of digital voltmeter by Bapi Kumar Das
B.k. Das
 
PPTX
Digital Voltmeter part 1
ruikarsachin
 
PPTX
Multimeter Project-Abby Reisner
Areisner
 
PPTX
ATMEGA 328
ABHISHEK MAURYA
 
PPTX
Types of ammeter
sagar parte
 
PPTX
Input Output programming in AVR microcontroller
Robo India
 
PPT
Digital voltmeter project
kaushikbandopadhyay
 
PDF
Electronic Measurement Beginner's Guide
Karim El-Rayes
 
PPTX
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air berbasis Mik...
EM Kautsar
 
PPT
Multimeter
sakti
 
PPT
Digital multimeter
Vivek Pathak
 
PPTX
Voltmeter
Ameenah
 
PPTX
Digital voltmeter
ruikarsachin
 
PPTX
Introduction to measuring instruments (ALIV - Bangladesh)
Md Abu Jauad Khan Aliv
 
PPTX
Presentation on measurements & measurement systems
ROBI Axiata Company Limited
 
PPTX
Measuring instruments
Sayyed Raza
 
Digital Voltmeter part 2
ruikarsachin
 
Arduino uno lcd display 16x2
Robomart India
 
Construction of digital voltmeter by Bapi Kumar Das
B.k. Das
 
Digital Voltmeter part 1
ruikarsachin
 
Multimeter Project-Abby Reisner
Areisner
 
ATMEGA 328
ABHISHEK MAURYA
 
Types of ammeter
sagar parte
 
Input Output programming in AVR microcontroller
Robo India
 
Digital voltmeter project
kaushikbandopadhyay
 
Electronic Measurement Beginner's Guide
Karim El-Rayes
 
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air berbasis Mik...
EM Kautsar
 
Multimeter
sakti
 
Digital multimeter
Vivek Pathak
 
Voltmeter
Ameenah
 
Digital voltmeter
ruikarsachin
 
Introduction to measuring instruments (ALIV - Bangladesh)
Md Abu Jauad Khan Aliv
 
Presentation on measurements & measurement systems
ROBI Axiata Company Limited
 
Measuring instruments
Sayyed Raza
 

Similar to Single bit oprations in avr microcontroller (20)

PDF
Computer Organization & Assembly Language Logic Instructions
specialtoon294
 
PPT
Computer Organization & Assembly Language Logic Instructions
specialtoon294
 
PDF
Bitwise Operations(1).pdf
DalvinCalvin
 
PPTX
Bitwise Operations in Programming
Svetlin Nakov
 
PPTX
Hemanth143
vijaydeepakg
 
ODP
Microcontrollers and embedded devices
Neven Boyanov
 
PPSX
AVR I/O programming Atmega 64 uNiboard ThinkLABS maaniq
Manicka Raja PL
 
PPTX
Bit manipulation
UthraSowrirajan1
 
PDF
04_toggle_n_bits_from_pos.pdf
Emertxe Information Technologies Pvt Ltd
 
PPTX
CA Unit ii
AmirthavalliR
 
PPTX
ECE-3567-Lecture-2-Spring-2025 for beginners
MahmoudElsamanty
 
PPTX
ARITHMETIC FOR COMPUTERS
Amirthavalli Senthil
 
DOCX
Computer organization and architecture lab manual
Shankar Gangaju
 
PPT
How Assembly works, and Logics made in Assembly language
akkhanyar
 
PPTX
assembly language programming organization of IBM PC chapter 9 part-2(decimal...
Bilal Amjad
 
PPTX
Arithmetic and logical instructions 8051 microcontroller
UshaRani289
 
PDF
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Bilal Amjad
 
PPTX
Computer Architecture
Ravi Kumar
 
PPTX
Computer Architecture
Ravi Kumar
 
Computer Organization & Assembly Language Logic Instructions
specialtoon294
 
Computer Organization & Assembly Language Logic Instructions
specialtoon294
 
Bitwise Operations(1).pdf
DalvinCalvin
 
Bitwise Operations in Programming
Svetlin Nakov
 
Hemanth143
vijaydeepakg
 
Microcontrollers and embedded devices
Neven Boyanov
 
AVR I/O programming Atmega 64 uNiboard ThinkLABS maaniq
Manicka Raja PL
 
Bit manipulation
UthraSowrirajan1
 
04_toggle_n_bits_from_pos.pdf
Emertxe Information Technologies Pvt Ltd
 
CA Unit ii
AmirthavalliR
 
ECE-3567-Lecture-2-Spring-2025 for beginners
MahmoudElsamanty
 
ARITHMETIC FOR COMPUTERS
Amirthavalli Senthil
 
Computer organization and architecture lab manual
Shankar Gangaju
 
How Assembly works, and Logics made in Assembly language
akkhanyar
 
assembly language programming organization of IBM PC chapter 9 part-2(decimal...
Bilal Amjad
 
Arithmetic and logical instructions 8051 microcontroller
UshaRani289
 
Assembly Language Programming By Ytha Yu, Charles Marut Chap 7 (Logic, Shift,...
Bilal Amjad
 
Computer Architecture
Ravi Kumar
 
Computer Architecture
Ravi Kumar
 
Ad

More from Robo India (20)

PPTX
Robot Motions
Robo India
 
PDF
Servo Based 5 Axis Robotic Arm Project Report
Robo India
 
PDF
A project report on energy meter monitoring online using wireless transmissio...
Robo India
 
PDF
A project report on wireless energy meter reading using x bee
Robo India
 
PDF
PC Based Industrial Automation With AVR Atmega 16 - Project Report
Robo India
 
PDF
Indian Banks Taglines and Punch Lines
Robo India
 
PPTX
Evaluation of dynamics | Gyroscope, Accelerometer, Inertia Measuring Unit and...
Robo India
 
PDF
Understanding GPS & NMEA Messages and Algo to extract Information from NMEA.
Robo India
 
PPTX
Relay and AVR Atmel Atmega 16
Robo India
 
PPTX
DTMF - Dual Tone Multi Frequency Signaling and AVR Atmel Atmega16multi-freque...
Robo India
 
PPTX
Servo motor and AVR Atmel Atmega 16
Robo India
 
PPTX
IR Sensor Working and Concepts
Robo India
 
PPTX
Digital and Analog IR Sensor Working and Cocepts
Robo India
 
PPTX
ADC - Analog to Digital Conversion on AVR microcontroller Atmega16
Robo India
 
PPTX
LCD Theory and Working Principles
Robo India
 
PPTX
Led Theory and Working Principles
Robo India
 
PPTX
Fundamentals of embedded system and electronics
Robo India
 
PDF
Marketing to youth
Robo India
 
PPTX
C language
Robo India
 
PPT
Concept and algorithm of line follower
Robo India
 
Robot Motions
Robo India
 
Servo Based 5 Axis Robotic Arm Project Report
Robo India
 
A project report on energy meter monitoring online using wireless transmissio...
Robo India
 
A project report on wireless energy meter reading using x bee
Robo India
 
PC Based Industrial Automation With AVR Atmega 16 - Project Report
Robo India
 
Indian Banks Taglines and Punch Lines
Robo India
 
Evaluation of dynamics | Gyroscope, Accelerometer, Inertia Measuring Unit and...
Robo India
 
Understanding GPS & NMEA Messages and Algo to extract Information from NMEA.
Robo India
 
Relay and AVR Atmel Atmega 16
Robo India
 
DTMF - Dual Tone Multi Frequency Signaling and AVR Atmel Atmega16multi-freque...
Robo India
 
Servo motor and AVR Atmel Atmega 16
Robo India
 
IR Sensor Working and Concepts
Robo India
 
Digital and Analog IR Sensor Working and Cocepts
Robo India
 
ADC - Analog to Digital Conversion on AVR microcontroller Atmega16
Robo India
 
LCD Theory and Working Principles
Robo India
 
Led Theory and Working Principles
Robo India
 
Fundamentals of embedded system and electronics
Robo India
 
Marketing to youth
Robo India
 
C language
Robo India
 
Concept and algorithm of line follower
Robo India
 
Ad

Recently uploaded (20)

PDF
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
PPT
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
PDF
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
 
PDF
bs-en-12390-3 testing hardened concrete.pdf
ADVANCEDCONSTRUCTION
 
PPTX
ASBC application presentation template (ENG)_v3 (1).pptx
HassanMohammed730118
 
PDF
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
 
DOCX
Engineering Geology Field Report to Malekhu .docx
justprashant567
 
PDF
Artificial Neural Network-Types,Perceptron,Problems
Sharmila Chidaravalli
 
PDF
Designing for Tomorrow – Architecture’s Role in the Sustainability Movement
BIM Services
 
PDF
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
PPTX
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
PPTX
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
PDF
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
PDF
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
 
PDF
NFPA 10 - Estandar para extintores de incendios portatiles (ed.22 ENG).pdf
Oscar Orozco
 
PPTX
Unit_I Functional Units, Instruction Sets.pptx
logaprakash9
 
PPTX
Kel.3_A_Review_on_Internet_of_Things_for_Defense_v3.pptx
Endang Saefullah
 
PDF
PROGRAMMING REQUESTS/RESPONSES WITH GREATFREE IN THE CLOUD ENVIRONMENT
samueljackson3773
 
PPSX
OOPS Concepts in Python and Exception Handling
Dr. A. B. Shinde
 
13th International Conference of Security, Privacy and Trust Management (SPTM...
ijcisjournal
 
FINAL plumbing code for board exam passer
MattKristopherDiaz
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
June 2025 Top 10 Sites -Electrical and Electronics Engineering: An Internatio...
elelijjournal653
 
bs-en-12390-3 testing hardened concrete.pdf
ADVANCEDCONSTRUCTION
 
ASBC application presentation template (ENG)_v3 (1).pptx
HassanMohammed730118
 
Python Mini Project: Command-Line Quiz Game for School/College Students
MPREETHI7
 
Engineering Geology Field Report to Malekhu .docx
justprashant567
 
Artificial Neural Network-Types,Perceptron,Problems
Sharmila Chidaravalli
 
Designing for Tomorrow – Architecture’s Role in the Sustainability Movement
BIM Services
 
Bayesian Learning - Naive Bayes Algorithm
Sharmila Chidaravalli
 
Stability of IBR Dominated Grids - IEEE PEDG 2025 - short.pptx
ssuser307730
 
Bharatiya Antariksh Hackathon 2025 Idea Submission PPT.pptx
AsadShad4
 
Authentication Devices in Fog-mobile Edge Computing Environments through a Wi...
ijujournal
 
FSE-Journal-First-Automated code editing with search-generate-modify.pdf
cl144
 
NFPA 10 - Estandar para extintores de incendios portatiles (ed.22 ENG).pdf
Oscar Orozco
 
Unit_I Functional Units, Instruction Sets.pptx
logaprakash9
 
Kel.3_A_Review_on_Internet_of_Things_for_Defense_v3.pptx
Endang Saefullah
 
PROGRAMMING REQUESTS/RESPONSES WITH GREATFREE IN THE CLOUD ENVIRONMENT
samueljackson3773
 
OOPS Concepts in Python and Exception Handling
Dr. A. B. Shinde
 

Single bit oprations in avr microcontroller

  • 2. If you have forgotten AND – Multiply OR – ADD
  • 3. #define SETBIT(ADDRESS,BIT) (ADDRESS |= (1<<BIT)) • Understanding (1<<BIT) • 1 = 00000001 • BIT = any = 4(Ex) • 1<<4 = 00000001<<4 (1 is left shifted 4 times) • (1<<BIT) = 00010000
  • 4. #define SETBIT(ADDRESS,BIT) (ADDRESS |= (1<<BIT)) • ADDRESS = PORTX = 00100100 (suppose) • ADDRESS |= (1<<BIT)) ⇒ ADDRESS = ADDRESS | (1<<BIT) • ADDRESS | (1<<BIT) ⇒ 00100100 | 00010000 • Updated ADDRESS = 00110100 Click here to visit -ROBO INDIA
  • 5. #define CLEARBIT(ADDRESS,BIT) (ADDRESS &=~ (1<<BIT)) • ADDRESS = PORTX = 00110100 (suppose) • ADDRESS &= ~(1<<BIT)) ⇒ ADDRESS = ADDRESS & INVERTED(1<<BIT) • ADDRESS & ~ (1<<BIT) ⇒ 00110100 & 11101111 • Updated ADDRESS = 00100100 Click here to visit -ROBO INDIA
  • 6. To share your views and queries please write us- Website: http://roboindia.com Email- [email protected] Click here to visit -ROBO INDIA