Depending on the device in hand and one’s temperament, bringing up a new part can be a frolic through the verdant fields of discovery or an endless slog through the grey marshes of defeat. One of the reasons we find ourselves sticking with tried and true parts we know well is that interminable process of configuration. Once a new display controller is mostly working, writing convenience functions to make it easier to use can be very satisfying, but the very first thing is figuring out how to make it do anything at all. Friend of Hackaday [Dan Hienzsch] put together a post describing how to use a particular LED controller which serves as a nice walkthrough of figuring out the right bitmath to make things work, and includes a neat trick or two.
The bulk of the post is dedicated to describing the way [Dan] went about putting together his libraries for a 7-segment display demo board he makes. At its heart the board uses the IS31FL3728 matrix driver from ISSI. We love these ISSI LED controllers because they give you many channels of control for relatively low cost, but even with their relative simplicity you still need to do some bit twiddling to light the diodes you need. [Dan]’s post talks about some strategies for making this easier like preconfigured lookup tables with convenient offsets and masking bits to control RGB LEDs.
There’s one more trick which we think is the hidden star of the show; a spreadsheet which calculates register values based on “GUI” input! Computing the bit math required to control a display can be an exercise in frustration, especially if the logical display doesn’t fit conveniently in the physical register map of the controller. A spreadsheet like this may not be particularly sexy but it gets the job done; exactly the kind of hack we’re huge fans of here. We’ve mirrored the spreadsheet so you can peek at the formulas inside, and the original Excel document is available on his blog.
3D graphics were once the domain of university research groups and large, specialized computing systems. Eventually, they were tamed and became mainstream. Your phone, tablet, and home computer are all perfectly capable of generating moving 3D graphics. Incidentally, so is Microsoft Excel.
This is the work of of [s0lly], who has been experimenting wtih Excel in this way for quite some time. Starting with pseudo-3D graphics, the project then progressed to the development of a real 3D engine. Naturally, things couldn’t stop there. The next logical step was to advance to raytracing, which was pulled off with aplomb. Shiny spheres on featureless planes are par for the course here.
The graphics are necessarily basic, with resolutions on the order of 256×144. Output is by changing the individual color of the various cells of the spreadsheet. The relevant files are available on Github, for those eager to tinker with experiments of their own. We’ve seen others attempt similar work before, with [C Bel] writing a full game engine for the platform. Video after the break.
Continue reading “Experiments In 3D Graphics Via Excel”
Almost every person of a technical persuasion who has worked in an office will have some tale of wildly inappropriate use of office technology for a task that could have been accomplished far more simply with an appropriate tool. There are jokes about people photocopying a blank sheet of paper when they need a few sheets themselves, but some of the real stories are very bit as surreal.
[Bjonnh]’s patience for such things was exceeded when he received a screenshot embedded in a Microsoft Word file. His response is both pointless and elegant, a Python script that takes a JPEG image and encodes it into an Excel file. It’s simply an array of cells whose background colours represent the pixels, and he warns us that the output files may take a while to load. We just had to subject it to a test, but are sorry to report that LibreOffice doesn’t seem to want to play ball.
So yes, this is a small departure from our usual fare of hardware, and it serves no use other than to be a fantastically awful misuse of office technology. If you’ve ever been emailed a PowerPoint invitation to the office party though, then maybe you’ll have cracked a smile.
If pushing your corporate spreadsheet to the limit is your thing, perhaps you’d also like to see it running a 3D engine.
[C Bel] teaches Excel and he has a problem. Most of us — especially us Hackaday types — immediately write a VBA (Visual Basic for Applications) macro to do tough things in Excel. Not only is this difficult for non-technical users, but it also isn’t as efficient, according to [C Bel]. To demonstrate that VBA macros are not always needed, he wrote a 3D game engine using nothing but Excel formulae. He did have to resort to VBA to get user input and in a very few cases to improve the performance of large algorithms. You can see his result in the video below or download it and try it yourself.
The game is somewhat Doom-like. Somewhat. As you might expect it isn’t blindingly fast, and the enemy is a big red blob, but as the old Russian proverb goes, “The marvel is not that the bear dances well, but that the bear dances at all.” (And thanks to [Sean Boyce] for recalling that quote.)
Continue reading “Hack Excel For 3D Rendering”
When you want a person to do something, you train them. When you want a computer to do something, you program it. However, there are ways to make computers learn, at least in some situations. One technique that makes this possible is the perceptron learning algorithm. A perceptron is a computer simulation of a nerve, and there are various ways to change the perceptron’s behavior based on either example data or a method to determine how good (or bad) some outcome is.
What’s a Perceptron?
I’m no biologist, but apparently a neuron has a bunch of inputs and if the level of those inputs gets to a certain level, the neuron “fires” which means it stimulates the input of another neuron further down the line. Not all inputs are created equally: in the mathematical model of them, they have different weighting. Input A might be on a hair trigger, while it might take inputs B and C on together to wake up the neuron in question.
Continue reading “Machine Learning: Foundations”
Last time I showed you how to set up a reasonably complex design in a spreadsheet: a common emitter bipolar transistor amplifier. Having the design in a spreadsheet makes it easy to do “what if” scenarios and see the effects on the design almost immediately.
Another advantage that spreadsheets offer is a way to “solve” or optimize equations. That can be very useful once you have your model. For Excel, you need to install the Solver add-in (go to the Excel Options dialog, select Manage Add-Ins, and select the Solver Add-In). You might also enjoy OpenSolver. You can even get that for Google Sheets (although it currently lacks a non-linear solver which makes it less useful for what we need).
Continue reading “Optimizing The Spread: More Spreadsheet Circuit Design Tricks”
Accountants and MBAs use spreadsheets to play “what if” scenarios with business and financial data. Can you do the same thing with electronic circuits? The answer–perhaps not surprisingly–is yes.
Consider this simple common emitter amplifier (I modeled it in PartSim, if you’d like to open it):
In this particular case, there are several key design parameters. The beta of the transistor (current gain) is 220. The amplifier has an overall voltage gain of about 3 (30/10). I say about, because unless the transistor is ideal, it won’t be quite that. The supply voltage (
Vcc) is 12 volts and I wanted the collector voltage (
VC) to idle at 6V to allow the maximum possible positive and negative swing. I wanted the collector current (
IC) to be 200mA.
Continue reading “Circuit Design? Spread The Joy”