13 ms·
This is exactly, exactly what I've been looking for. As a software engineer whose professional career has focused entirely around the web, embedded systems is a
by shijie 9y ago
This is exactly, exactly what I've been looking for. As a software engineer whose professional career has focused entirely around the web, embedded systems is a strange, enticing landscape with what seems to be an "old guard," that eschews the frenetic pace of web technologies and frameworks, and relies on old, proven, get-shit-done tooling and technology. Which is amazing. But it also means that no one is writing blog posts on medium about this stuff, and beginner tutorials are sparse. For spoiled Elixir devs like me, this is perfect.
- drharby 9y agoOne could argue that blog posts wouldn't be needed since the books written on the material are generally accepted as mature coverage of the subject
- fit2rule 9y agoFrom the flipside, I've been a systems programmer since the 80's and have followed things along, pretty closely to the hardware, for a few decades now, and .. from this angle, its bananas to see how the web guys lose their minds over stupid shit nobody really needs every 6 months, yet everyone is a freakin' millionaire. ;)
- phkahler 9y agoSmall micro controllers don't have the resources you're used to. The smallest thing I ever wrote code for was in the PIC family and had 176 bytes of RAM and like 4 or 8K of flash (EEPROM?). Even on more common parts you may find only a few K of RAM and 10's or 100's of K flash. In that space we don't do any dynamic memory allocation, never mind garbage collection. If you did it's entirely possible you'd run out of heap space and the program would crash. It's a really different world than what web developers and app developers are used to. I highly recommend taking the dive even if it's just for fun and to see a different type of software development.
- Bromskloss 9y agoAnd you might want to avoid multiplication operations, because the compiler will likely have to implement those in software, which will be slow, and might make your program too large to fit in the memory… :-)
- DamonHD 9y agoThe AVRs, at least some of them, have reasonable Flash and RAM and EEPROM (v nice), and a single-instruction multiply. Much nicer than the 8-bit CPUs that I used to program back in days of yore...
- Bromskloss 9y agoPff, look at the fancy people over here!
- emilfihlman 9y ago>a single-instruction multiply But not single cycle ;) This is important!
- howard941 9y agoThe recommended 32Fs have FPUs so the hit isn't all that bad
- fulafel 9y agoThis is targeted at cortex m4, arm cores with hardware integer and division (and even integer simd).
- Animats 9y agoThe recommended development board isn't that bad. 256Kb Flash memory, 48-Kbyte RAM. It's not as tight as a classic Arduino. This is where Rust's safety helps. Debugging embedded code on small machines is a huge pain. The more problems caught at compile time, the better off you are. A compile time error beats JTAG debugging every time. The article gets kind of vague once they get beyond LED-blinking and busy-waiting. They implement a brute-force CPU dispatcher and call it "async" programming. They never get to interrupts at all. Rust on little machines makes sense, but it needs more support underneath to deal with timers, interrupts, and concurrency. There are projects working on this.[1] [1] https://users.rust-lang.org/t/rust-for-embedded-development-where-we-are-and-whats-missing/10861 https://users.rust-lang.org/t/rust-for-embedded-development-...
- dbaupp 9y ago> Rust on little machines makes sense, but it needs more support underneath to deal with timers, interrupts, and concurrency. There are projects working on this.[1] NB. the OP is part of that project, from the same author.
- Animats 9y agoRust needs a CPU dispatcher underneath, so the thread and lock primitives can work. A minimal single-process multiple-thread OS, something like VxWorks, is all that's needed. This would probably be something you'd link with the program. It's better to have one good one CPU dispatcher than making users roll their own crappy one for each application.
- dbaupp 9y agoWhat do you mean by 'need'? If you mean every Rust program requires a dispatcher to run, then no, Rust does not need a CPU dispatcher. Thread and locks are not primitives: they're implemented in the standard library (the std part, specifically). The 'thread' safety guarantees don't rely on that functionality, instead the arrows go the other way: the spawning and locking constructs build on the guarantees (driven by the Send and Sync traits, which are purely compile-time constructs) to provide expressive yet safe API. For instance, there's numerous operating systems built in Rust, for instance intermezzOS seems to be pure Rust except for the single file https://github.com/intermezzOS/kernel/blob/master/src/asm/boot.asm https://github.com/intermezzOS/kernel/blob/master/src/asm/bo... . If you mean that it would be really nice if there was a general purpose dispatcher library available, then sure, that seems like something that would be great on crates.io. In any case, I don't see how your comment relates to mine.
- SAI_Peregrinus 9y agoThe first micro I ever used (as a kid in the late '90s) was a PIC16C62A. 128 bytes of RAM, 3.5kB of EPROM. Not EEPROM, this was the UV-erasable stuff. I didn't have a UV lamp so I could only program during the day when I could take it outside & peel back the black electrical tape from the window to erase it.
- howard941 9y agoThis embedded dude longs to use Erlang on his MCUs. Closest I can get to it is one of the embedded *nixes. Raspberry PIs are great for prototyping but not all that easy a sell on the BOM
- petra 9y agoThere's a new mcu from microchip, that has 32mb dram, for ~$7. Might get you closer to your erlang dream. It uses new , cheap multi-die assembly techniques, which microchip also used in their ~$1 Bluetooth chip. So I think with time, and with an attractive software ecosystem,we'll see interesting new mcu's and price points.
- wott 9y ago> There's a new mcu from microchip, that has 32mb dram ...and a long list of errata, some of them quite serious: http://ww1.microchip.com/downloads/en/DeviceDoc/80000736A.pdf http://ww1.microchip.com/downloads/en/DeviceDoc/80000736A.pd... (note that if you look for it on Microchip website, the official link to the errata is also wrong at the moment!) Some people also reported a few heat issues, since it's got to dissipate heat from the memory and heat from the MCU, which starts being a bit large and a bit fast (for an MCU). Nothing extreme, but it has has to be considered in some setups. IMO, it's better to wait for other revisions of this chip, other versions in this family, or something else.
- MrBuddyCasino 9y agoThis is quite a list. There are so many "Module x is not functional. Workaround: None." its amazing. How did they manage screw up the VBAT pin?
- davidzweig 9y ago~$1 Bluetooth chip, is that the ATBTLC1000?
- pjc50 9y agoMicrocontrollers have got a lot more accessible since Arduino. There's lots of beginner material out there, although admittedly not on Medium. (Unsurprisingly, the people involved prefer a more bare metal approach and put it on blogs or forums instead) The tooling is nearly always C, so it's interesting to see Rust moving into this space. Memory management is not so much of an issue, but multitasking correctness is; perhaps there will be some new micro-RTOS framework with provably correct interrupt handling. (We have sel4, but that's not quite the same thing) As you get more low level, the tutorials get sparser. You move into FPGAs, where you have a choice of two languages with 1970s design principles, or third-party tools which work despite the manufacturer's total closedness. As you go deeper into actual IC design, nobody will attempt it without supervision from someone experienced to tell you all the little tricks. And then there's analog IC design, which is basically black magic.
- theWatcher37 9y agoCan confirm, in my emag applications class I had tools from "black magic something something" company printed on the top.
- Bromskloss 9y agoAlso in this stack, one step below using an Arduino, would be to use existing microcontrollers (or other ICs), but design your own circuit board. In contrast to IC design, this is something you can do on a hobbyist budget. Actually, if you don't etch the board yourself, but have it made and mailed, all you need is soldering equipment to populate the board with the components.
- kirrent 9y agoI've got the equipment to do hot air soldering, and I flatter myself that I've gotten pretty good at some fine SMD work, but these days I rarely bother. The premium on a service like macrofab.com usually is less than the money I waste on spare parts I accidentally destroy and postage from many different distributors.
- 9y ago
- k2enemy 9y agoI highly recommend nerdkits (http://www.nerdkits.com http://www.nerdkits.com) for someone in your shoes. You basically build an Arduino and it explains each part along the way. The included PDF is worth the price alone.
- AlexeyBrin 9y agoAll their kits and components are out of stock.
- audiometry 9y agoYeah, front page last-updated 2013, too.
- unkown-unknowns 9y agohttps://www.newbiehack.com/MicrocontrollerTutorial.aspx https://www.newbiehack.com/MicrocontrollerTutorial.aspx is an ok (not great but not bad either) way to learn about micro controllers. We used this site in a course I took. YMMV though. People in my class who lacked the experience I had with C and C++ from before had to struggle quite a lot.
- deleted 9y ago[deleted]