SlideShare uma empresa Scribd logo
1 de 13
How to Build a Better Arduino – the Development of MHVlib Alastair D’Silva @EvilDeece http://alastair.d-silva.org http://www.makehackvoid.com
What is an Arduino A hardware and software platform for prototyping electronics Low entry barrier allows programmers to interact with the real world Built on top of Wiring
Love Arduino Cheap hardware Simple to understand Serial bootloader makes programming easy
Hate Arduino Slow Memory inefficient Caused by: Excessing handholding Backwards compatibility
Fix Arduino Keep the good parts Hardware Bootloader Ditch the bad parts Runtime libraries
Design Philosophy Portable (support all ATMEGA & ATTINY) Lean Memory efficient Use interrupts if possible No deprecated calls No warnings
HardwareSerial Arduino Uses fixed length, preallocated 128 byte RX buffers Preinstanties 1 object for each serial port Reinvents the wheel regarding string formatting Interrupt driven RX, busy TX MHVlib User allocates buffers and passes them in User instantiates only what is needed Provides interrupt driven & busy variants of RX/TX Provides PROGMEM TX support
Digital IO Arduino Lots of handholding Uses extensive tables in PROGMEM to look up pin ports & bits ~55 clocks MHVlib No handholding Uses macros Single instruction, 2 clocks
MHVlib Digital IO io.h:           //Dir,Output,Input,Bit #define MHV_PIN_B0 &DDRB,&PORTB, &PINB,0 #define mhv_pinOn(mhvParms) br />do { br />	_mhv_pinOn(mhvParms) br />} while(0) #define _mhv_pinOn(mhvDir,mhvOutput,mhvInput,mhvBit) br />*mhvOutput |= _BV(mhvBit);
Digital IO Usage Arduino pinMode(13, OUTPUT); digitalWrite(13, 1); MHVlib mhv_setOutput(MHV_ARDUINO_PIN_13); mhv_pinOn(MHV_ARDUINO_PIN_13);
Servo Library Arduino Servo Consumes 1 16 bit timer per 12 servos ~10 bits of significance Resolution of 16 clock cycles ArduinoSoftwareServo Uses a 16 bit int, valid values are 0 to 180 Refresh must be called periodically Sorts the list of servo positions on each pass Lots of busy waiting MHVlib Uses a uint16_t, 0-65535 (~14 bits significant) Consumes 1 16 bit timer Resolution of 2 clock cycles No restrictions as to how many servos Only sorts when positions change
References http://billgrundmann.wordpress.com/2009/03/03/to-use-or-not-use-writedigital/ http://www.arduino.cc
First (Real) Project Spindle controller for a CNC Mill Generates a servo signal to a BLDC controller to drive an RC helicopter motor (up to 1.8kW) Read from the serial port and set the speed Monitor the spindle and adjust the speed Report actual speed back to the PC Arduino version 11,900 bytes of flash 500 bytes of RAM MHVlib version 6930 bytes of flash 177 bytes of RAM

Mais conteúdo relacionado

Mais procurados

Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينوsalih mahmod
 
how to generate sms
how to generate smshow to generate sms
how to generate smssumant reddy
 
Hardware Hacking
Hardware HackingHardware Hacking
Hardware Hackingrngtng
 
Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Dragos Ionita
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino unoRahat Sood
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Sudar Muthu
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the ArduinoWingston
 
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Eoin Brazil
 
Arduino Robotics workshop day2
Arduino Robotics workshop day2Arduino Robotics workshop day2
Arduino Robotics workshop day2Sudar Muthu
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATIONsoma saikiran
 
Controlling the internet of things using wearable tech - Design+Code Day; Ara...
Controlling the internet of things using wearable tech - Design+Code Day; Ara...Controlling the internet of things using wearable tech - Design+Code Day; Ara...
Controlling the internet of things using wearable tech - Design+Code Day; Ara...ArabNet ME
 
Wemakeit - base workshop - openlabs
Wemakeit - base workshop - openlabsWemakeit - base workshop - openlabs
Wemakeit - base workshop - openlabsLuca Pescatore
 
concurrency.cc OSHUG #3
concurrency.cc OSHUG #3concurrency.cc OSHUG #3
concurrency.cc OSHUG #3Omer Kilic
 
