-
She's Lost Control Again? IR Remote and Microcontroller Shenanigans
01/06/2023 at 16:26 • 0 commentsIt was Monday when I bought a RC-5 remote for the Little Red Devil and was doing final tests on the amp, and to my disappointment, the remote control didn't work. Of course I wouldn't ship a non-functional amp, so I took a deep dive and checked what was going on... The relay and motor control outputs worked fine, there were pulses visible on a scope when I tested the IR sensor's output. So, was the code faulty? I looked into reading the RC-5 remote control commands, managed to decode them with an Arduino but not with the ATTiny45 microcontroller I built the board around. Why? It took me a few days to close in on the problem. First I thought it was I/O ports being assigned some special function rather than being usable as GPIO pins, but I could use any of them for controlling a LED, no problem.
At some point I noticed that whenever I tried to flash a LED, it would shine a lot longer than it was supposed to. 50ms should be a really short pulse, right? Right... and yet I saw a LED shine for half a second or so. The timing was clearly off. Time to read into the microcontroller's fuse bit configuration and see if something was wrong there, and it turned out my chip's fuse bit config wasn't the same as default here: http://eleccelerator.com/fusecalc/fusecalc.php?chip=attiny45&LOW=6A&LOCKBIT=FF which was 0x6a for the lower fuse, and I had 0x62. Stupid as I am, I reprogrammed the chip to 0x6a, locking myself out of it, because now it expected an external crystal oscillator on pins 3 & 4 in order to work. So, off to a parts store, grab a crystal and two caps. Done. Restored 0x62. Problem persisted. Then, oh well... what if I disable the CLKDIV8 bit for frequency down-scaling? I did, and I tested the chip, and it was waaaaaay more realistic timing-wise, what was supposed to be 50ms pulse lasted a lot shorter than before, closer to what I would expect. Then, I uploaded the proper remote control code, tested it and tadam! It worked. Both the input selection and volume control. Winner winner, chicken dinner. The last thing I did was adding some code to store the last input selection relay state in ATTiny's built-in EEPROM, so that whenever you turn the amp off and on again, it would restore the previous selection rather than having to set it every time. The remote control is working fine now.
-
Little Red Devil on Youtube
01/02/2023 at 14:47 • 0 commentsBefore shipping, I made two videos on this creation:
Fitst, the overview of the internals, schematics... and final assembly too:
Then, there's the story of how I made it and what design challenges I had:
-
Finished!
01/01/2023 at 22:58 • 0 commentsI built this amp on an extremely limited budget, having to make do with what I had in my lab (vintage parts), the cables, connectors, audio pot and enclosure from my customer, and secondhand vintage output transformers. He once mentioned he'd be tempted to make it red... while I already had painted the enclosure. Great minds think alike, it seems. I decided to make an amp that not only sounds nice, but also looks lovely, that's why I went to extra lengths with the internal construction to make as few holes in the enclosure as possible, and used an extra box to house the output transformers and control circuit board. While the pot control and Bluetooth interface were customer's wishes, I treated them as an additional engineering challenge, looked into doing that and I did... An interesting additional challenge for me - to avoid drilling holes in the enclosure, but still have a possibility of adding a remote (which normally would be done by putting a jumper on for powering up the controller), I used a reed switch from an old telecom relay. Putting a magnet over it before switching the amp on will throw the microcontroller in the programming mode, allowing the user to define the remote control buttons for volume up, volume down and input selection.
After several months of coping with depression and anxiety, which means I rarely had energy to go on and my progress slowed, I finished the build, tested and debugged it, put it together, drew the schematics and made documentation, YT video included :).