# How to start programing microcontroller in Julia ? is any package?

**URL:** <https://discourse.julialang.org/t/how-to-start-programing-microcontroller-in-julia-is-any-package/3688>\
**Category:** General Usage\
**Tags:** hardware, arduino\
**Created:** [May 13, 2017, 8:17am UTC](https://discourse.julialang.org/t/how-to-start-programing-microcontroller-in-julia-is-any-package/3688 "2017-05-13T08:17:05Z")\
**Posts on this page:** 1\
**Showing post:** 17

<div class="post-metadata">

**Author:** ![Palli](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/palli/32/3380_2.png) [@Palli](https://discourse.julialang.org/u/Palli)\
**Post date:** [December 11, 2018, 10:00am UTC](https://discourse.julialang.org/t/how-to-start-programing-microcontroller-in-julia-is-any-package/3688/17 "2018-12-11T10:00:27Z")

</div>

> [@oxinabox](#):
>
> I’m still unclear if you want to:
> 
> - run julia _on_ the ATMEGA8 – impossible (without some serious work on changing the language itself)
> - communicate with a program on ATMEGA – which is what Arduino.jl lets you do, but you could do directly with [SerialPorts.jl](https://github.com/JuliaIO/SerialPorts.jl)
> - Use julia to automate the transferring of compiled programs (eg written in C), to the ATMEGA

Right, any 8/16 bit MCUs/CPUs, such as Arduino, are impossible, as I thought (see answer to my question on it). Except for Julia2C loophole. See below.

Julia supports ARM, and there is one non-8/16-bit Arduino, the 32-bit ARM-based Arduino Due (or Zero or M0 variant currently sold out). That’s the one potentially having the fewest issues to get working with Julia.Note the ARM-based MCUs, at least these ones may only support “Thumb ARM”, not full ARM, so I’m not even sure Julia would support such variants currently. A better bet might be x86 based Arduino: [Arduino Official Store | Boards Shields Kits Accessories](https://store.arduino.cc/genuino-101)

The link in the thread above to Arduino.jl is broken, but from memory it’s just to interface to it, same as SerialPorts.jl that actually has a “`Arduino` submodule”. [This may even be the same code? I’m not sure if the name was changed as it was misleading or that package copied from the former.]

You can use Julia with/for C programs as you say; but also there was Intel’s Julia2C project. It seems to have bitrotted. If it would get maintained (or just using very old Julia syntax…) you could translate Julia to C and then get the code on the MCU. Possibly almost any MCU, even 8/16 bit ones. I’m however ignoring all OS issues. Julia by default requires running in an OS. A project similar to MicroPython, done for Julia, could help with that, and there’s a Discourse thread on it.

Unless you get around the OS/Linux requirement of Julia you need to look into this thread and answers there:

> **[Embedded Linux on Arduino DUE](https://forum.arduino.cc/t/embedded-linux-on-arduino-due/136608)**
>
> Hello Arduino Community, I have worked on arduino UNo board and now i'm migrating onto Arduino DUE .Is there a way where we can run an embedded linux such on an ARDUINO DUE BOARD ? . If yes please let me know the steps for the same . Thanks and...

> We can customize the Linux to run on Due.  
> But what we want to achieve with this?  
> Any value added that we are getting with this?

---

_[View the full topic](https://discourse.julialang.org/t/how-to-start-programing-microcontroller-in-julia-is-any-package/3688)._
