Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
740027567yI learnt assembly with AVRs. They are fairly simple, so you don't need a lot of initialisation code to get going. It very possible to fully understand these controllers and you can actually count instruction clock cycles. The assembly itself has a few minor pecularities like similar mnemonics expecting bit masks vs. bit offsets or instructions not applicable on certain registers. But overall, it is very nice to use, because the large number of registers is actually enough for most tasks.
MSP430 assembly is also pretty nice but I can't say much about it because I don't know it that well. The controllers themselves are nice and simple and the low-power modes seem well integrated and are easy to use. They aren't very cheap though.
The most useful in the embedded world is probably ARM assembly, but you're dealing with vastly more complex controllers there and won't be able to get going with 5 lines of assembly like with AVRs. -
mrstebo9287yI started learning with AVRs. They are pretty simple and you can find everything you need on the data sheets. I tried PIC but it annoyed me that you have to keep switching between a "Code" and "Data" space 😅
I think there are probably a lot better resources out there for AVRs too. And programming with AVR Studio is a delightful experience 😁 -
740027567y@ezbie I did of all development on AVRs with a simple USBasp, so without any debugging functionality. In my opinion, well-integrated debugging is the core aspect of an IDE and everything else can be done well within an appropriately-featured editor. Today's editors offer nice code completion and I don't trust IDEs' build systems anyway.
I ditched AVR Studio a long time ago and never really missed it. Development with vim and makefiles worked fine for me.
I remember using the integrated simulator in AVR Studio a few times while beginning to use the controllers. That helped me grasping some concepts, but of course isn't necessary. I don't know if there are any alternatives for Linux here. -
ezbie4467y@7400 got it.
Btw, do u have any suggestion of a controller to start with.
Because, I mean, I intend to learn how computer's work internally with this assembly thing. It doesn't need to be a pain, like a very complex controller, but I don't think I want to learn anything architecturally too different from PC's (like, Harvard Archichtecture).
Any suggestion for someone who knows nothing about assembly? -
740027567y@ezbie I actually know next to nothing about x86/x64 assembly. x86/x64 assembly is useful either if you're doing reverse engineering or very low level work on PCs, both of which is rare. I'd guess it gets complicated pretty soon with these, too.
In the embedded world you'll be dealing with Harvard machines 99% of the time. But for newer architectures, peripherals are memory-mapped anyways and often code execution from RAM is possible, so this distinction doesn't matter that much from a programming point of view.
I'd suggest to get a controller as simple as possible. That way, you can easily get in the mindset of assembly programming and get a feeling what is going on inside the processor. Complications can be added later.
Maybe you want to have a look at the early microprocessors like 6502, 68000, Z80, or 8051, because there you'll have a very clear, well-understandable system architecture. I've never programmed any of those, so I unfortunately can't give any advise on these. -
740027567yFor those you'll find good simulators where you can relly look inside and trace what your code is doing.
If you want real hardware, I'd still suggest AVRs or MSP430s. -
740027567yNo, this is a good question and you're right in your guess. The USBasp can only flash programs into the chips memory but while running the microcontroller is on its own.
Debugging can be achieved by methods as simple as toggling an LED or using a serial interface to print debug information. I think the TinyISP (another USB ISP programmer) has a feature where you can print over the ISP pins via SPI, so you don't need another interface.
If you want real debugging, you can get something like a AVR Dragon. On larger controllers I wouldn't want to be without debugging, but on AVRs I actually never tried it. Most of the hardware-specific faults in larger controllers, for which a debugger is extremely useful, don't exist in the AVR's simple architecture.
But of course, single-stepping through your assembly and watching the register contents change is a very nice learning experience. I had done this in the integrated simulator in AVR Studio. -
740027567yI would recommend that you get a simple ISP and maybe a debugger later because setting up a debugger and using it gets a lot easier when you already know about the target's architecture.
With an ISP and a proper editor you can get really fast development cycles (compile and flash in maybe a second for small programs), so changing something and reflashing again isn't tiring, so LED debugging is viable.
Related Rants
-
TCPizza28assignment: use winAPI to create a "virus" that put itself in autorun and does nothing. me, a curious student...
-
mcminnra10"Python is such a hard language. It has so many rules" - Undergraduate Student who sent out mass email to the ...
-
arch-chroot2Boss: For next project I suggest we use webassembly Me: Why not use real assembly
!rant
I wanted to know a few suggestions of cheap/easy microcontrollers for you to learn a bit of assembly.
Nothing fancy though, I just want to experiment with these things.
undefined
assembly
microcontrollers