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

KEY
A Type Driven Approach to Functional Design
DOCX
Tugas Kalkulus Diferentiation
PPTX
Penambahan nombor bercampur berlainan penyebut
PPT
Kopfrechnen
PDF
C++ Sobrecarga
PPTX
project - Copy
PDF
Digital voltmeter
PPTX
Led cube
A Type Driven Approach to Functional Design
Tugas Kalkulus Diferentiation
Penambahan nombor bercampur berlainan penyebut
Kopfrechnen
C++ Sobrecarga
project - Copy
Digital voltmeter
Led cube

Viewers also liked (18)

PPTX
Digital Voltmeter part 2
PPTX
Arduino uno lcd display 16x2
PDF
Construction of digital voltmeter by Bapi Kumar Das
PPTX
Digital Voltmeter part 1
PPTX
Multimeter Project-Abby Reisner
PPTX
ATMEGA 328
PPTX
Types of ammeter
PPTX
Input Output programming in AVR microcontroller
PPT
Digital voltmeter project
PDF
Electronic Measurement Beginner's Guide
PPTX
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air berbasis Mik...
PPT
Multimeter
PPT
Digital multimeter
PPTX
Voltmeter
PPTX
Digital voltmeter
PPTX
Introduction to measuring instruments (ALIV - Bangladesh)
PPTX
Presentation on measurements & measurement systems
PPTX
Measuring instruments
Digital Voltmeter part 2
Arduino uno lcd display 16x2
Construction of digital voltmeter by Bapi Kumar Das
Digital Voltmeter part 1
Multimeter Project-Abby Reisner
ATMEGA 328
Types of ammeter
Input Output programming in AVR microcontroller
Digital voltmeter project
Electronic Measurement Beginner's Guide
Sistem Monitoring Digital Penggunaan dan Kualitas Kekeruhan Air berbasis Mik...
Multimeter
Digital multimeter
Voltmeter
Digital voltmeter
Introduction to measuring instruments (ALIV - Bangladesh)
Presentation on measurements & measurement systems
Measuring instruments
Ad

More from Robo India (20)

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

Recently uploaded (20)

PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PPTX
Artificial Intelligence
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
R24 SURVEYING LAB MANUAL for civil enggi
PPTX
Safety Seminar civil to be ensured for safe working.
PDF
Well-logging-methods_new................
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
composite construction of structures.pdf
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
PPT
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
PDF
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
DOCX
573137875-Attendance-Management-System-original
PPTX
Construction Project Organization Group 2.pptx
PDF
Digital Logic Computer Design lecture notes
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
PPTX
UNIT 4 Total Quality Management .pptx
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
CYBER-CRIMES AND SECURITY A guide to understanding
Artificial Intelligence
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Operating System & Kernel Study Guide-1 - converted.pdf
Embodied AI: Ushering in the Next Era of Intelligent Systems
R24 SURVEYING LAB MANUAL for civil enggi
Safety Seminar civil to be ensured for safe working.
Well-logging-methods_new................
bas. eng. economics group 4 presentation 1.pptx
composite construction of structures.pdf
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
Introduction, IoT Design Methodology, Case Study on IoT System for Weather Mo...
Unit I ESSENTIAL OF DIGITAL MARKETING.pdf
573137875-Attendance-Management-System-original
Construction Project Organization Group 2.pptx
Digital Logic Computer Design lecture notes
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
UNIT-1 - COAL BASED THERMAL POWER PLANTS
UNIT 4 Total Quality Management .pptx

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- info@roboindia.com Click here to visit -ROBO INDIA