SlideShare uma empresa Scribd logo
1 de 38
RIG-NITC
WORKSHOP ON BASIC ROBOTICS
AND
EMBEDDED SYSTEMS SIMULATION
Doubts?
 You are free to ask your doubts!!
Microcontrollers
 abbreviated µC, uC or MCU
 single integrated circuit
◦ processor core
◦ memory
◦ programmable input/output peripherals.
 A computer system optimized for
hardware control in a single piece of
silicon..
See what a uC can do.!!
Microcontrollers
 Most popular microcontrollers.
◦ AVR
◦ ARM
◦ PIC
◦ 8051
E.g. AVR ATmega8,ATmega16,Cortex
A8,A10
Atmega 16
 8-bit high performance uC
 1 MIPS speed at 1 MHz
 16 Kb FLASH Memory
 Static RAM of 1 Kb
 0.5 Kb EEPROM
 40 PIN design
 32 I/O ports.
 3 timers
 SPI, TWI, serial interfacing
 ADC converters
 Internal 1 MHz oscillator
Extra Information:
• General purpose register :
 Stores local variables
 I/O registers:
 Configures the I/O peripherals
 FLASH:
 Stores our program code and bootloader
 Starts with memory address 0x00
 EEPROM:
 It can be used to store those values to be stored
even when switched off
 Slow to access
I/O ports
• 4 i/o ports namely PORT A, PORT B,
PORT C and PORT D
• PORT A has ADC
• Any PIN can be configured both for
input or output.
• BUT how to configure??
AVR REGISTERS
 Stores some important values
 Windows registry..?
 Contains address of pins in
hexadecimal values
 Stores the configuration settings
Registers 
 Data Direction Register(DDR)
◦ 0 means INPUT PIN
◦ 1 means OUTPUT PIN
 PORT Register
◦ Configures output
 0 means 0v
 1 means 5v
 PIN register
◦ Stores the input at any PIN
 1if input is a 5v signal
 0 if input is 0v
Binary to HexaDecimal
Conversion
 Easy to express.
 Binary contains 0 and 1
 Hexadecimal s/m contain 0 to 9 and A
to F
 Binary to hex
 Hex to binary
Use of TTL logic.?
 What is TTL logic
 0’s and 1’s  what is its meaning??
 0GND….but what is GND
 1VCC…what is VCC
DDR
 DDRx where x=A,B,C,D
 8-BIT binary/hexadecimal value
 Example:
◦ DDRA=0B01110101;
PORT
 To configure the output settings
 8-BIT binary/hexadecimal value
PULL UP RESISTOR
 Reduce noise..what is noise??
 PORTx bits set 1…ut DDRx is set 0
 Resistor comes in series.
Input monitoring??
 Have you ever thought.?
 How?
PIN
 Stores the input that the
microcontroller detects…
 Example of input s/m
 8-bit binary/hexadecimal value
 Example:
◦ If PINA==0b00101111do something
But how to write the code??
Embedded C
• Most powerful programming Language
• Fast execution
• Reduced Instructions
• Similar to simple C coding
Essential Software and
Hardware
 Softwares:(will be provided: open source)
◦ Winavr
◦ HIDbootFlash
◦ Proteus ISIS
 Hardwares:(will be provided)
◦ RigDev Board
 Low cost than corporate development boards
 Based on Atmega 16
 In built USB interfacing
Getting Started
 Install Winavr
 Install HIDbootFlash
 Check the RigDev Board
◦ Programmers notepad
◦ mfile
General Structure of a code
#include<avr/io.h>
int main()
{
}
This is the general format of any embedded C code that we write
for ATmega uCs.
#include<avr/io.h> includes the details about the PIN
configurations of ATmega series of uCs.
Our code is written inside the main() function.
Programmers Notepad
Programmers Notepad
 Save code as main.c
 Create “ makefile ”
 Tools  make all
