SlideShare a Scribd company logo
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..!!

More Related Content

What's hot

Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
Elaf 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 Libraries
Corrado Santoro
 
131080111003 mci
131080111003 mci131080111003 mci
131080111003 mci
jokersclown57
 
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 design
Tanveer Behl
 
Arduino - Peripherals and interface
Arduino - Peripherals and interfaceArduino - Peripherals and interface
Arduino - Peripherals and interface
Emertxe Information Technologies Pvt Ltd
 
arduino-ppt
 arduino-ppt arduino-ppt
arduino-ppt
jhcid
 
Ii avr-basics(1)
Ii avr-basics(1)Ii avr-basics(1)
Ii avr-basics(1)
Thakur Satyajeetsinh Dodiya
 
Embedded systems الانظمة المدمجة
Embedded systems  الانظمة المدمجة Embedded systems  الانظمة المدمجة
Embedded systems الانظمة المدمجة
salih mahmod
 
AT mega8 basics
AT mega8 basicsAT mega8 basics
AT mega8 basics
thetechnicalzone
 
Avr microcontroller
Avr microcontrollerAvr microcontroller
Avr microcontroller
Dhananjay Chauhan
 
L15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 pL15 timers-counters-in-atmega328 p
L15 timers-counters-in-atmega328 p
rsamurti
 
Physical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serialPhysical prototyping lab3-serious_serial
Physical prototyping lab3-serious_serial
Tony Olsson.
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
Rahat Sood
 
Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
salih mahmod
 
Arduino Programming Familiarization
Arduino Programming FamiliarizationArduino Programming Familiarization
Arduino Programming Familiarization
Amit Kumer Podder
 
Developing an avr microcontroller system
Developing an avr microcontroller systemDeveloping an avr microcontroller system
Developing an avr microcontroller system
nugnugmacmac
 
Avr and arm
Avr and armAvr and arm
Avr and arm
VishwasJangra
 
برمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأولبرمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأول
Ahmed Sakr
 

What's hot (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
 
برمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأولبرمجة الأردوينو - اليوم الأول
برمجة الأردوينو - اليوم الأول
 

Viewers also liked

Programming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded CProgramming ATmega microcontroller using Embedded C
Programming ATmega microcontroller using Embedded C
Varun A M
 
AVR programming - BASICS
AVR programming - BASICSAVR programming - BASICS
AVR programming - BASICS
Robotix 2011
 
Inaugural Addresses
Inaugural AddressesInaugural Addresses
Inaugural Addresses
Booz Allen Hamilton
 
How to think like a startup
How to think like a startupHow to think like a startup
How to think like a startup
Loic Le Meur
 
Teaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & TextspeakTeaching Students with Emojis, Emoticons, & Textspeak
Teaching Students with Emojis, Emoticons, & Textspeak
Shelly Sanchez Terrell
 
Hype vs. Reality: The AI Explainer
Hype vs. Reality: The AI ExplainerHype vs. Reality: The AI Explainer
Hype vs. Reality: The AI Explainer
Luminary Labs
 

Viewers also liked (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
 

Similar to Rig nitc [autosaved] (copy)

Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
Spitiq
 
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.ppt
AakashRawat35
 
digital clock atmega16
digital clock atmega16digital clock atmega16
digital clock atmega16
Arcanjo Salazaku
 
microcontroller basics
microcontroller basicsmicrocontroller basics
microcontroller basics
sagar Ramdev
 
8051 microcontroller
8051 microcontroller8051 microcontroller
8051 microcontroller
Shubhrika Sehgal
 
Microcontroller from basic_to_advanced
Microcontroller from basic_to_advancedMicrocontroller from basic_to_advanced
Microcontroller from basic_to_advanced
Imran Sheikh
 
Presentation
PresentationPresentation
Presentation
Abhijit Das
 
Badal sharma
Badal sharmaBadal sharma
Badal sharma
badaldausa
 
how to generate sms
how to generate smshow to generate sms
how to generate sms
sumant reddy
 
arduinoedit.pptx
arduinoedit.pptxarduinoedit.pptx
arduinoedit.pptx
rajalakshmi769433
 
Embedded system
Embedded  systemEmbedded  system
Embedded system
ANSHUL GUPTA
 
PIC introduction + mapping
PIC introduction + mappingPIC introduction + mapping
PIC introduction + mapping
OsaMa 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 counter
Mafaz Ahmed
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
Wingston
 
Overview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontrollerOverview of Microcontroller and ATMega32 microcontroller
Overview of Microcontroller and ATMega32 microcontroller
Rup 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 Robotics
NIT 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 Code
Sunil Kumar R
 
Picmico
PicmicoPicmico
Picmico
loges91
 
Final Presentation
Final PresentationFinal Presentation
Final Presentation
Susmit Sircar
 

Similar to Rig nitc [autosaved] (copy) (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
 

Recently uploaded

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
Daiki Mogmet Ito
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Jeffrey Haguewood
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
Zilliz
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Tosin Akinosho
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
Chart Kalyan
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
DianaGray10
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Speck&Tech
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
Zilliz
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
David Brossard
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
Postman
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
ssuserfac0301
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
Federico Razzoli
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
Matthew Sinclair
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
Jakub Marek
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Safe Software
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
jpupo2018
 

Recently uploaded (20)

How to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For FlutterHow to use Firebase Data Connect For Flutter
How to use Firebase Data Connect For Flutter
 
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
Salesforce Integration for Bonterra Impact Management (fka Social Solutions A...
 
Building Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and MilvusBuilding Production Ready Search Pipelines with Spark and Milvus
Building Production Ready Search Pipelines with Spark and Milvus
 
Monitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdfMonitoring and Managing Anomaly Detection on OpenShift.pdf
Monitoring and Managing Anomaly Detection on OpenShift.pdf
 
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdfHow to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
How to Interpret Trends in the Kalyan Rajdhani Mix Chart.pdf
 
UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6UiPath Test Automation using UiPath Test Suite series, part 6
UiPath Test Automation using UiPath Test Suite series, part 6
 
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?
 
Generating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and MilvusGenerating privacy-protected synthetic data using Secludy and Milvus
Generating privacy-protected synthetic data using Secludy and Milvus
 
OpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - AuthorizationOpenID AuthZEN Interop Read Out - Authorization
OpenID AuthZEN Interop Read Out - Authorization
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
WeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation TechniquesWeTestAthens: Postman's AI & Automation Techniques
WeTestAthens: Postman's AI & Automation Techniques
 
Taking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdfTaking AI to the Next Level in Manufacturing.pdf
Taking AI to the Next Level in Manufacturing.pdf
 
Webinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data WarehouseWebinar: Designing a schema for a Data Warehouse
Webinar: Designing a schema for a Data Warehouse
 
20240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 202420240609 QFM020 Irresponsible AI Reading List May 2024
20240609 QFM020 Irresponsible AI Reading List May 2024
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)Main news related to the CCS TSI 2023 (2023/1695)
Main news related to the CCS TSI 2023 (2023/1695)
 
Driving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success StoryDriving Business Innovation: Latest Generative AI Advancements & Success Story
Driving Business Innovation: Latest Generative AI Advancements & Success Story
 
Project Management Semester Long Project - Acuity
Project Management Semester Long Project - AcuityProject Management Semester Long Project - Acuity
Project Management Semester Long Project - Acuity
 

Rig nitc [autosaved] (copy)

  • 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); ◦ } ◦ }