Integrare Arduino con Unity
Integrare Arduino con UnityIntegrare Arduino con Unity
Integrare Arduino con UnityCodemotion
 

Mais procurados (20)

Arduino اردوينو
Arduino اردوينوArduino اردوينو
Arduino اردوينو
 
how to generate sms
how to generate smshow to generate sms
how to generate sms
 
Hardware Hacking
Hardware HackingHardware Hacking
Hardware Hacking
 
Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)Robotics and Arduino (Arduino UNO)
Robotics and Arduino (Arduino UNO)
 
Arduino IDE
Arduino IDEArduino IDE
Arduino IDE
 
Basics of arduino uno
Basics of arduino unoBasics of arduino uno
Basics of arduino uno
 
Arduino Robotics workshop Day1
Arduino Robotics workshop Day1Arduino Robotics workshop Day1
Arduino Robotics workshop Day1
 
Introduction to the Arduino
Introduction to the ArduinoIntroduction to the Arduino
Introduction to the Arduino
 
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
Arduino Lecture 4 - Interactive Media CS4062 Semester 2 2009
 
Arduino Robotics workshop day2
Arduino Robotics workshop day2Arduino Robotics workshop day2
Arduino Robotics workshop day2
 
ARDUINO AND ITS PIN CONFIGURATION
 ARDUINO AND ITS PIN  CONFIGURATION ARDUINO AND ITS PIN  CONFIGURATION
ARDUINO AND ITS PIN CONFIGURATION
 
Controlling the internet of things using wearable tech - Design+Code Day; Ara...
Controlling the internet of things using wearable tech - Design+Code Day; Ara...Controlling the internet of things using wearable tech - Design+Code Day; Ara...
Controlling the internet of things using wearable tech - Design+Code Day; Ara...
 
Robotics with arduino
Robotics  with arduinoRobotics  with arduino
Robotics with arduino
 
Arduino uno
Arduino unoArduino uno
Arduino uno
 
Wemakeit - base workshop - openlabs
Wemakeit - base workshop - openlabsWemakeit - base workshop - openlabs
Wemakeit - base workshop - openlabs
 
concurrency.cc OSHUG #3
concurrency.cc OSHUG #3concurrency.cc OSHUG #3
concurrency.cc OSHUG #3
 
Integrare Arduino con Unity
Integrare Arduino con UnityIntegrare Arduino con Unity
Integrare Arduino con Unity
 
Introduction Arduino
Introduction Arduino Introduction Arduino
Introduction Arduino
 
What is Arduino ?
What is Arduino ?What is Arduino ?
What is Arduino ?
 
Introduction to Arduino
Introduction to ArduinoIntroduction to Arduino
Introduction to Arduino
 

Destaque

A Brief Tour of Responsability Driven Design
A Brief Tour of Responsability Driven DesignA Brief Tour of Responsability Driven Design
A Brief Tour of Responsability Driven Designelliando dias
 
Scaling Rails with memcached
Scaling Rails with memcachedScaling Rails with memcached
Scaling Rails with memcachedelliando dias
 
Model-Driven Software Development
Model-Driven Software DevelopmentModel-Driven Software Development
Model-Driven Software Developmentelliando dias
 
Assembling wall panels with robotic technologies
Assembling wall panels with robotic technologiesAssembling wall panels with robotic technologies
Assembling wall panels with robotic technologieselliando dias
 
Scrum in five minutes
Scrum in five minutesScrum in five minutes
Scrum in five minuteselliando dias
 
Programmable Matter with Modular Robots
Programmable Matter with Modular RobotsProgrammable Matter with Modular Robots
Programmable Matter with Modular Robotselliando dias
 
Gerenciamento de Projetos OO
Gerenciamento de Projetos OOGerenciamento de Projetos OO
Gerenciamento de Projetos OOelliando dias
 
How to Design Frameworks
How to Design FrameworksHow to Design Frameworks
How to Design Frameworkselliando dias
 
HTML5: The New html for the web
HTML5: The New html for the webHTML5: The New html for the web
HTML5: The New html for the webelliando dias
 
Interfaces de Usuário Ubíquas - UUI
Interfaces de Usuário Ubíquas - UUIInterfaces de Usuário Ubíquas - UUI
Interfaces de Usuário Ubíquas - UUIelliando dias
 