Makefile
 Written in mfile
 Change mcu name
 Change frequency
Lets do something 
 LED Lighting
 CathodeGND
 ANODE5v
More about it
 Made up mostly using GaAs.
 Light emitted due to electrical
excitation
 How to identify cathode
◦ Leg method
◦ Edge method
 NEVER CONNECT LED DIRECTLY
TO SUPPLY
 Resistor in series.
Lets Do Something 
 LED Blinking
◦ #include<util/delay.h>
 _delay_ms();
 _delay_us();
 #include<avr/io.h>
#include<util/delay.h>
main()
{
DDRA=0X01;
While(1)
{
PORTA=0X01;
_delay_ms(1000);
PORTA=0X00;
_delay_ms(1000);
}
}
Pulse Width
Modulation(PWM)
 What is a PWM signal.
 DAC
Duty Cycle
How is it usefull.??
DAC examples
 LED contrast control
 RMS voltage is exploited
LED Contrast Control
 #include “pwm.h” includes the header
file for speed control
 pwminit(int freq) initializes pwm at
required frequency
 pwm(int a,int b) sets pwm on PD4 and
PD5
 a and b are duty cycles
 a controls PD4 and b controls PD5
coding
 #include <avr/io.h>
 #include<util/delay.h>
 #include “pwm.h”
 int main()
◦ {
◦ While(1)
◦ {
◦ DDRB=0x30;
◦ pwminit(50);
◦ pwm(0,50);
◦ _delay_ms(2000);
◦ pwm(50,0);
◦ _delay_ms(2000);
◦ pwm(100,100);
◦ _delay_ms(2000);
◦ }
◦ }
Motor Speed Control
 #include “pwm.h” includes the header
file for speed control
 pwminit(int freq) initializes pwm at
required frequency
 pwm(int a,int b) sets pwm on PD4 and
PD5
 a and b are duty cycles
 a controls PD4 and b controls PD5
Motor speed control
 #include <avr/io.h>
 #include<util/delay.h>
 #include “pwm.h”
 int main()
◦ {
◦ While(1)
◦ {
◦ DDRB=0x30;
◦ pwminit(50);
◦ pwm(0,50);
◦ _delay_ms(2000);
◦ pwm(50,0);
◦ _delay_ms(2000);
◦ pwm(100,100);
◦ _delay_ms(2000);
◦ }
◦ }
Have fun..!!

Mais conteúdo relacionado

Mais procurados

Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseElaf A.Saeed
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Tony Olsson.
 
Using Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesUsing Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesCorrado Santoro
 
Arduino Nodebots (Hackster CascadiaJS Workshop)
Arduino Nodebots (Hackster CascadiaJS Workshop)Arduino Nodebots (Hackster CascadiaJS Workshop)
Arduino Nodebots (Hackster CascadiaJS Workshop)Monica Houston
 
Embedded &amp; pcb design
Embedded &amp; pcb designEmbedded &amp; pcb design
Embedded &amp; pcb designTanveer Behl
 
arduino-ppt
 arduino-ppt arduino-ppt
arduino-pptjhcid
 
Embedded systems الانظمة المدمجة
Embedded systems  الانظمة المدمجة Embedded systems  الانظمة المدمجة
Embedded systems الانظمة المدمجة salih mahmod
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 prsamurti
 
Physical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serialPhysical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serialTony Olsson.
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming FamiliarizationAmit Kumer Podder
 
Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller systemnugnugmacmac
 
برمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأولبرمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأولAhmed Sakr
 

Mais procurados (20)

Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)Physical prototyping lab1-input_output (2)
Physical prototyping lab1-input_output (2)
 
Using Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR LibrariesUsing Ready-for-PIC and SDR Libraries
Using Ready-for-PIC and SDR Libraries
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
 
Arduino Nodebots (Hackster CascadiaJS Workshop)
Arduino Nodebots (Hackster CascadiaJS Workshop)Arduino Nodebots (Hackster CascadiaJS Workshop)
Arduino Nodebots (Hackster CascadiaJS Workshop)
 
