ABSTRACT
In this paper, we present an approach for programming microcontrollers that provides more expressivity and safety than a low-level language approach traditionally used to program such devices. To this end, we provide various abstraction layers (abstraction of the microcontroller, of the electronic components of the circuit, and of concurrency) which, while being adapted to the scarce resources of the hardware, offer high-level programming traits for the development of embedded applications. The various presented abstractions make use of an OCaml virtual machine able to run on devices with limited resources and take advantage of the expressivity and extensibility of the language. We illustrate the interest of our work on both entertainment applications and embedded software examples.
- J.S. Andersen. 2012. Programming Arduinos in Ada. Free and Open Source Software Developers' European Meeting (FOSDEM'12).Google Scholar
- Charles Bell. 2017. MicroPython for the Internet of Things: A Beginner's Guide to Programming with Python on Microcontrollers. Apress. Google ScholarDigital Library
- Niels Brouwers, Peter Corke, and Koen Langendoen. 2008. Darjeeling, a Java Compatible Virtual Machine for Microcontrollers. In ACM/IFIP/USENIX Middleware '08 Conference Companion. ACM, 18-23. htps://doi.org/10.1145/1462735.1462740 Google ScholarDigital Library
- Paul Caspi, Daniel Pilaud, Nicolas Halbwachs, and John Plaice. 1987. Lustre: A Declarative Language for Programming Synchronous Systems. In 14th annual ACM Symposium on Principles of Programming Languages (POPL'87). Association for Computing Machinery, 178-188. htps://doi.org/10.1145/41625.41641 Google ScholarDigital Library
- Jean-Louis Colaço and Marc Pouzet. 2003. Clocks as First Class Abstract Types. In 3rd International Conference on Embedded Software (EMSOFT 2003 ) (Lecture Notes in Computer Science, Vol. 2855 ). Springer, 134-155. htps://doi.org/10.1007/978-3-540-45212-6_10Google ScholarCross Ref
- Mark Grebe and Andy Gill. 2016. Haskino: A Remote Monad for Programming the Arduino. In 18th International Symposium on Practical Aspects of Declarative Languages (PADL 2016 ) (Lecture Notes in Computer Science, Vol. 9585 ). Springer, 153-168. htps://doi.org/10.1007/978-3-319-28228-2_10Google Scholar
- Robbert Gurdeep Singh and Christophe Scholliers. 2019. WARDuino : a dynamic WebAssembly virtual machine for programming microcontrollers. In MPLR 2019 : proceedings of the 16th ACM SIGPLAN international conference on managed programming languages and runtimes. Association for Computing Machinery (ACM), 27-36. htps://doi.org/10.1145/3357390.3361029 Google ScholarDigital Library
- Nicolas Halbwachs. 1998. Synchronous Programming of Reactive Systems. In 10th International Conference on Computer Aided Verification (CAV 98) (Lecture Notes in Computer Science, Vol. 1427 ). Springer, 1-16. htps://doi.org/10.1007/BFb0028726 Google ScholarDigital Library
- Caleb Helbling and Samuel Z. Guyer. 2016. Juniper: a functional reactive programming language for the Arduino. In 4th International Workshop on Functional Art, Music, Modelling, and Design (FARM 2016 ). ACM, 8-16. htps://doi.org/10.1145/2975980.2975982 Google ScholarDigital Library
- F. Leens. 2009. An introduction to I2C and SPI protocols. IEEE Instrumentation Measurement Magazine 12, 1 ( 2009 ), 8-13. htps: //doi.org/10.1109/MIM. 2009.4762946Google ScholarCross Ref
- Xavier Leroy. 1990. The ZINC experiment: an economical implementation of the ML language. Technical Report 117. INRIA. 100 pages.Google Scholar
- Vincent St-Amour and Marc Feeley. 2009. PICOBIT: A Compact Scheme System for Microcontrollers. In 21st International Symposium on Implementation and Application of Functional Languages (IFL 2009 ) (Lecture Notes in Computer Science, Vol. 6041 ). Springer, 1-17. htps://doi.org/10.1007/978-3-642-16478-1_1 Google ScholarDigital Library
- Ryan Suchocki and Sara Kalvala. 2014. Microscheme: Functional programming for the Arduino. In Proceedings of the 2014 Scheme and Functional Programming Workshop (Scheme '14). 1-9.Google Scholar
- Steven Varoumas and Tristan Crolard. 2019. WCET of OCaml Bytecode on Microcontrollers: An Automated Method and Its Formalisation. In Proceedings of the 19th International Workshop on Worst-Case Execution Time Analysis (WCET 2019 ). Schloss Dagstuhl-Leibniz-Zentrum für Informatik, 5 : 1-5 : 12. htps://doi.org/10.4230/OASIcs.WCET. 2019.5Google Scholar
- Steven Varoumas, Benoît Vaugon, and Emmanuel Chailloux. 2016. Concurrent Programming of Microcontrollers, a Virtual Machine Approach. In 8th European Congress on Embedded Real Time Software and Systems (ERTS'16). 1-10.Google Scholar
- Steven Varoumas, Benoît Vaugon, and Emmanuel Chailloux. 2018. A Generic Virtual Machine Approach for Programming Microcontrollers: the OMicroB Project. In 9th European Congress on Embedded Real Time Software and Systems (ERTS'18). 1-10.Google Scholar
Index Terms
- Programming microcontrollers through high-level abstractions
Recommendations
Higher-order concurrency for microcontrollers
MPLR 2021: Proceedings of the 18th ACM SIGPLAN International Conference on Managed Programming Languages and RuntimesProgramming microcontrollers involves low level interfacing with hardware and peripherals that are concurrent and reactive. Such programs are typically written in a mixture of C and assembly using concurrent language extensions (like FreeRTOS tasks and ...
Bypassing portability pitfalls of high-level low-level programming
VMIL '12: Proceedings of the sixth ACM workshop on Virtual machines and intermediate languagesProgram portability is an important software engineering consideration. However, when high-level languages are extended to effectively implement system projects for software engineering gain and safety, portability is compromised--high-level code for ...
Hardware Implementation of OCaml Using a Synchronous Functional Language
Practical Aspects of Declarative LanguagesAbstractWe present a hardware implementation of the high-level multi-paradigm language OCaml using a declarative language called Eclat. Eclat is tailored for programming reactive hardware applications mixing interaction with physical devices and long-...
Comments