I like to think that there's an alternate universe where the entire industry adopted NeXT's idea of replacing the dedicated Caps Lock key with a Command+Shift key combination, because it's such a smart and obviously correct thing to do. Sadly, I'll never live in that universe.
Reverse engineering the 1988 NeXT keyboard protocol
61–67 of 67 posts
Re: Reverse engineering the 1988 NeXT keyboard protocol
#62> When I told my Arduino to sleep for 51 microseconds, it was generally sleeping for either 56.2 or 61.3 microseconds. That seemed to easily be bad enough to cause lots of problems. This is why I've never quite liked the Arduino ecosystem, the way it exists. Sure, it works and it's accessible to newcomers... but it doesn't encourage understanding the inner workings of the platform enough, which is something that is e…
For reliable embedded software I try and get the peripherals of the microcontroller to do all the timing critical work and my code sits up at a high level handling complete messages etc. Kind of the equivalent of "not blocking the event loop" in node, or functional vs imperative programming.
But the arduino libraries etc don't really fit well with this style, because they have to accommodate lowest common denominator chips like the ATMega. At least it's not PIC 8s I suppose...
For getting into embedded, I would strongly recommend the Teensy series (the 4.1 is joyful overkill for virtually any project). They are far more functional processors which are supported very well by the arduino ecosystem and have their own excellent set of libraries maintained by Paul which make full use of the hardware in the MCU. Being ARM based means that on chip debugging is relatively painless if it comes to that.
Re: Reverse engineering the 1988 NeXT keyboard protocol
#63Nelson seems to have been using a Rigol benchtop scope and some proprietary software that came with his generic logic analyzer. But from long experience I'm wary of investing my time in proprietary vendor tools. Does anyone have a good overview of the free-software signal-analyzer-software/oscilloscope-software landscape? I've played with sigrok a little bit, enough to get it to decode some PS/2 signals I captured on…
Stuff I find better with benchtops: - display update rates (I've caught random glitches I would never have been on a PC scope) - sample buffers - display options (persistent, colouring etc) - segmented capture modes (Siglent call it "history) - protocol triggering, which is incredibly useful for working with UART/CAN/SPI etc. Keysight nailed this. - glitch triggering - just triggering in general - realtime online protocol decode - user interface (in terms of having knobs and buttons rather than clicking on stuff)
Basically, I use my scope a lot as a more powerful logic analyzer for signals using less than 4 channels. I do have a backup LA, and Sigrok/Pulseview are fantastic when required (and support a lot more protocols). But a logic analyzer is never going to show you if you've got signal integrity issues.
As to why there aren't any open source benchtop scopes, good point. At least my Siglent is Zynq based with Linux for the UI/rendering/networking and FPGA for the quicker bits. The Keysight's have custom ASICs.
Bunny's Novena could be a good start towards the hardware.
Re: Reverse engineering the 1988 NeXT keyboard protocol
#64> When I told my Arduino to sleep for 51 microseconds, it was generally sleeping for either 56.2 or 61.3 microseconds. That seemed to easily be bad enough to cause lots of problems. This is why I've never quite liked the Arduino ecosystem, the way it exists. Sure, it works and it's accessible to newcomers... but it doesn't encourage understanding the inner workings of the platform enough, which is something that is e…
What frustrates me about arduino is how limited the peripherals are. I can see why they chose to begin with that obsolete processor - the arduino model of programming is simple & approachable precisely because the processor is so dumb (no complex interrupt controller, no DMA, no complex power gating and clocking setups). For reliable embedded software I try and get the peripherals of the microcontroller to do all the…
... and yet Arduino isn't actually teaching people how to do that :(
I'm a staunch proponent of using up to date MCUs, which means ARM these days, but I'd be completely on board with still using an ATMega as the default in 2022 for this kind of educational purpose if the point were actually being educational.
At least it's not a PIC16F84, I suppose. All the microcontroller books spent a decade teaching literally the lowest end, crappiest, and more expensive PIC in the series because it was the first model with Flash memory, and ignoring everything that came after it. Even those that were backwards compatible for all intents and purposes, and not any harder to incrementally learn.
Re: Reverse engineering the 1988 NeXT keyboard protocol
#65> When I told my Arduino to sleep for 51 microseconds, it was generally sleeping for either 56.2 or 61.3 microseconds. That seemed to easily be bad enough to cause lots of problems. This is why I've never quite liked the Arduino ecosystem, the way it exists. Sure, it works and it's accessible to newcomers... but it doesn't encourage understanding the inner workings of the platform enough, which is something that is e…
Right, it's complicated, isn't it? Like, I couldn't (or at least wouldn't) have gotten started on this project if I had to read the ATMega reference manuals from the very first step. But I did feel very frustrated that the Arduino "delayMicroseconds" function is so far off from accurate, and I felt frustrated also whenever I looked for deeper explanations of almost anything. It's a very copy-and-paste culture. I even…
Good news they do exist (at least if i understood your statement correctly), You just need to search with the keywords "AVR", "atmega328", or whichever version you intend to use instead of "Arduino".
I attempted to make a simple PLC this summer and these resources were a great help :
[book] Make: AVR Programming https://www.amazon.com/AVR-Programming-Learning-Software-Tec...
and this complementary (or introductory) video to the book by the author i believe https://www.youtube.com/watch?v=ERY7d7W-6nA
[Youtube-videos] A playlist of Cornell's ECE 4760 AVR Lectures by the very chill "Bruce Land" (from 2012) : https://www.youtube.com/playlist?list=PLD7F7ED1F3505D8D5
The course website (labs, exercises and readings) : https://people.ece.cornell.edu/land/courses/ece4760/index_20...
Homeworks : https://people.ece.cornell.edu/land/courses/ece4760/homework... Labs : https://people.ece.cornell.edu/land/courses/ece4760/labs/old...
Although the course was centered around an atmega16 or something? i really don't recall sorry but the knowledge i gained was invaluable and easily transferable to a 328p.
Fundamentals of Microcontrollers - Arduino bare-metal breakdown (A playlist of a guy "Mitch Davis" exploring an atmega328 barebone and using tools like AVRdude etc..) https://www.youtube.com/playlist?list=PLNyfXcjhOAwOF-7S-ZoW2...
Atmel Programming Tutorial (by Chris Dahms ) https://www.youtube.com/playlist?list=PLoLaqVexEviMZu55Y4JO6...
Hope this helps.
Re: Reverse engineering the 1988 NeXT keyboard protocol
#66> When I told my Arduino to sleep for 51 microseconds, it was generally sleeping for either 56.2 or 61.3 microseconds. That seemed to easily be bad enough to cause lots of problems. This is why I've never quite liked the Arduino ecosystem, the way it exists. Sure, it works and it's accessible to newcomers... but it doesn't encourage understanding the inner workings of the platform enough, which is something that is e…
Aah trying to bitbang with a Sleep? I agree, it's a case of "get off my lawn and go back to node.js" :) Or, more accordingly, don't think the computer is magical. Edit: it's a bit funny seeing someone trying to discover things by themselves but saying "it's difficult to measure pulse width with an oscilloscope" just triggered me - pun intended
Re: Reverse engineering the 1988 NeXT keyboard protocol
#67Earlier quoted context omitted.
Right, it's complicated, isn't it? Like, I couldn't (or at least wouldn't) have gotten started on this project if I had to read the ATMega reference manuals from the very first step. But I did feel very frustrated that the Arduino "delayMicroseconds" function is so far off from accurate, and I felt frustrated also whenever I looked for deeper explanations of almost anything. It's a very copy-and-paste culture. I even…
>There's a lot of room for someone to create good tutorials and material for ramping up and out of Arduino. Would have helped me a lot, at least. Good news they do exist (at least if i understood your statement correctly), You just need to search with the keywords "AVR", "atmega328", or whichever version you intend to use instead of "Arduino". I attempted to make a simple PLC this summer and these resources were a gr…