Embedded &amp; pcb design
Embedded &amp; pcb designEmbedded &amp; pcb design
Embedded &amp; pcb design
 
Arduino - Peripherals and interface
Arduino - Peripherals and interfaceArduino - Peripherals and interface
Arduino - Peripherals and interface
 
arduino-ppt
 arduino-ppt arduino-ppt
arduino-ppt
 
Ii avr-basics(1)
Ii avr-basics(1)Ii avr-basics(1)
Ii avr-basics(1)
 
Embedded systems الانظمة المدمجة
Embedded systems  الانظمة المدمجة Embedded systems  الانظمة المدمجة
Embedded systems الانظمة المدمجة
 
AT mega8 basics
AT mega8 basicsAT mega8 basics
AT mega8 basics
 
Avr microcontroller
Avr microcontrollerAvr microcontroller
Avr microcontroller
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
 
Physical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serialPhysical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serial
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
 
Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller system
 
Avr and arm
Avr and armAvr and arm
Avr and arm
 
برمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأولبرمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأول
 

Destaque

Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CVarun A M
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICSRobotix 2011
 
How to think like a startup
How to think like a startupHow to think like a startup
How to think like a startupLoic Le Meur
 
Teaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakTeaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakShelly Sanchez Terrell
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerLuminary Labs
 

Destaque (6)

Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded C
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICS
 
Inaugural Addresses
Inaugural AddressesInaugural Addresses
Inaugural Addresses
 
How to think like a startup
How to think like a startupHow to think like a startup
How to think like a startup
 
Teaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakTeaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & Textspeak
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
 

Semelhante a RIG-NITC Workshop on Basic Robotics and Embedded Systems Simulation

Microcontroller
MicrocontrollerMicrocontroller
MicrocontrollerSpitiq
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'tsyogesh46
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.pptAakashRawat35
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basicssagar Ramdev
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advancedImran Sheikh
 
how to generate sms
how to generate smshow to generate sms
how to generate smssumant reddy
 
PIC introduction + mapping
PIC introduction + mappingPIC introduction + mapping
PIC introduction + mappingOsaMa Hasan
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counterMafaz Ahmed
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerRup Chowdhury
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and RoboticsNIT Raipur
 
Micro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeMicro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeSunil Kumar R
 

Semelhante a RIG-NITC Workshop on Basic Robotics and Embedded Systems Simulation (20)

Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
Arduino by yogesh t s'
Arduino by yogesh t s'Arduino by yogesh t s'
Arduino by yogesh t s'
 
Introduction2_PIC.ppt
Introduction2_PIC.pptIntroduction2_PIC.ppt
Introduction2_PIC.ppt
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
 
Presentation
PresentationPresentation
Presentation
 
Badal sharma
Badal sharmaBadal sharma
Badal sharma
 
how to generate sms
how to generate smshow to generate sms
how to generate sms
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
 
Embedded system
Embedded  systemEmbedded  system
Embedded system
 
PIC introduction + mapping
PIC introduction + mappingPIC introduction + mapping
PIC introduction + mapping
 
Automatic room light controller with visible counter
Automatic room light controller with visible counterAutomatic room light controller with visible counter
Automatic room light controller with visible counter
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
 
Training Report on embedded Systems and Robotics
Training Report on embedded  Systems and RoboticsTraining Report on embedded  Systems and Robotics
Training Report on embedded Systems and Robotics
 
Micro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL CodeMicro Controller 8051 of Speedo Meter using KEIL Code
Micro Controller 8051 of Speedo Meter using KEIL Code
 
Picmico
PicmicoPicmico
Picmico
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
 

Último

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersRaghuram Pandurangan
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxLoriGlavin3
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsPixlogix Infotech
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenHervé Boutemy
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024Stephanie Beckett
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxLoriGlavin3
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity PlanDatabarracks
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek SchlawackFwdays
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxLoriGlavin3
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESmohitsingh558521
 

Último (20)

Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Generative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information DevelopersGenerative AI for Technical Writer or Information Developers
Generative AI for Technical Writer or Information Developers
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptxThe Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
The Role of FIDO in a Cyber Secure Netherlands: FIDO Paris Seminar.pptx
 
The Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and ConsThe Ultimate Guide to Choosing WordPress Pros and Cons
The Ultimate Guide to Choosing WordPress Pros and Cons
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
DevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache MavenDevoxxFR 2024 Reproducible Builds with Apache Maven
DevoxxFR 2024 Reproducible Builds with Apache Maven
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024What's New in Teams Calling, Meetings and Devices March 2024
What's New in Teams Calling, Meetings and Devices March 2024
 
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptxPasskey Providers and Enabling Portability: FIDO Paris Seminar.pptx
Passkey Providers and Enabling Portability: FIDO Paris Seminar.pptx
 
How to write a Business Continuity Plan
How to write a Business Continuity PlanHow to write a Business Continuity Plan
How to write a Business Continuity Plan
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
"Subclassing and Composition – A Pythonic Tour of Trade-Offs", Hynek Schlawack
 
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptxUse of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
Use of FIDO in the Payments and Identity Landscape: FIDO Paris Seminar.pptx
 
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICESSALESFORCE EDUCATION CLOUD | FEXLE SERVICES
SALESFORCE EDUCATION CLOUD | FEXLE SERVICES
 

