# New Domain - what are people using Julia for in Hardware?

**URL:** <https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042>\
**Category:** Maker\
**Created:** [January 6, 2020, 9:23pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042 "2020-01-06T21:23:20Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![tro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tro3/32/12355_2.png) [@tro3](https://discourse.julialang.org/u/tro3)\
**Post date:** [January 6, 2020, 9:23pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/1 "2020-01-06T21:23:20Z")

</div>

@anon92994695 has driven a new domain for Discourse covering all things hardware… the Maker domain. Thanks!!

With one of my hats, I am a hardware guy _very_ new to Julia, and I am curious what people are using Julia for. For myself, I’m currently using Julia to improve the integrated circuit layout flows and verification processes at the small company I work for. I have historically done the bulk of these in Python, with Haskell used for the more computationally-intensive bits. I generally favor development speed first and ability to bring others in my group up to speed on the resulting tools second. Fine for Python, bad for Haskell (on the second). Julia seems to hold the promise of unifying the two areas.

Things I have done hardware-wise in the past and can see using Julia for in the future:

- Domain-specific simulators (previously Haskell)
- Bench automation software (previously Python)
- IC subsystem generation (previously Python)
- Simulator connectivity e.g. connecting LabView to VerilogAMS (previously Python & C)

Other ME/EE/Physics hardware types out there? What are you all using Julia for in your areas? (I have to say, this is one of the most helpful and civilized online crowds I’ve ever run across.) Happy New Year, all!

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [January 6, 2020, 10:41pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/2 "2020-01-06T22:41:15Z")

</div>

I mostly use Julia over USB serial in this world. Pretty much exclusively with Arduinos for now.

---

<div class="post-metadata">

**Author:** ![tro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tro3/32/12355_2.png) [@tro3](https://discourse.julialang.org/u/tro3)\
**Post date:** [January 6, 2020, 11:04pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/3 "2020-01-06T23:04:19Z")

</div>

Nice. Is there already a USB driver in Julia somewhere, or are you wrapping some C? I noticed a VISA package in the PainterQubits group, but I assume that is wrapping NI’s (or someone else’s) VISA driver.

---

<div class="post-metadata">

**Author:** ![ChrisRackauckas](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/chrisrackauckas/32/77_2.png) [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Post date:** [January 6, 2020, 11:43pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/4 "2020-01-06T23:43:36Z")

</div>

I’ll put a blog post out on solving ODEs on eGPUs soon. Does that count?

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [January 6, 2020, 11:49pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/5 "2020-01-06T23:49:03Z")

</div>

Tricky question… Tricky tricky… My knee jerk reaction is that it does count. Especially if the discussion focuses on not going over bus lanes or something to do with the architecture. I’m sure someone who knows more about eGPU’s then me is more qualified to answer :). Either way you should write a blog on that - we could figure out where it belongs later(probably belongs in two locations anyways because its super cool)!

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [January 6, 2020, 11:52pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/6 "2020-01-06T23:52:15Z")

</div>

I just use a Julia library([GitHub - JuliaIO/LibSerialPort.jl: Julia wrapper for the libserialport c library](https://github.com/JuliaIO/LibSerialPort.jl)) so I cheaped out :). But it still has some considerations related to Julia and hardware! I’m planning a blog/miniproject to demo something a little simple at first (sharing, all code, CAD models, etc).

Then as time goes on posting some more “advanced” projects :). Most of these I’ve already done, just very haggardly, and not using Julia (which would have had advantages to say the least). A lot of makers just lack the ability to easily process their data. IE: writing 500 lines of java/C/C++, $$$ for software, or 10 lines of easy to read fast julia. It’s a match made in heaven for someone hacking away.

A fun project could be hooking up a USB software defined radio to Makie and looking at some radio waves or something! Oooh I have like 6,000 project ideas… If anyone wants some let me know.

---

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [February 9, 2020, 7:57pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/7 "2020-02-09T19:57:56Z")

</div>

I’ve been experimenting with bench instruments control using the excellent VISA wrapper:

> **[GitHub - BBN-Q/Instruments.jl: Instrument control in Julia](https://github.com/BBN-Q/Instruments.jl)**
>
> Instrument control in Julia. Contribute to BBN-Q/Instruments.jl development by creating an account on GitHub.

I have a small repo, partly mimicking IVI, where I started writing generic functions for various instruments. The goal is to have portable code and let Julia choose the correct method depending on the instrument that you have available. It’s a lot of manual work, but I think it’s quite easy to extend: just add a new method with the correct SCPI command for your equipment.  
I find multiple dispatch a good tool for this job because it lets me use only one layer of abstraction, making it easy to understand the code. Object oriented approaches would need inheritance, more levels and more code to understand.

> **[GitHub - iuliancioarca/GenericInstruments.jl: Bundles similar functionalities...](https://github.com/iuliancioarca/GenericInstruments.jl)**
>
> Bundles similar functionalities of instruments under a single generic object: power supplies, arbitrary waveform generators, etc. - GitHub - iuliancioarca/GenericInstruments.jl: Bundles similar fun...

---

<div class="post-metadata">

**Author:** ![tro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/tro3/32/12355_2.png) [@tro3](https://discourse.julialang.org/u/tro3)\
**Post date:** [February 10, 2020, 12:34am UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/8 "2020-02-10T00:34:15Z")

</div>

Sounds cool - I’ll have a look. I admit in our lab we are using PyVisa, and I don’t know if we’ll be switching from that anytime soon but perhaps this will give us a reason. 🙂

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [February 10, 2020, 10:51am UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/9 "2020-02-10T10:51:06Z")

</div>

Awesome work here! Not sure how I didn’t see this package!

---

<div class="post-metadata">

**Author:** ![baggepinnen](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/baggepinnen/32/693_2.png) [@baggepinnen](https://discourse.julialang.org/u/baggepinnen)\
**Post date:** [February 10, 2020, 11:07am UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/10 "2020-02-10T11:07:27Z")

</div>

My previous workplace use Julia in the student labs, to communicate with lab processes  
[LabProcesses.jl](https://gitlab.control.lth.se/processes/LabProcesses.jl)  
There’s also some connection-related stuff for beaglebone etc.  
[LabConnections.jl](https://gitlab.control.lth.se/labdev/LabConnections.jl)

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [February 10, 2020, 11:17am UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/11 "2020-02-10T11:17:54Z")

</div>

Thanks! Again most awesome stuff here. Hey haven’t seen a beaglebone project for a while now!

I’m adding anything people post here to the following ‘roadmap’: [Roadmap/README.md at master · JuliaMakers/Roadmap · GitHub](https://github.com/JuliaMakers/Roadmap/blob/master/README.md)  
If anyone wants to have their project removed from the readme please let me know. I’m just using it as a map of what is pre-existing. Don’t worry I’m not going to be spamming anyone asking if they want their work contributed to a github Organization(atleast yet). I think I am going to do something different anyways, and just curate a list of useful things, and try to map utilities to projects. So no one has to do anything different and can be autonomous :).

---

<div class="post-metadata">

**Author:** ![Iulian.Cioarca](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/iulian.cioarca/32/30166_2.png) [@Iulian.Cioarca](https://discourse.julialang.org/u/Iulian.Cioarca)\
**Post date:** [February 10, 2020, 1:25pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/12 "2020-02-10T13:25:58Z")

</div>

`Instruments.jl` is so simple and yet so powerful. I don’t know why it was removed from the official registry. I talked to one of the developers and he said they aren’t actively developing it. From my point of view it’s very good as it is and it should be added again. However I don’t know the procedure. Is it a request that the only the developers can submit?

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [February 10, 2020, 11:47pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/13 "2020-02-10T23:47:38Z")

</div>

Let me draw some attention to your post! I want this sort of effort back in the registry and back in development!

---

<div class="post-metadata">

**Author:** ![dilumaluthge](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/dilumaluthge/32/29283_2.png) [@dilumaluthge](https://discourse.julialang.org/u/dilumaluthge)\
**Post date:** [February 11, 2020, 12:30am UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/14 "2020-02-11T00:30:41Z")

</div>

A while back, we removed packages from the General registry that didn’t support Julia 1.0.

If you’d like to resurrect the package, the process is straightforward.

Step 1: have the current owner of the repository transfer the repository to a GitHub organization

Step 2: update the package to work on Julia 1.0.

Step 3: register the package

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [February 11, 2020, 2:06am UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/15 "2020-02-11T02:06:15Z")

</div>

I can accept the package in the newly minted JuliaMakers organization([JuliaMakers · GitHub](https://github.com/JuliaMakers)) if there’s no other home for it.

---

<div class="post-metadata">

**Author:** ![laborg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/laborg/32/5474_2.png) [@laborg](https://discourse.julialang.org/u/laborg)\
**Post date:** [February 11, 2020, 7:57am UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/16 "2020-02-11T07:57:47Z")

</div>

I’ve created a wrapper for the `hidapi` library: [GitHub - laborg/HidApi.jl: High level wrapper for hidapi](https://github.com/laborg/HidApi.jl)  
It should be easy to use, as there are no prerequisites. The necessary binaries are provided via BinaryBuilder (had to create `hidapi_jll` fist, which took me a whole weekend).  
After some additional testing I’d like to register it.

Feedback is welcome!

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [February 23, 2020, 4:13am UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/17 "2020-02-23T04:13:18Z")

</div>

Playing tonight with wiggling gpio pins via a pyboard.

```julia
using SerialPorts
import Base.readuntil

CTRLA = '\x01'
CTRLD = '\x04'
# broken LibSerialPort can only send one byte at a time on Windows!
# so we use SerialPorts (which uses pySerial)
# SerialPorts has limited functionality, so we add readuntil

function readuntil(p::SerialPort, cs::Char)
    buf = Array{Char,1}(undef,0)
    while true
        if bytesavailable(p)>0
            c=read(p,1)[1]
            push!(buf,c)
            if c==cs
                return join(buf)
            end
        end
    end
end

"execute string s on pyboard attached to SerialPort p"
function pyb(p,s)
    s=replace(s,'\n'=>'\r') # pyboard likes returns not newlines
    write(p,CTRLA) # enter raw mode
    readuntil(p,'>') # clear serial port / wait for pyboard
    write(p,s) # send string of commands
    write(p,CTRLD) # exit raw mode
    return readuntil(p,'>')[3:end-5]
end

p = SerialPort("COM16", 115200)
pyb(p,"myled = pyb.LED(1)\r")

function blink(p)
    while true
        pyb(p,"myled.on()\r")
        pyb(p,"myled.off()\r")
    end
end

blink(p)

```

This manages to wiggle the GPIO pin at about 580 Hz (minimum of about 650 μs per update, average around 900 μs) , although it’s pretty jittery. It’s a very circuitous path from julia to python (SerialPorts wraps pySerial) on Windows through USB to micropython on an Arm M4F to the gpio pin.

---

<div class="post-metadata">

**Author:** ![anon92994695](https://avatars.discourse-cdn.com/v4/letter/a/ce7236/32.png) [@anon92994695](https://discourse.julialang.org/u/anon92994695)\
**Post date:** [February 23, 2020, 3:40pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/18 "2020-02-23T15:40:56Z")

</div>

There’s also [GitHub - JuliaIO/LibSerialPort.jl: Julia wrapper for the libserialport c library](https://github.com/JuliaIO/LibSerialPort.jl) 🙂 so no python

---

<div class="post-metadata">

**Author:** ![klaff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/klaff/32/7637_2.png) [@klaff](https://discourse.julialang.org/u/klaff)\
**Post date:** [February 23, 2020, 4:36pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/19 "2020-02-23T16:36:38Z")

</div>

I tried that one first but on Windows there’s a bug where it will only send one byte at a time, although I’m pulling one byte at a time on the receive side anyway.

It might be much better to write a CLI in micropython so that the pyboard isn’t having to interpret new python code every cycle.I think I’ll build a little dictionary dispatch thing with a few commands.

---

<div class="post-metadata">

**Author:** ![sjkelly](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sjkelly/32/9280_2.png) [@sjkelly](https://discourse.julialang.org/u/sjkelly)\
**Post date:** [February 23, 2020, 7:07pm UTC](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042/20 "2020-02-23T19:07:38Z")

</div>

If it is okay with you, can I add the `readuntil` method to SerialPorts.jl?

[Next page](https://discourse.julialang.org/t/new-domain-what-are-people-using-julia-for-in-hardware/33042.md?page=2)
