“In the valley of the blind, the one-eyed man is king.”
August Wilson
My eyes are fading and the components I'm soldering seem to be getting smaller! In anticipation of future SMD projects I decided to upgrade the lighting in the workshop.
I could have (read: should have) just fronted up to the hardware store with a fistful of dollars but in the tradition of spending way too much time (and money) making something at home, I looked into the buckets and pulled out some bits and pieces which put together may resemble lighting.
Along the way I happened upon some discarded light fittings at the local recycling centre and before you know it I had a skeleton of an idea.
A 3D printed case for the circuitry to hide in, and some appropriately oversized heat sinks strapped to the the cobs, saw the project conclude with a well lit work area - nice one!
The only downside was that the extra light in the previously dark corners of the workshop revealed a LOT of cleaning up needed (and a few forgotten components found!)
The PSU project is so close to finishing now I can almost smell it! (solder
fumes or magic smoke?) I have learned so much along the way and as usual one of my favourite
quotes bubbles up to the surface of my mind:
“There is no such thing as a problem without a gift for you in its
hands. You seek problems because you need their gifts.”
Richard Bach (Illusions)
One of the remaining challenges I set myself is to provide an indicator LED for when one
of the regulator circuits is live. So for instance if the 5V circuit is live, I'd like a visual indicator.
After a few trials, I used a simulator to
narrow down the components required, centering on the
BS170
mosfet. The reason I chose a mosfet and not my old favourite the SS8050 BJT is
that a mosfet gate is triggered by voltage whereas a BJT base responds to current.
So theoretically, as soon as the transistor gate senses voltage in the circuit above it's threshold voltage, it should let current flow to the LED.
The gate threshold voltage for the BS170 is typically around 2 volts and as
I'm not asking for any voltage below 3.3V then it should be fine to trigger the LED in the circuit as shown.
After wiring up the components as shown in the diagram above, I was able to
turn on the regulator and see the indicator LED, even under load.
Choices for the LED resistors are centred around Ohms Law and, using 10mA as a
benchmark, should be as per the following spreadsheet snapshot:
After all the testing the concept seems quite sound, so now the final stretch of this <long> project is to box the whole shebang in a 3D printed housing, throw the switch and stand back!
A few attempts were made recently to solder up a "Data Flash Board". While I eventually produced some working modules, there were moments when I doubted the authenticity of some of the components including the voltage regulator and the WinBond W25Q32FV 4Mb flash memory chips.
I de-soldered a couple of the data chips and replaced them, which resulted in working modules, but I did keep the "faulty" chips and started to look about for a means to test them. Sure enough the hardware is pretty ubiquitous.
I had to swap out to Windows, but I'm still hopeful of finding a software option that might work on a saner OS. The linux program "flashrom" works fine, but it does not appear to have a current GUI.
I think problems programming these little fellows nearly always comes down to a driver issue, and chasing OS upgrades is not fun as usually recompiling the drivers from source code is required.
In my case after a bit of fiddling around I was able to read a chip, blank a chip, write to a chip and recover data from a chip. Oh, and the two chips that I thought I had fried? Still working!
I count that as a success (notwithstanding the stupendous amounts of time invested faffing about with these EEProms, the software, the drivers, the emulators, etc.,).
Everyone seems to be buying an air fryer at the moment. I'll wait until they're out of fashion to pick up one. That's how I got my awesome bread maker!
Meanwhile, in my little corner of the garage where I solder up unsuspecting components, I try not to breathe in any of the nastiness that comes up from the boards being tortured.
One of the first things I "made" in the workshop was a solder fume extractor fan which comprised a re-purposed computer cooling fan and funnel as shown.
In a recent experiment I unwittingly fried this extractor fan by running a few more amps through it than recommended (>160mA). The hunt was then on for a replacement fan. I do have some new 12V fans bought for cooling projects, but they are way smaller than this application requires.
But for awhile during this replacement process I did feel like I was in a three little bears skit, surrounded by fans pulled from 2nd hand computer cases that were either two small or two big - none that were "just right".
Finally in a dark corner of the garage, inside a power supply inside a old computer, I found what I was looking for and cobbled the whole extractor back together. I'm gonna miss the smell of solder in the mornings...
16-bit arithmetic on an 8 bit device in assembly (Part One)
The PFS154 has three 11-bit (2048 increments) hardware PWM channels, which is great - but it is an 8-bit microcontroller. So it might be time to explore 16-bit arithmetic to cover the possibility I might use the full PWM capabilities on this device.
Crazily I have also decided to explore this from an AVR assembly perspective (???). The problem with this is that the PFS154 is not part of the AVR family, I have no familiarity with the instruction set for Padauk assembly, and as well no experience with the toolchain to program the PFS154 in assembly. So...
I'm going to start with subtraction. From my AVR by example booklet, the sub command simply subtracts one register from another. When zero is reached the flag is raised and a branch can be initiated. It's pretty simple code - check out the video below for the code running on Gerd's excellent AVR-SIM.
A quick screen grab shows the beast humming along happily subtracting (and keeping an 8-bit count of the loops in R22). Note that AVR has no "add immediate"(addi) command on the premise that you can subtract immediate (subi) using -1 instead. It's a little weird but 5 - ( -1) = 6 and that's OK with the AVR (and me).
Two byte (16-bit) subtraction uses both sub and subc for the low and high bytes respectively. The subc command is subtract with carry which will use the registers defined to effectively result in a 16-bit operation, as per the code below.