RIG-NITC Workshop on Basic Robotics and Embedded Systems Simulation

  • 1. RIG-NITC WORKSHOP ON BASIC ROBOTICS AND EMBEDDED SYSTEMS SIMULATION
  • 2. Doubts?  You are free to ask your doubts!!
  • 3. Microcontrollers  abbreviated µC, uC or MCU  single integrated circuit ◦ processor core ◦ memory ◦ programmable input/output peripherals.  A computer system optimized for hardware control in a single piece of silicon..
  • 4. See what a uC can do.!!
  • 5. Microcontrollers  Most popular microcontrollers. ◦ AVR ◦ ARM ◦ PIC ◦ 8051 E.g. AVR ATmega8,ATmega16,Cortex A8,A10
  • 7.  8-bit high performance uC  1 MIPS speed at 1 MHz  16 Kb FLASH Memory  Static RAM of 1 Kb  0.5 Kb EEPROM  40 PIN design  32 I/O ports.  3 timers  SPI, TWI, serial interfacing  ADC converters  Internal 1 MHz oscillator
  • 8. Extra Information: • General purpose register :  Stores local variables  I/O registers:  Configures the I/O peripherals  FLASH:  Stores our program code and bootloader  Starts with memory address 0x00  EEPROM:  It can be used to store those values to be stored even when switched off  Slow to access
  • 9. I/O ports • 4 i/o ports namely PORT A, PORT B, PORT C and PORT D • PORT A has ADC • Any PIN can be configured both for input or output. • BUT how to configure??
  • 10. AVR REGISTERS  Stores some important values  Windows registry..?  Contains address of pins in hexadecimal values  Stores the configuration settings
  • 11. Registers   Data Direction Register(DDR) ◦ 0 means INPUT PIN ◦ 1 means OUTPUT PIN  PORT Register ◦ Configures output  0 means 0v  1 means 5v  PIN register ◦ Stores the input at any PIN  1if input is a 5v signal  0 if input is 0v
  • 12. Binary to HexaDecimal Conversion  Easy to express.  Binary contains 0 and 1  Hexadecimal s/m contain 0 to 9 and A to F  Binary to hex  Hex to binary
  • 13. Use of TTL logic.?  What is TTL logic  0’s and 1’s  what is its meaning??  0GND….but what is GND  1VCC…what is VCC
  • 14. DDR  DDRx where x=A,B,C,D  8-BIT binary/hexadecimal value  Example: ◦ DDRA=0B01110101;
  • 15. PORT  To configure the output settings  8-BIT binary/hexadecimal value
  • 16. PULL UP RESISTOR  Reduce noise..what is noise??  PORTx bits set 1…ut DDRx is set 0  Resistor comes in series.
  • 17. Input monitoring??  Have you ever thought.?  How?
  • 18. PIN  Stores the input that the microcontroller detects…  Example of input s/m  8-bit binary/hexadecimal value  Example: ◦ If PINA==0b00101111do something
  • 19. But how to write the code??
  • 20. Embedded C • Most powerful programming Language • Fast execution • Reduced Instructions • Similar to simple C coding
  • 21. Essential Software and Hardware  Softwares:(will be provided: open source) ◦ Winavr ◦ HIDbootFlash ◦ Proteus ISIS  Hardwares:(will be provided) ◦ RigDev Board  Low cost than corporate development boards  Based on Atmega 16  In built USB interfacing
  • 22. Getting Started  Install Winavr  Install HIDbootFlash  Check the RigDev Board ◦ Programmers notepad ◦ mfile
  • 23. General Structure of a code #include<avr/io.h> int main() { } This is the general format of any embedded C code that we write for ATmega uCs. #include<avr/io.h> includes the details about the PIN configurations of ATmega series of uCs. Our code is written inside the main() function.
  • 25. Programmers Notepad  Save code as main.c  Create “ makefile ”  Tools  make all
  • 26. Makefile  Written in mfile  Change mcu name  Change frequency
  • 27. Lets do something   LED Lighting  CathodeGND  ANODE5v
  • 28. More about it  Made up mostly using GaAs.  Light emitted due to electrical excitation  How to identify cathode ◦ Leg method ◦ Edge method  NEVER CONNECT LED DIRECTLY TO SUPPLY  Resistor in series.
  • 29. Lets Do Something   LED Blinking ◦ #include<util/delay.h>  _delay_ms();  _delay_us();  #include<avr/io.h> #include<util/delay.h> main() { DDRA=0X01; While(1) { PORTA=0X01; _delay_ms(1000); PORTA=0X00; _delay_ms(1000); } }
  • 30. Pulse Width Modulation(PWM)  What is a PWM signal.  DAC
  • 31. Duty Cycle How is it usefull.??
  • 32. DAC examples  LED contrast control  RMS voltage is exploited
  • 33. LED Contrast Control  #include “pwm.h” includes the header file for speed control  pwminit(int freq) initializes pwm at required frequency  pwm(int a,int b) sets pwm on PD4 and PD5  a and b are duty cycles  a controls PD4 and b controls PD5
  • 34. coding  #include <avr/io.h>  #include<util/delay.h>  #include “pwm.h”  int main() ◦ { ◦ While(1) ◦ { ◦ DDRB=0x30; ◦ pwminit(50); ◦ pwm(0,50); ◦ _delay_ms(2000); ◦ pwm(50,0); ◦ _delay_ms(2000); ◦ pwm(100,100); ◦ _delay_ms(2000); ◦ } ◦ }
  • 35.
  • 36. Motor Speed Control  #include “pwm.h” includes the header file for speed control  pwminit(int freq) initializes pwm at required frequency  pwm(int a,int b) sets pwm on PD4 and PD5  a and b are duty cycles  a controls PD4 and b controls PD5
  • 37. Motor speed control  #include <avr/io.h>  #include<util/delay.h>  #include “pwm.h”  int main() ◦ { ◦ While(1) ◦ { ◦ DDRB=0x30; ◦ pwminit(50); ◦ pwm(0,50); ◦ _delay_ms(2000); ◦ pwm(50,0); ◦ _delay_ms(2000); ◦ pwm(100,100); ◦ _delay_ms(2000); ◦ } ◦ }