SlideShare uma empresa Scribd logo
1 de 58
PROGRAMMING A ROBOT USING ICC AVR Ver 7.5
ICC AVR ver 7.5 ICC AVR is a tool used to program Atmel microcontrollers. It uses a C compiler to compile the high level code into a low level code. ICC AVR then converts this low level code into HEX code. It also has built in tools to program the flash memory of the microcontroller.
HOW TO INSTALL ICC AVR ver 7.5
ICC AVR ver 7.5 is not a freeware and thus you have to purchase it. But 45 days trial versions are available on the net and they give almost the same features. Thus download the setup of the trial version from the site : http://www.imagecraft.com/ Run the setup and install ICC AVR ver 7.5
HOW TO USE ICC AVR ver 7.5
H BRIDGE PIN-OUT
L293D IN1 IN2 EN1 PC2 PC3 PC4 PC5 PC6 PC7 OUT1 OUT2 OUT3 OUT4 A T M E G A  1 6 IN3 IN 4 EN2
IMPORTANT STUFF….
Input Output PORTS • Four, 8 bit I/O ports- PORT A,B,C,D • All I/O ports pins are bidirectional and can be configured individually • Input pins can be configured to utilize internal pullups. • Data Direction Register , DDRn • Port Driver Register, PORTn • Port Pin Register, PINn
Data Direction Register, DDRn • Determines the direction of individual pins of ports • If the bit of the DDR is set the corresponding pin of the port is configured as output pin • If the bit of the DDR is cleared the corresponding pin of the port is configured as input pin • DDRA = 0xF0; • 4 MSB pins of PORTA are output pins • 4 LSB pins of PORTA are input pins
Port Pin Register, PINn • Reading the input pins of port is done by reading PIN register • Temp = PINA; • Read the PORTA input and store in temp variable
Port Drive Register, PORTn • For pins configured as input (DDRn[x] = 0) microcontroller connects a internal pull up register if the corresponding bit of PORTn is set • If the PORTn bit is cleared, pin is Tristated • DDRA = 0x00; • PORTA = 0xF0
Buzzer On / OFF • PORT B pin 7 • Pin is configured as output • DDRB= 0x80; • To turn on the buzzer output high • PORTB = 0x80; • To turn off the buzzer output low • PORTB = 0x00;
Buzzer Function void Buzzer_ON(void) { PORTB = 0x80; } void Buzzer_OFF(void) { PORTB = PORTB & 0x7F; }
LED DISPLAY 8 bit LED display is connected to PORTD. To display any bit combination on the LED display, we use…    PORTD=0xXX;
CODE FOR LED DISPLAY void main(void) { init_devices();  while(1)  {   PORTD=0xFF;  } }
Analog To Digital Converter • 10 bit resolution • 8 channels • PORTA(0 – 7) • Disable internal pull up • ADCH & ADCL – Data       Register • ADMUX- Channel Select Register • ADCSR – Control & Status Register
unsigned char ADC_conversion (unsigned char ADC_channel_number)  {	 			  unsigned inti = 0;  ADCH = 0x00; i = ADC_channel_number & 0x0F; // keeping the loweatnibbel  ADMUX = i | 0x20; //upper nibbel of 0x20 indicates the result is left adjusted (8 bit ADC conversion)  ADCSR |= 0x40;  for (i = 1; i < 255; i++); //delay of 93.2 uS i = ADCH;  return (i); } void main(void) {    unsigned char I, value[3];;    for(i=0;i<3;i++)    {        value[i]=ADC_conversion(i);    } }
HOW TO COMPILE AND BUILD YOUR CODE
After you program your robot, it is ready to run the code written onto the microcontroller. So just power on the microcontroller and it will start the execution of the code.
MOTION CONTROL AND LINE FOLLOWING
PORT CONFIGURATION PORTA is ADC port. 3 white line sensors are connected to pin1, pin2, pin 3 of PORTA. PORTC is connected to the H-bridge.
CODE FOR MOTION            void delay(int time)            { inti,j;  for(i=0;i<time;i++)  for(j=0;j<500;j++);}void backward(void)  // subroutine for backward motion{ PORTC=0xB4; delay(100);}void right(void)    // subroutine for right motion{ PORTC=0xB8; delay(100);}void left(void)    // subroutine for left motion{ PORTC=0xD4; delay(100);}void forward(void)   // subroutine for forward motion{ PORTC=0xD8; delay(100);}   void stop(void)      // subroutine for stop motion{ PORTC=0xFF; delay(100);} //void main(void){init_devices(); //insert your functional code here... forward(); delay(1000); left(); delay(100); forward(); delay(1000); right(); delay(100); backward(); delay(1000); stop(); delay(100);}
CODE FOR LINE FOLLOWER unsigned intADC_conversion (unsigned intADC_channel_number)  {	 									  unsigned inti = 0;  ADCH = 0x00; i = ADC_channel_number & 0x0F; // keeping the loweatnibbel  ADMUX = i | 0x20;   ADCSR |= 0x40;  for (i = 1; i < 255; i++); //delay of 93.2 uS i = ADCH;  return (i); } void forward(void) {  PORTC=0xD8; } void left(void) {  PORTC=0xB8; } void right(void) {  PORTC=0xD4; } void backward(void) {  PORTC=0xB4; }    // void main(void) { unsigned char value[3]; unsigned char i; init_devices();  while(1)  {  for(i=0;i<3;i++)   {    value[i]=ADC_conversion(i);   }  if (value[1] < 50)  {    forward();  }  else  {    if(value[2] > 90)    { left();    }    else    {    if (value[0] > 90)   { right();   } else    {    backward(); } } } } }
THANK YOU…

Mais conteúdo relacionado

Mais procurados

Input Output programming in AVR microcontroller
Input  Output  programming in AVR microcontrollerInput  Output  programming in AVR microcontroller
Input Output programming in AVR microcontrollerRobo India
 
Embedded system (Chapter 2) part 2
Embedded system (Chapter 2) part 2Embedded system (Chapter 2) part 2
Embedded system (Chapter 2) part 2Ikhwan_Fakrudin
 
Relay and AVR Atmel Atmega 16
Relay and AVR Atmel Atmega 16Relay and AVR Atmel Atmega 16
Relay and AVR Atmel Atmega 16Robo India
 
Introduction to MPLAB IDE
Introduction to MPLAB IDEIntroduction to MPLAB IDE
Introduction to MPLAB IDEKarim El-Rayes
 
26. 8255 control word programming
26. 8255 control word programming26. 8255 control word programming
26. 8255 control word programmingsandip das
 
Programming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontrollerProgramming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontrollerCorrado Santoro
 
Ch2 microcontroller architecture
Ch2 microcontroller architectureCh2 microcontroller architecture
Ch2 microcontroller architectureAhmad Sidik
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3Jeni Shah
 
Embedded system (Chapter )
Embedded system (Chapter )Embedded system (Chapter )
Embedded system (Chapter )Ikhwan_Fakrudin
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontrollerjokersclown57
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesSrikrishna Thota
 
Handling Asynchronous Events in MCUs
Handling Asynchronous Events in MCUsHandling Asynchronous Events in MCUs
Handling Asynchronous Events in MCUsCorrado Santoro
 

Mais procurados (20)

Input Output programming in AVR microcontroller
Input  Output  programming in AVR microcontrollerInput  Output  programming in AVR microcontroller
Input Output programming in AVR microcontroller
 
Embedded system (Chapter 2) part 2
Embedded system (Chapter 2) part 2Embedded system (Chapter 2) part 2
Embedded system (Chapter 2) part 2
 
Relay and AVR Atmel Atmega 16
Relay and AVR Atmel Atmega 16Relay and AVR Atmel Atmega 16
Relay and AVR Atmel Atmega 16
 
Introduction to MPLAB IDE
Introduction to MPLAB IDEIntroduction to MPLAB IDE
Introduction to MPLAB IDE
 
26. 8255 control word programming
26. 8255 control word programming26. 8255 control word programming
26. 8255 control word programming
 
Lec13
Lec13Lec13
Lec13
 
Programming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontrollerProgramming the Digital I/O Interface of a PIC microcontroller
Programming the Digital I/O Interface of a PIC microcontroller
 
AT mega8 basics
AT mega8 basicsAT mega8 basics
AT mega8 basics
 
Class7
Class7Class7
Class7
 
Code2
Code2Code2
Code2
 
Ch2 microcontroller architecture
Ch2 microcontroller architectureCh2 microcontroller architecture
Ch2 microcontroller architecture
 
Arduino cic3
Arduino cic3Arduino cic3
Arduino cic3
 
PIC and LCD
PIC and LCDPIC and LCD
PIC and LCD
 
Embedded system (Chapter )
Embedded system (Chapter )Embedded system (Chapter )
Embedded system (Chapter )
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Soc
SocSoc
Soc
 
8155 GPPI
8155 GPPI8155 GPPI
8155 GPPI
 
Microprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 FeaturesMicroprocessor Interfacing and 8155 Features
Microprocessor Interfacing and 8155 Features
 
8255 ppi
8255 ppi8255 ppi
8255 ppi
 
Handling Asynchronous Events in MCUs
Handling Asynchronous Events in MCUsHandling Asynchronous Events in MCUs
Handling Asynchronous Events in MCUs
 

Destaque

Robot operating systems (ros) overview &
Robot operating systems (ros) overview &Robot operating systems (ros) overview &
Robot operating systems (ros) overview &Piyush Chand
 
Robotics Technology By communication
Robotics Technology By communicationRobotics Technology By communication
Robotics Technology By communicationVignesh VCS
 
Seminar On Kalman Filter And Its Applications
Seminar On  Kalman  Filter And Its ApplicationsSeminar On  Kalman  Filter And Its Applications
Seminar On Kalman Filter And Its ApplicationsBarnali Dey
 
Introduction to ROS (Robot Operating System)
Introduction to ROS (Robot Operating System) Introduction to ROS (Robot Operating System)
Introduction to ROS (Robot Operating System) hvcoup
 
Kalman filter for object tracking
Kalman filter for object trackingKalman filter for object tracking
Kalman filter for object trackingMohit Yadav
 
Traffic signal controller using at89 c52 microcontroller
Traffic signal controller using at89 c52 microcontrollerTraffic signal controller using at89 c52 microcontroller
Traffic signal controller using at89 c52 microcontrollerrock_007
 
Textual Robot programming
Textual Robot programmingTextual Robot programming
Textual Robot programmingCHEMGLOBE
 
Industrial robots
Industrial robotsIndustrial robots
Industrial robotsOhgoma
 
Robot programming
Robot programmingRobot programming
Robot programmingGopal Saini
 
Robot operating systems (ros) overview & (1)
Robot operating systems (ros) overview & (1)Robot operating systems (ros) overview & (1)
Robot operating systems (ros) overview & (1)Piyush Chand
 

Destaque (11)

Robot operating systems (ros) overview &
Robot operating systems (ros) overview &Robot operating systems (ros) overview &
Robot operating systems (ros) overview &
 
Robotics Technology By communication
Robotics Technology By communicationRobotics Technology By communication
Robotics Technology By communication
 
Seminar On Kalman Filter And Its Applications
Seminar On  Kalman  Filter And Its ApplicationsSeminar On  Kalman  Filter And Its Applications
Seminar On Kalman Filter And Its Applications
 
Introduction to ROS (Robot Operating System)
Introduction to ROS (Robot Operating System) Introduction to ROS (Robot Operating System)
Introduction to ROS (Robot Operating System)
 
Kalman filter for object tracking
Kalman filter for object trackingKalman filter for object tracking
Kalman filter for object tracking
 
Traffic signal controller using at89 c52 microcontroller
Traffic signal controller using at89 c52 microcontrollerTraffic signal controller using at89 c52 microcontroller
Traffic signal controller using at89 c52 microcontroller
 
Textual Robot programming
Textual Robot programmingTextual Robot programming
Textual Robot programming
 
Industrial robots
Industrial robotsIndustrial robots
Industrial robots
 
Industrial robotics
Industrial roboticsIndustrial robotics
Industrial robotics
 
Robot programming
Robot programmingRobot programming
Robot programming
 
Robot operating systems (ros) overview & (1)
Robot operating systems (ros) overview & (1)Robot operating systems (ros) overview & (1)
Robot operating systems (ros) overview & (1)
 

Semelhante a Programming A Robot Using

DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics Felipe Prado
 
What will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfWhat will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfSIGMATAX1
 
Microcontroller
MicrocontrollerMicrocontroller
MicrocontrollerSpitiq
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Rodrigo Almeida
 
Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVRMohamed Abdallah
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Omkar Rane
 
MICROCONTROLLER.pptx
MICROCONTROLLER.pptxMICROCONTROLLER.pptx
MICROCONTROLLER.pptxfiqrie mohd
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerMujahid Hussain
 
Basics Of Embedded Systems
Basics Of Embedded SystemsBasics Of Embedded Systems
Basics Of Embedded Systemsarlabstech
 
Microcontroller avr
Microcontroller avrMicrocontroller avr
Microcontroller avrMahmoud Amr
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 

Semelhante a Programming A Robot Using (20)

Presentation
PresentationPresentation
Presentation
 
knowledge in daily life.ppt
knowledge in daily life.pptknowledge in daily life.ppt
knowledge in daily life.ppt
 
DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics DEF CON 23 - Rodringo Almeida - embedded system design from electronics
DEF CON 23 - Rodringo Almeida - embedded system design from electronics
 
What will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdfWhat will be quantization step size in numbers and in voltage for th.pdf
What will be quantization step size in numbers and in voltage for th.pdf
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015Embedded systems design @ defcon 2015
Embedded systems design @ defcon 2015
 
Hardware interfacing basics using AVR
Hardware interfacing basics using AVRHardware interfacing basics using AVR
Hardware interfacing basics using AVR
 
Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148Analog To Digital Conversion (ADC) Programming in LPC2148
Analog To Digital Conversion (ADC) Programming in LPC2148
 
MICROCONTROLLER.pptx
MICROCONTROLLER.pptxMICROCONTROLLER.pptx
MICROCONTROLLER.pptx
 
8255
82558255
8255
 
Atmega16
Atmega16Atmega16
Atmega16
 
Avr report
Avr reportAvr report
Avr report
 
Lec03
Lec03Lec03
Lec03
 
AVR arduino dasar
AVR arduino dasarAVR arduino dasar
AVR arduino dasar
 
Introduction to Arduino Microcontroller
Introduction to Arduino MicrocontrollerIntroduction to Arduino Microcontroller
Introduction to Arduino Microcontroller
 
Basics Of Embedded Systems
Basics Of Embedded SystemsBasics Of Embedded Systems
Basics Of Embedded Systems
 
Lecture7
Lecture7Lecture7
Lecture7
 
EEE UNIT-2 PPT.pdf
EEE UNIT-2 PPT.pdfEEE UNIT-2 PPT.pdf
EEE UNIT-2 PPT.pdf
 
Microcontroller avr
Microcontroller avrMicrocontroller avr
Microcontroller avr
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 

Último

Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfFIDO Alliance
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jNeo4j
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessUXDXConf
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!Memoori
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyUXDXConf
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024Stephen Perrenod
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfFIDO Alliance
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentationyogeshlabana357357
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...marcuskenyatta275
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxJennifer Lim
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfSrushith Repakula
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FIDO Alliance
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераMark Opanasiuk
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...panagenda
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...FIDO Alliance
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsStefano
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPTiSEO AI
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...FIDO Alliance
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandIES VE
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024Stephanie Beckett
 

Último (20)

Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdfLinux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
Linux Foundation Edge _ Overview of FDO Software Components _ Randy at Intel.pdf
 
Your enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4jYour enemies use GenAI too - staying ahead of fraud with Neo4j
Your enemies use GenAI too - staying ahead of fraud with Neo4j
 
Structuring Teams and Portfolios for Success
Structuring Teams and Portfolios for SuccessStructuring Teams and Portfolios for Success
Structuring Teams and Portfolios for Success
 
State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!State of the Smart Building Startup Landscape 2024!
State of the Smart Building Startup Landscape 2024!
 
A Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System StrategyA Business-Centric Approach to Design System Strategy
A Business-Centric Approach to Design System Strategy
 
TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024TopCryptoSupers 12thReport OrionX May2024
TopCryptoSupers 12thReport OrionX May2024
 
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdfWhere to Learn More About FDO _ Richard at FIDO Alliance.pdf
Where to Learn More About FDO _ Richard at FIDO Alliance.pdf
 
AI mind or machine power point presentation
AI mind or machine power point presentationAI mind or machine power point presentation
AI mind or machine power point presentation
 
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
TEST BANK For, Information Technology Project Management 9th Edition Kathy Sc...
 
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptxWSO2CONMay2024OpenSourceConferenceDebrief.pptx
WSO2CONMay2024OpenSourceConferenceDebrief.pptx
 
How we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdfHow we scaled to 80K users by doing nothing!.pdf
How we scaled to 80K users by doing nothing!.pdf
 
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
FDO for Camera, Sensor and Networking Device – Commercial Solutions from VinC...
 
Intro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджераIntro in Product Management - Коротко про професію продакт менеджера
Intro in Product Management - Коротко про професію продакт менеджера
 
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
Easier, Faster, and More Powerful – Alles Neu macht der Mai -Wir durchleuchte...
 
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
ASRock Industrial FDO Solutions in Action for Industrial Edge AI _ Kenny at A...
 
PLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. StartupsPLAI - Acceleration Program for Generative A.I. Startups
PLAI - Acceleration Program for Generative A.I. Startups
 
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
1111 ChatGPT Prompts PDF Free Download - Prompts for ChatGPT
 
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
Choosing the Right FDO Deployment Model for Your Application _ Geoffrey at In...
 
Using IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & IrelandUsing IESVE for Room Loads Analysis - UK & Ireland
Using IESVE for Room Loads Analysis - UK & Ireland
 
What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024What's New in Teams Calling, Meetings and Devices April 2024
What's New in Teams Calling, Meetings and Devices April 2024
 

Programming A Robot Using

  • 1. PROGRAMMING A ROBOT USING ICC AVR Ver 7.5
  • 2. ICC AVR ver 7.5 ICC AVR is a tool used to program Atmel microcontrollers. It uses a C compiler to compile the high level code into a low level code. ICC AVR then converts this low level code into HEX code. It also has built in tools to program the flash memory of the microcontroller.
  • 3. HOW TO INSTALL ICC AVR ver 7.5
  • 4. ICC AVR ver 7.5 is not a freeware and thus you have to purchase it. But 45 days trial versions are available on the net and they give almost the same features. Thus download the setup of the trial version from the site : http://www.imagecraft.com/ Run the setup and install ICC AVR ver 7.5
  • 5. HOW TO USE ICC AVR ver 7.5
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 16. L293D IN1 IN2 EN1 PC2 PC3 PC4 PC5 PC6 PC7 OUT1 OUT2 OUT3 OUT4 A T M E G A 1 6 IN3 IN 4 EN2
  • 17.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 25. Input Output PORTS • Four, 8 bit I/O ports- PORT A,B,C,D • All I/O ports pins are bidirectional and can be configured individually • Input pins can be configured to utilize internal pullups. • Data Direction Register , DDRn • Port Driver Register, PORTn • Port Pin Register, PINn
  • 26. Data Direction Register, DDRn • Determines the direction of individual pins of ports • If the bit of the DDR is set the corresponding pin of the port is configured as output pin • If the bit of the DDR is cleared the corresponding pin of the port is configured as input pin • DDRA = 0xF0; • 4 MSB pins of PORTA are output pins • 4 LSB pins of PORTA are input pins
  • 27. Port Pin Register, PINn • Reading the input pins of port is done by reading PIN register • Temp = PINA; • Read the PORTA input and store in temp variable
  • 28. Port Drive Register, PORTn • For pins configured as input (DDRn[x] = 0) microcontroller connects a internal pull up register if the corresponding bit of PORTn is set • If the PORTn bit is cleared, pin is Tristated • DDRA = 0x00; • PORTA = 0xF0
  • 29. Buzzer On / OFF • PORT B pin 7 • Pin is configured as output • DDRB= 0x80; • To turn on the buzzer output high • PORTB = 0x80; • To turn off the buzzer output low • PORTB = 0x00;
  • 30. Buzzer Function void Buzzer_ON(void) { PORTB = 0x80; } void Buzzer_OFF(void) { PORTB = PORTB & 0x7F; }
  • 31. LED DISPLAY 8 bit LED display is connected to PORTD. To display any bit combination on the LED display, we use… PORTD=0xXX;
  • 32. CODE FOR LED DISPLAY void main(void) { init_devices(); while(1) { PORTD=0xFF; } }
  • 33. Analog To Digital Converter • 10 bit resolution • 8 channels • PORTA(0 – 7) • Disable internal pull up • ADCH & ADCL – Data Register • ADMUX- Channel Select Register • ADCSR – Control & Status Register
  • 34.
  • 35. unsigned char ADC_conversion (unsigned char ADC_channel_number) { unsigned inti = 0; ADCH = 0x00; i = ADC_channel_number & 0x0F; // keeping the loweatnibbel ADMUX = i | 0x20; //upper nibbel of 0x20 indicates the result is left adjusted (8 bit ADC conversion) ADCSR |= 0x40; for (i = 1; i < 255; i++); //delay of 93.2 uS i = ADCH; return (i); } void main(void) { unsigned char I, value[3];; for(i=0;i<3;i++) { value[i]=ADC_conversion(i); } }
  • 36. HOW TO COMPILE AND BUILD YOUR CODE
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.
  • 44.
  • 45.
  • 46.
  • 47.
  • 48.
  • 49.
  • 50.
  • 51.
  • 52.
  • 53. After you program your robot, it is ready to run the code written onto the microcontroller. So just power on the microcontroller and it will start the execution of the code.
  • 54. MOTION CONTROL AND LINE FOLLOWING
  • 55. PORT CONFIGURATION PORTA is ADC port. 3 white line sensors are connected to pin1, pin2, pin 3 of PORTA. PORTC is connected to the H-bridge.
  • 56. CODE FOR MOTION void delay(int time) { inti,j; for(i=0;i<time;i++) for(j=0;j<500;j++);}void backward(void) // subroutine for backward motion{ PORTC=0xB4; delay(100);}void right(void) // subroutine for right motion{ PORTC=0xB8; delay(100);}void left(void) // subroutine for left motion{ PORTC=0xD4; delay(100);}void forward(void) // subroutine for forward motion{ PORTC=0xD8; delay(100);} void stop(void) // subroutine for stop motion{ PORTC=0xFF; delay(100);} //void main(void){init_devices(); //insert your functional code here... forward(); delay(1000); left(); delay(100); forward(); delay(1000); right(); delay(100); backward(); delay(1000); stop(); delay(100);}
  • 57. CODE FOR LINE FOLLOWER unsigned intADC_conversion (unsigned intADC_channel_number) { unsigned inti = 0; ADCH = 0x00; i = ADC_channel_number & 0x0F; // keeping the loweatnibbel ADMUX = i | 0x20; ADCSR |= 0x40; for (i = 1; i < 255; i++); //delay of 93.2 uS i = ADCH; return (i); } void forward(void) { PORTC=0xD8; } void left(void) { PORTC=0xB8; } void right(void) { PORTC=0xD4; } void backward(void) { PORTC=0xB4; } // void main(void) { unsigned char value[3]; unsigned char i; init_devices(); while(1) { for(i=0;i<3;i++) { value[i]=ADC_conversion(i); } if (value[1] < 50) { forward(); } else { if(value[2] > 90) { left(); } else { if (value[0] > 90) { right(); } else { backward(); } } } } }