3 ms·
I would absolutely love to write assembly for the most time-sensitive parts, while keeping C for the parts that act as a USB HID library interfacing with the ho
by spenczar5 5y ago
I would absolutely love to write assembly for the most time-sensitive parts, while keeping C for the parts that act as a USB HID library interfacing with the host computer. It really does feel like it would be so much simpler to be able to drop down into a little assembly sequence for reading back the response from the keyboard.
But - to your point about Arduino's gaps - I have just no idea whatsoever how to build something like that. Not so much how to write the assembly - I've written a bit, and I'm sure I could work that out. No, I mean literally how I link and assemble the final program and get it to work on the chip.
I don't know whether that's just an Arduino problem, either. I find this stuff hard to google, but maybe I'm using the wrong terms - these are the perils of learning as you go.
- marcan_42 5y agoHeh, I wrote a USB stack for PICs in assembler way back and... yeah, I wouldn't recommend that :-) (the official stack was written in C, but I refused to use C compilers for PICs at the time because they were expensive and terrible; things got better with SDCC, but oh god C18 was bad - thankfully C works very nicely on AVRs). But yes, mixing asm and C should be a lot easier and well documented. The repo I linked is a simple example of how to do it stand-alone, without any libs or Arduino anything, but... yeah. This isn't exactly an Arduino problem; the "template project" issue is pretty common across the embedded industry. But for something as popular as Arduino not to have done a better job is unfortunate.
- unwind 5y agoYou'll figure it out, I'm sure! You can probably continue to piggy-back on the Arduino environment by using inline assembly (the asm("") statement), but it's annoying since you need to keep the assembly in a C++ string literal. In the meantime, please read the manual or look up some tutorials on Youtube on how to use the oscilloscope. They're complicated for sure, but I think you had a popular hobbyist model and there should be help to be found. Failing that, look for the word "cursor" on the front panel; cursors is usually how you measure things and it's like at the core of scope functionality so it should not be hard.