hardware de um sistema de computação
hardware de um sistema de computaçãohardware de um sistema de computação
hardware de um sistema de computaçãoelliando dias
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Languageelliando dias
 
Representação de Números
Representação de NúmerosRepresentação de Números
Representação de Númeroselliando dias
 
Linguagens de Transformação de Modelos
Linguagens de Transformação de ModelosLinguagens de Transformação de Modelos
Linguagens de Transformação de Modeloselliando dias
 
UML-Based Web Engineering
UML-Based Web EngineeringUML-Based Web Engineering
UML-Based Web Engineeringelliando dias
 
Gerenciamento de Projeto para Desenvolvimento de Sistema
Gerenciamento de Projeto para Desenvolvimento de SistemaGerenciamento de Projeto para Desenvolvimento de Sistema
Gerenciamento de Projeto para Desenvolvimento de Sistemaelliando dias
 
Banco De Dados Básico
Banco De Dados BásicoBanco De Dados Básico
Banco De Dados Básicoelliando dias
 

Destaque (20)

A Brief Tour of Responsability Driven Design
A Brief Tour of Responsability Driven DesignA Brief Tour of Responsability Driven Design
A Brief Tour of Responsability Driven Design
 
Algoritmo Genetico
Algoritmo GeneticoAlgoritmo Genetico
Algoritmo Genetico
 
Scaling Rails with memcached
Scaling Rails with memcachedScaling Rails with memcached
Scaling Rails with memcached
 
Model-Driven Software Development
Model-Driven Software DevelopmentModel-Driven Software Development
Model-Driven Software Development
 
Assembling wall panels with robotic technologies
Assembling wall panels with robotic technologiesAssembling wall panels with robotic technologies
Assembling wall panels with robotic technologies
 
Acme Total
Acme TotalAcme Total
Acme Total
 
Scrum in five minutes
Scrum in five minutesScrum in five minutes
Scrum in five minutes
 
Programmable Matter with Modular Robots
Programmable Matter with Modular RobotsProgrammable Matter with Modular Robots
Programmable Matter with Modular Robots
 
Gerenciamento de Projetos OO
Gerenciamento de Projetos OOGerenciamento de Projetos OO
Gerenciamento de Projetos OO
 
How to Design Frameworks
How to Design FrameworksHow to Design Frameworks
How to Design Frameworks
 
HTML5: The New html for the web
HTML5: The New html for the webHTML5: The New html for the web
HTML5: The New html for the web
 
Interfaces de Usuário Ubíquas - UUI
Interfaces de Usuário Ubíquas - UUIInterfaces de Usuário Ubíquas - UUI
Interfaces de Usuário Ubíquas - UUI
 
hardware de um sistema de computação
hardware de um sistema de computaçãohardware de um sistema de computação
hardware de um sistema de computação
 
Enabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition LanguageEnabling White-Box Reuse in a Pure Composition Language
Enabling White-Box Reuse in a Pure Composition Language
 
Representação de Números
Representação de NúmerosRepresentação de Números
Representação de Números
 
Linguagens de Transformação de Modelos
Linguagens de Transformação de ModelosLinguagens de Transformação de Modelos
Linguagens de Transformação de Modelos
 
Robótica Móvel
Robótica MóvelRobótica Móvel
Robótica Móvel
 
UML-Based Web Engineering
UML-Based Web EngineeringUML-Based Web Engineering
UML-Based Web Engineering
 
Gerenciamento de Projeto para Desenvolvimento de Sistema
Gerenciamento de Projeto para Desenvolvimento de SistemaGerenciamento de Projeto para Desenvolvimento de Sistema
Gerenciamento de Projeto para Desenvolvimento de Sistema
 
Banco De Dados Básico
Banco De Dados BásicoBanco De Dados Básico
Banco De Dados Básico
 

Semelhante a How To Build A Better Arduino

Semelhante a How To Build A Better Arduino (20)

Arduino Programming Basic
Arduino Programming BasicArduino Programming Basic
Arduino Programming Basic
 
What is arduino
What is arduinoWhat is arduino
What is arduino
 
Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.Interface stepper motor through Arduino using LABVIEW.
Interface stepper motor through Arduino using LABVIEW.
 
