4 ms·
Your commercial heater has code written by a professional engineer who understands the limitations of that system. I’ve been writing embedded systems code for 2
by TaylorAlexander 2y ago
Your commercial heater has code written by a professional engineer who understands the limitations of that system. I’ve been writing embedded systems code for 25 years, and I’m well aware of what can be done by an informed engineer with a limited system.
But this isn’t about running doom. Any beginner that tries to use this system runs the risk of importing a library that carelessly consumes half their ram. If they want to use an I2C sensor with a specialized library, the random person on GitHub who wrote that library might not have optimized their code. If someone sees this board and wants to try it because it looks cute, it’s worth warning them that they’re buying a chip with a 20 year old architecture and extremely limited capabilities.
The flew astronauts to the moon on machines with hand wired magnetic RAM. But if you can get a modern architecture with 264k of RAM for $5, it’s worth warning people that they’re looking at something that is extremely limited compared to other options.
I also have some Twitter followers that seem to love micropython. You can’t even run micropython on attiny because of insufficient RAM.
https://forum.micropython.org/viewtopic.php?t=9102 https://forum.micropython.org/viewtopic.php?t=9102
Or let’s say someone wants to run a rainbow pattern on an LED strip. Let’s say they’re using the SK6812 LEDs which are 21 bits per pixel. Let’s also say the rest of their code uses zero bytes of ram and the library is perfectly efficient. Well I hope they don’t try to control a light strip with more than 83 LEDs on it! That would consume all the RAM. If they get a high density LED strip with 244 LEDs per meter, then 83 LEDs represents a 34 centimeter long section of that strip. That’s 13 inches.
People do lots of things with microcontrollers these days, and RAM is cheap and plentiful on modern chips.
- dghlsakjg 2y agoYou’re not wrong, but the point of this exercise seems to be to produce an arduino uno clone in dip package the same size as the chip on the original arduino. They aren’t trying to create something better or more capable, they are just making a riff/tribute of what is almost certainly the worlds most popular embedded learning tool.
- bombela 2y ago> someone wants to run a rainbow pattern on an LED strip > I hope they don’t try to control a light strip with more than 83 LEDs on it! That would consume all the RAM Why do you need to store the pattern in RAM at all? I would compute the next RGB and shift it out one LED at a time. Maybe you were thinking of using DMA for some async work?
- jonp888 2y agoThe way these things work(so far as I know) is that for the data to be passed along the chain the gap between transmissions can't be greater than 50 microseconds. Of course a skilled engineer could write a tight output loop that computes and outputs every value on the fly with a guarantee that the time budget won't be exceeded, but your average Arduino user probably doesn't have the knowledge to do this. So all the control libraries that I know allocate a memory buffer for the whole output stream and let the user update it whenever they want.
- TaylorAlexander 2y agoThat’s right. I’m really thinking of beginners, and as you say all the existing libraries I’m familiar with store the string state in RAM.
- TaylorAlexander 2y ago> Why do you need to store the pattern in RAM at all? That’s how the popular libraries do it. Not strictly necessary but the whole point of my warning was to make sure any beginners who saw this understood that this board has serious limitations compared to other options.
- bombela 2y agoThank you for the clarification.
- jdndndjs 2y agoI don't get why you would need more RAM for more LEDs? Isn't the data shifted out one by one?
- TaylorAlexander 2y agoMy word of warning was for beginners. All these seasoned experts are coming in here to explain to me how they would be perfectly capable of using 2k of ram effectively. But that’s not the case for beginners. The most popular libraries for driving all these LEDs store the state of the full chain on RAM. Not strictly required but it makes working with the LED strips much easier. And most devices have plenty of RAM to support this…