14

Ever since I heard about google's new language Go I wanted to use it for microcontroller programming. In particular Atmel AVR micro-controllers like the Atmega series. Is there a Go port for this architecture?

hacim
  • 281
  • 1
  • 3
  • 9
  • 1
    Maybe you can hook it up with gccgo: http://golang.org/doc/gccgo_install.html – Carl Norum Nov 13 '09 at 01:22
  • 1
    Given how much attention its getting I don't think it will be long. Go looks very cool, best bits of all my favourite languages. It's going to get interesting to see what things people make with it over the next few years. – Daniel M Nov 13 '09 at 02:02
  • There seems to be a very crude port to the Arduino Uno (ATmega 328 PU), so you could poke through that for some inspiration http://gobot.io/documentation/platforms/arduino/#how-to-use. – Anonymous Penguin Jan 11 '15 at 19:50
  • As of 2020, [Tinygo](https://stackoverflow.com/a/60077990/477035) supports the ATmega328P (on an Arduino Nano development board) and even has some limited support for an ATtiny85 (on a Digispark development board) – RedGrittyBrick Jun 08 '20 at 20:28

4 Answers4

5

I may be answering too late, but Go, as August of 2012, has both the default compiler (6g, 8g) and the GCC compiler (it's actually official, too, but not the default), which means that it supports all the architectures that GCC supports; however, and as Limbus stated, Go is addressed to multi-core computers. I personally think that you would get better results with C. If you still want to use it, that is going to be fine, since Go manages well in single-core applications (but not as well as C).

icedgoal
  • 646
  • 6
  • 17
  • 2
    That may be true, but, sadly, I cannot find any examples of this being done. Looks like nobody even tried, but maybe it's just the name of the language that makes searching difficult. – vadipp Jan 23 '13 at 04:13
  • This answer is outdated. See [tinygo](https://tinygo.org/) in [Chris's answer](https://stackoverflow.com/a/60077990/477035) as well as maybe [embd](https://embd.kidoman.io/) and [gobot](https://gobot.io/) – RedGrittyBrick Jun 08 '20 at 20:23
4

No there is not. See http://golang.org/doc/install.html

Go compilers support two operating systems (Linux, Mac OS X) and three instruction sets. (amd64, 386, and arm (a.k.a. ARM))

  • 2
    This answer is outdated. See [tinygo](https://tinygo.org/) in [Chris's answer](https://stackoverflow.com/a/60077990/477035) as well as maybe [embd](https://embd.kidoman.io/) and [gobot](https://gobot.io/) – RedGrittyBrick Jun 08 '20 at 20:23
4

tinygo is a limited golang compiler for AVR (Arduino, etc) and other embedded systems. It supports a subset of the core language and standard library.

Chris
  • 567
  • 6
  • 24
3

I do not thinkg that the purpose of Go (multi-core/highscalability) goes well with mikrocontrollers.

Go ask yourself why C (and even assembly) is preferred over C++ on micro controllers.

lImbus
  • 1,578
  • 3
  • 14
  • 25
  • This answer is outdated. See [tinygo](https://tinygo.org/) in [Chris's answer](https://stackoverflow.com/a/60077990/477035) as well as maybe [embd](https://embd.kidoman.io/) and [gobot](https://gobot.io/) – RedGrittyBrick Jun 08 '20 at 20:22