Microcontroller
MicrocontrollerMicrocontroller
Microcontroller
 
AVR arduino dasar
AVR arduino dasarAVR arduino dasar
AVR arduino dasar
 
arduino.pdf
arduino.pdfarduino.pdf
arduino.pdf
 
Lecture6
Lecture6Lecture6
Lecture6
 
How to use an Arduino
How to use an ArduinoHow to use an Arduino
How to use an Arduino
 
Multi Sensory Communication 2/2
Multi Sensory Communication 2/2Multi Sensory Communication 2/2
Multi Sensory Communication 2/2
 
Introduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).pptIntroduction to Arduino 16822775 (2).ppt
Introduction to Arduino 16822775 (2).ppt
 
Embedded system course projects - Arduino Course
Embedded system course projects - Arduino CourseEmbedded system course projects - Arduino Course
Embedded system course projects - Arduino Course
 
teststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptxteststststststLecture_3_2022_Arduino.pptx
teststststststLecture_3_2022_Arduino.pptx
 
Arduino Slides With Neopixels
Arduino Slides With NeopixelsArduino Slides With Neopixels
Arduino Slides With Neopixels
 
Embedded system - introduction to arm7
Embedded system -  introduction to arm7Embedded system -  introduction to arm7
Embedded system - introduction to arm7
 
Presentation
PresentationPresentation
Presentation
 
Arduino intro.pptx
Arduino intro.pptxArduino intro.pptx
Arduino intro.pptx
 
Arduino Day 1 Presentation
Arduino Day 1 PresentationArduino Day 1 Presentation
Arduino Day 1 Presentation
 
Avr report
Avr reportAvr report
Avr report
 
Arduino
ArduinoArduino
Arduino
 
Rig nitc [autosaved] (copy)
Rig nitc [autosaved] (copy)Rig nitc [autosaved] (copy)
Rig nitc [autosaved] (copy)
 

Último

Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxABMWeaklings
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...PsychicRuben LoveSpells
 
Introducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfIntroducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfnoumannajam04
 
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...CIOWomenMagazine
 
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,dollysharma2066
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceanilsa9823
 
call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..nishakur201
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改atducpo
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceanilsa9823
 
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...Sanjna Singh
 
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改atducpo
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfpastor83
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girlsPooja Nehwal
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...anilsa9823
 
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndCall Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndPooja Nehwal
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceanilsa9823
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfJess Walker
 
Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666nishakur201
 

Último (20)

Lilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptxLilac Illustrated Social Psychology Presentation.pptx
Lilac Illustrated Social Psychology Presentation.pptx
 
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
$ Love Spells^ 💎 (310) 882-6330 in West Virginia, WV | Psychic Reading Best B...
 
Introducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdfIntroducing to billionaire brain wave.pdf
Introducing to billionaire brain wave.pdf
 
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
Understanding Relationship Anarchy: A Guide to Liberating Love | CIO Women Ma...
 
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
8377087607 Full Enjoy @24/7-CLEAN-Call Girls In Chhatarpur,
 
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Adil Nagar Lucknow best Female service
 
call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..call girls in candolim beach 9870370636] NORTH GOA ..
call girls in candolim beach 9870370636] NORTH GOA ..
 
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
办理国外毕业证学位证《原版美国montana文凭》蒙大拿州立大学毕业证制作成绩单修改
 
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Rajajipuram Lucknow best sexual service
 
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
(KAVYA) Call Girls Humayun Nagar ✔️Just Call 7001035870✔️ HI-Fi Hyderabad Esc...
 
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
文凭办理《原版美国USU学位证书》犹他州立大学毕业证制作成绩单修改
 
LC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdfLC_YouSaidYes_NewBelieverBookletDone.pdf
LC_YouSaidYes_NewBelieverBookletDone.pdf
 
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
9892124323, Call Girls in mumbai, Vashi Call Girls , Kurla Call girls
 
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
Lucknow 💋 High Class Call Girls Lucknow 10k @ I'm VIP Independent Escorts Gir...
 
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot AndCall Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
Call Girls In Andheri East Call US Pooja📞 9892124323 Book Hot And
 
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Tingre Nagar ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual serviceCALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
CALL ON ➥8923113531 🔝Call Girls Aliganj Lucknow best sexual service
 
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdfBreath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
Breath, Brain & Beyond_A Holistic Approach to Peak Performance.pdf
 
