Author Topic: Programming a firmware in aruino  (Read 1395 times)

0 Members and 1 Guest are viewing this topic.

Offline qwack

  • Thread Starter
  • Posts: 310
  • Location: ISO FR
Programming a firmware in aruino
« on: Sat, 09 August 2014, 08:34:55 »
I'm slowly beginning to get a grasp on how to program a Teensy, but I'm just sticking to arduino language for now. I know that ATMega32u4-based firmwares are usually written in C, but I was wondering how practical it would be to program a firmware in arduino instead?

There are libraries available to read matrices (which I think implement debouncing) and it is possible to have the device recognized as a keyboard. I'll be experimenting soon with a basic setup (4x3 key matrix), but in the meantime, can anyone explain why every firmware is written in C? Is there any limitation inherent to arduino programming which makes such a firmware impractical (maybe a higher latency?), or is it just that most firmware programmers just know C and don't care to bother with a dumbed-down language?

Pure Pro w/MX Red - [review]

Offline jameslr

  • Posts: 516
  • Location: Indiana
Re: Programming a firmware in aruino
« Reply #1 on: Sun, 10 August 2014, 23:50:28 »
I'm slowly beginning to get a grasp on how to program a Teensy, but I'm just sticking to arduino language for now. I know that ATMega32u4-based firmwares are usually written in C, but I was wondering how practical it would be to program a firmware in arduino instead?

There are libraries available to read matrices (which I think implement debouncing) and it is possible to have the device recognized as a keyboard. I'll be experimenting soon with a basic setup (4x3 key matrix), but in the meantime, can anyone explain why every firmware is written in C? Is there any limitation inherent to arduino programming which makes such a firmware impractical (maybe a higher latency?), or is it just that most firmware programmers just know C and don't care to bother with a dumbed-down language?

C is a standard for one. Especially when it comes to interfacing with hardware. Arduino would be fine, I guess it's just what people know, like you say. I know if I were to start developing firmwares I'd likely do it in C as that's what I have the most practical experience with. I've wanted to pick up arduino for a while though.

Don't have a real answer for you about the possibility of using Arduino for a keyboard firmware.
CM Novatouch | Filco MJ2 TKL w/ HID Lib | REΛLFORCE 87U 55g | CM QFR

Offline Hundrakia

  • Posts: 172
  • Location: Northwest Territories, Canada
Re: Programming a firmware in aruino
« Reply #2 on: Mon, 11 August 2014, 00:00:59 »
It's all written in C due really to the fact that Embedded C has been the go-to since well before most of our times. If people chose to write a compiler for a particular platform, like they've done with the Arduino, then you'd have options. It boils down to the fact that most people just really love them some C for programming embedded things.
C all of the things man!
P.s., at least C is higher level than assembly! Those libraries really help with the insane timing deals that you have to get real deep in to manuals for. I'm like,
Code: [Select]
#include randomLibraryOfInnaneNumberSequences.h and never have to worry.

Offline twiddle

  • Posts: 165
    • Portfolio
Re: Programming a firmware in aruino
« Reply #3 on: Mon, 11 August 2014, 00:02:16 »
I would say that its also a matter of code size, depending on the chip you're compiling for and the size of the runtime.
Its probably also a matter of familiarity and the fact that C theoretically would give you closer access to the hardware.

Offline qwack

  • Thread Starter
  • Posts: 310
  • Location: ISO FR
Re: Programming a firmware in aruino
« Reply #4 on: Tue, 12 August 2014, 09:28:12 »
Thanks for the answers guys. I'll probably end up using one of the existing firmwares in C and learn to understand the language from there. Coding in arduino seems to makes several things easier, especially RGB LED stuff, but it's not something I'm considering implementing on my first custom keyboard (probable on the next one though).

Pure Pro w/MX Red - [review]