5 ms·
Awesome! Personally, I think that ARM assembly has a TON of potential for teaching people how to code and/or work with electronics hardware from a state of almo
by leggomylibro 9y ago
Awesome! Personally, I think that ARM assembly has a TON of potential for teaching people how to code and/or work with electronics hardware from a state of almost no background knowledge.
- They teach the concept of a computer program as a bunch of single small logical 'steps'.
- They make it easier to keep new students interested without plying them with pages and pages of 'magic code' - not only can you make a zero-dependencies program (in the case of simple mobile chips), your 'hello world' is actually in the physical world. An LED, a motor, what-have-you.
- The core instruction set for a Cortex-M0+ processor has what, 60 instructions? It's not very complicated.
On the con side of things, the whole idea of registers controlling hardware peripherals can be a little weird, and you have to get people comfortable with command-line debugging utilities. The concepts are simple, but GDB isn't. And many of the available IDEs aren't very cross-platform.
And I guess application processors also probably introduce their own extra complexities, compared to a Cortex-M line which is more comparable to an Arduino than a RasPi or Chromebook. But hey, there's also less hardware available with the sort of support that a Raspberry Pi has; the closest you'd probably get is a cheap generic $3-5 STM32F103C8 dev board.
If anyone else is interested in this sort of thing, the reference manuals provided by ARM are also very readable, for example: http://infocenter.arm.com/help/topic/com.arm.doc.ddi0484c/DDI0484C_cortex_m0p_r0p1_trm.pdf http://infocenter.arm.com/help/topic/com.arm.doc.ddi0484c/DD...
- userbinator 9y agoMaybe it's just me, but I don't think basing a whole book on a sparsely-documented SoC from a notoriously proprietary company is a great idea at all. There are plenty of other ARM processors with far more documentation available, and if your goal is to teach how computers work from the hardware up, also plenty of other much simpler and equally well-documented microcontrollers.
- cmrdporcupine 9y agoI also don't like that the Pi is not fully open, but it is also extremely available and cheap, so an ideal system for people starting out. And ARM assembly is a much nicer first assembly language than x86. A microcontroller is a possibility, but has its own barriers to entry (not a standalone computer in itself, can't be attached easily to display, etc.). Maybe someday the lowrisc project will become a reality, and they can use that, and teach RISC-V instead.
- AnIdiotOnTheNet 9y ago6502s are cheap (though probably not as widely available as a complete system) and have an even simpler assembly language.
- kbenson 9y agoWell, if it's meant to serve the same purpose as the book I had for the same class this is likely targeted at, at the same University, with the same teacher who wrote a book for the class as a teaching aid, but using a small embedded Motorola platform 15+ years so, it's largely a teaching aid. When I took the class we got one of Plantz's prior books at the University bookstore, and it was photocopied and stapled together and like $12, which was real nice considering the cost of most class books. Basically it's an embedded programming class where the teacher decided to write the manual and publish it as a book, so don't read too much into the platform they targeted beyond that. But the book we had was quite good if I recall (I might have it packed away somewhere in the garage), so I expect this one might be good as well. As an aside, from looking at the linked author info, I'm happy Plantz finally got the chance to retire in 2004. He's a great teacher, but he was planning to retire before 2000 IIRC, and kept putting it off because of staffing issues, and then California university budget cuts and hiring freezes making getting good (actually, any non-temp) teachers hard. I'm sure he has a few happy cats, and if you ever run into him, he's got a few space program stories from the past to share. :)
- pitaj 9y agoThe documentation for ARMv8, in my experience, is absolutely awful. I still, for instance, can't figure out how to copy a value directly from one register to another. `MOV [dest], [src]` doesn't seem to work, so I've just been doing `ADD [dest], [src], #0` in my recent projects in school. EDIT: looking a little deeper into this website, it looks like a better resource than any other thing I've found.
- pm215 9y ago"mov x5, x0" is the right way to copy from x0 to x5, so if that doesn't work for you then perhaps something is odd with whatever assembler you're using. Note that under the hood "mov Xd, Xm" is a convenience alias for "orr Xd, XZR, Xm" -- the CPU itself will only see the logical-or, but the assembler and disassembler will understand the 'mov' syntax and should convert each way automatically. This is documented in the v8M ARM ARM in the "MOV (register)" instruction description. Perhaps whatever assembler you're using hasn't implemented that convenience syntax, but all the common ones (including the GNU assembler and LLVM assembler) should do, so it's surprising to encounter one that doesn't.
- simplyluke 9y ago100% has great potential for education, even (or especially) at a collegiate level. Current CS student and in our architecture course we were learning surface-level x86 but mostly Y86, which is a toy language simplification of the x86 architecture. No real complaints about it, but friends of mine in electrical and electrical computer engineering (different school at my university) were learning ARM. Not only was it simpler it was much easier for them to implement non-virtualized code. I thought the engineering department was doing it better. +1 to GDB not being simple, was a larger learning curve for most of our class than C, x86, or any of the concepts.
- benswift 9y agoI teach this stuff using a stm32l476vg discovery board at the Australian National University[0]. I re-wrote the course earlier this year to use that board (previous incarnations used a homebrew teaching architecture - emulated in software only). It went really well - although there are always rough edges the first time through a course. Next year, I'm going to tighten things up (one of my jobs over the southern summer before the course runs again in Feb 2018). Happy to answer any questions that folks have. [0] https://cs.anu.edu.au/courses/comp2300/ https://cs.anu.edu.au/courses/comp2300/
- laxentasken 9y agoAny plans to put the course materials online?
- benswift 9y agoIf you click through, pretty everything is online (except lecture recordings). Slides, lab material, etc. is all available. Next year I'm planning on releasing the lecture recordings as well. Although as I said, there are certainly some things I'll tweak next year, having been through it once. I'm under no illusions about it being perfect :)
- laxentasken 9y ago
- DSMan195276 9y agoI agree with you, but I think you're definitely talking more about teaching using a small microcontroller (Which a STM32 definitely qualifies as) rather then what they're doing here. The Raspberry Pi runs full Linux, so their code is a fair bit removed from direct hardware access and has a decent amount of boilerplate before you can begin to start messing around with GPIO. They do still eventually memory map the GPIOs, but IMO it's not really the same. That said, I think the AVR ATTiny and ATMega chips easily fit the bill, and possibly better. From a teaching perspective, they meet all of what you're talking about, and IMO they're better for simple circuits like flipping LEDs because they can really work with basically no extra components - you can just plug it into a breadboard like any other simple chip.
- monocasa 9y agoRunning baremetal on the Pi is about the same difficulty as running AVR code; you're under no requirement to run Linux. It's probably easier to teach architecture on the Pi too. The AVR c runtime stuff is poorly architected IMO.
- pjmlp 9y agoJust do it Amiga style and boot directly to the application, no need to run Linux. https://github.com/PeterLemon/RaspberryPi https://github.com/PeterLemon/RaspberryPi https://hackaday.com/2014/06/23/programming-pi-games-with-bare-metal-assembly/ https://hackaday.com/2014/06/23/programming-pi-games-with-ba...
- jdietrich 9y agoHere in the UK, we gave every 11-year-old in the country a Cortex M0+ dev board. Because that's how we roll, yo. https://en.wikipedia.org/wiki/Micro_Bit https://en.wikipedia.org/wiki/Micro_Bit