escort service sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
escort service  sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974escort service  sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
escort service sasti (*~Call Girls in Paschim Vihar Metro❤️9953056974
 
Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666Call Girls Anjuna beach Mariott Resort ₰8588052666
Call Girls Anjuna beach Mariott Resort ₰8588052666
 

How To Build A Better Arduino

  • 1. How to Build a Better Arduino – the Development of MHVlib Alastair D’Silva @EvilDeece http://alastair.d-silva.org http://www.makehackvoid.com
  • 2. What is an Arduino A hardware and software platform for prototyping electronics Low entry barrier allows programmers to interact with the real world Built on top of Wiring
  • 3. Love Arduino Cheap hardware Simple to understand Serial bootloader makes programming easy
  • 4. Hate Arduino Slow Memory inefficient Caused by: Excessing handholding Backwards compatibility
  • 5. Fix Arduino Keep the good parts Hardware Bootloader Ditch the bad parts Runtime libraries
  • 6. Design Philosophy Portable (support all ATMEGA & ATTINY) Lean Memory efficient Use interrupts if possible No deprecated calls No warnings
  • 7. HardwareSerial Arduino Uses fixed length, preallocated 128 byte RX buffers Preinstanties 1 object for each serial port Reinvents the wheel regarding string formatting Interrupt driven RX, busy TX MHVlib User allocates buffers and passes them in User instantiates only what is needed Provides interrupt driven & busy variants of RX/TX Provides PROGMEM TX support
  • 8. Digital IO Arduino Lots of handholding Uses extensive tables in PROGMEM to look up pin ports & bits ~55 clocks MHVlib No handholding Uses macros Single instruction, 2 clocks
  • 9. MHVlib Digital IO io.h: //Dir,Output,Input,Bit #define MHV_PIN_B0 &DDRB,&PORTB, &PINB,0 #define mhv_pinOn(mhvParms) br />do { br /> _mhv_pinOn(mhvParms) br />} while(0) #define _mhv_pinOn(mhvDir,mhvOutput,mhvInput,mhvBit) br />*mhvOutput |= _BV(mhvBit);
  • 10. Digital IO Usage Arduino pinMode(13, OUTPUT); digitalWrite(13, 1); MHVlib mhv_setOutput(MHV_ARDUINO_PIN_13); mhv_pinOn(MHV_ARDUINO_PIN_13);
  • 11. Servo Library Arduino Servo Consumes 1 16 bit timer per 12 servos ~10 bits of significance Resolution of 16 clock cycles ArduinoSoftwareServo Uses a 16 bit int, valid values are 0 to 180 Refresh must be called periodically Sorts the list of servo positions on each pass Lots of busy waiting MHVlib Uses a uint16_t, 0-65535 (~14 bits significant) Consumes 1 16 bit timer Resolution of 2 clock cycles No restrictions as to how many servos Only sorts when positions change
  • 13. First (Real) Project Spindle controller for a CNC Mill Generates a servo signal to a BLDC controller to drive an RC helicopter motor (up to 1.8kW) Read from the serial port and set the speed Monitor the spindle and adjust the speed Report actual speed back to the PC Arduino version 11,900 bytes of flash 500 bytes of RAM MHVlib version 6930 bytes of flash 177 bytes of RAM

Notas do Editor

  1. Wiring is a simplified form of C++ - it provides a simple API and removes some of the requirements of C++ by using a preprocessor to do things such as automatic prototype declarations.
  2. Currently have support for ATMEGA168, 328, 1280 & ATTINY2313. Adding new microcontrollers involves creating a new header file from the data sheet. Most of it can be cut and pasted from an existing header as Atmel have strived to be consistent between controllers.We try to keep the code lean by doing as little handholding as possible – we just get the job done, in as few instructions as possibleAvoid unnecessary memory allocations, use appropriate datatypesWe provide busy waiting and interrupt driven variants of most peripheral functions, allowing the microcontroller to get on with other work while the task progressesThe Arduino libraries make use of deprecated macros such as the old cbi & sbi macros, and also produces warnings when compiled