Skip to main content

Programming Microcontrollers in OCaml: The OCaPIC Project

  • Conference paper
  • First Online:
Book cover Practical Aspects of Declarative Languages (PADL 2015)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 9131))

Included in the following conference series:

Abstract

PIC microcontrollers are low-cost programmable integrated circuits,consume very little energy, but are hard to program due to very little available resources. They are traditionally programmed using low-level languages (e.g., assembler or subsets of C), which provide very few safeguards if any. This paper presents the issues we had to solve to successfully port a modern multi-paradigm general-purpose programming language, which notably provides automatic memory management and strong static type checking, to this rather peculiar hardware.

Philippe Wang—This work started while the author was at LIP6-UPMC.

This is a preview of subscription content, log in via an institution to check access.

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 34.99
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 44.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. van Ooijen et al, W.: Jal (not ?) Just Another Language, May 2004. http://jal.sourceforge.net/manual

  2. Brouwers, N., Corke, P., Langendoen, K.: Darjeeling, a Java compatible virtual machine for wireless sensor networks. In: Proceedings of the ACM/IFIP/USENIX Middleware 2008 Conference Companion (2008)

    Google Scholar 

  3. Chailloux, E., Manoury, P., Pagano, B.: Developing Applications with Objective Caml. O’Reilly (2000). http://caml.inria.fr/pub/docs/oreilly-book/

  4. Clerc, X.: Cadmium, February 2010. http://cadmium.x9c.fr/distrib/cadmium.pdf

  5. Feeley, M., Dubé, D.: Picbit: a scheme system for the PIC microcontroller. In: Scheme and Functional Programming Workshop (SFPW 2003), pp. 7–15, November 2003

    Google Scholar 

  6. Leroy, X.: The ZINC experiment : an economical implementation of the ML language. Tech. Rep. RT-0117, INRIA, February 1990

    Google Scholar 

  7. Leroy, X., Doligez, D., Frisch, A., Garrigue, J., Rémy, D., Vouillon, J.: The OCaml system (release 4.02): Documentation and user’s manual. Inria, September 2014. http://caml.inria.fr/pub/docs/manual-ocaml/

  8. Madhavapeddy, A., Mortier, R., Rotsos, C., Scott, D., Singh, B., Gazagnaire, T., Smith, S., Hand, S., Crowcroft, J.: Unikernels: library operating systems for the cloud. In: Proceedings of the 18th International Conference on Architectural Support for Programming Languages and Operating Systems (APLOS), pp. 461–472. ACM (2013)

    Google Scholar 

  9. Mandel, L., Pouzet, M.: ReactiveML, a reactive extension to ML. In: Proceedings of 7th International conference on Principles and Practice of Declarative Programming (PPDP 2005), Lisbon, Portugal, July 2005

    Google Scholar 

  10. Nordman, M.: Flashforth (2013). http://flashforth.sourceforge.net/

  11. Oracle: Java Card 3.0.4 Platform Specification. Oracle, September 2011. http://www.oracle.com/technetwork/java/javacard/specs-jsp-136430.html

  12. Osborne, M., Rubinstein, A.: Course in Game Theory. MIT Press (1994)

    Google Scholar 

  13. Pagano, B., Andrieu, O., Moniot, T., Canou, B., Chailloux, E., Wang, P., Manoury, P., Colaço, J.L.: Experience report: using objective caml to develop safety-critical embedded tools in a certification framework. In: ICFP 2009: Proceedings of the 14th International Conference on Functional Programming, pp. 215–220. ACM (2009)

    Google Scholar 

  14. Paternotte, P.: Pic Micro Pascal V1.4: User Manual, July 2010. http://www.pmpcomp.fr

  15. Pottier, F., Rémy, D.: Advanced Topics in Types and Programming Languages, chap. The Essence of ML Type Inference. MIT Press (2005)

    Google Scholar 

  16. St-Amour, V., Feeley, M.: PICOBIT: a compact scheme system for microcontrollers. In: Morazán, M.T., Scholz, S.-B. (eds.) IFL 2009. LNCS, vol. 6041, pp. 1–17. Springer, Heidelberg (2010)

    Google Scholar 

  17. Tardieu, S.: A forth compiler for microchip pic 18fxxx (2011). http://www.rfc1149.net/devel/rforth1.html

  18. Wang, P., Jonquet, A., Chailloux, E.: Non-intrusive structural coverage for objective caml. In: 5th Workshop on Bytecode Semantics, Verification, Analysis and Transformation, vol. 264 4 Electronic Notes in Theoretical Computer Science, pp. 59–73. Elsevier (2011). http://hal.archives-ouvertes.fr/hal-00497131/en/

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Benoît Vaugon .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2015 Springer International Publishing Switzerland

About this paper

Cite this paper

Vaugon, B., Wang, P., Chailloux, E. (2015). Programming Microcontrollers in OCaml: The OCaPIC Project. In: Pontelli, E., Son, T. (eds) Practical Aspects of Declarative Languages. PADL 2015. Lecture Notes in Computer Science(), vol 9131. Springer, Cham. https://doi.org/10.1007/978-3-319-19686-2_10

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-19686-2_10

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-19685-5

  • Online ISBN: 978-3-319-19686-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics