Saturday, March 27, 2021

0000 0000 0101 1010

Why PFS154? Part one...

Those who have been here for the (long and torturous) journey with Padauk chips have seen the following milestones (millstones?) much like episodes like in the sitcom "Friends":

        a) The one where I fry many PCBs (fail)
        b) The one where I use my one working programmer to...er...blink an LED (semi-success)
        c) The one where I make an unworkable "old man" version of the programmer (fail)
        d) The one where I "baked" working programmers in a cheap oven (for the win)
        e) The one where I blink a bright LED via a transistor

And if you have seen all of that and are shaking your head about the stupidity and waste, you may be asking yourself the obvious question - but why?

I have of course learned a great deal along the way and there is no doubt (in my mind at least) that this project has given more than it has taken, but a cloud still remains over the whole endeavour when on the shelf I have so many idle Padauk chips - what is the actual end game?

Well, for one, despite their low cost the major goal all along has been getting access to the lovely specs of these chips on the assumption they are not full of tiny socks (long story).

In particular the PFS154, which looks similar to my AVR buddy the ATTiny13, is interesting in that by comparison it is a bit of a muscly fellow, at around 20% of the cost. There's no ADC (grrr), a "feature" we will explore at a later time, but otherwise as Paul Keating might say "That's a beautiful set of numbers!".


First impressions are that the many PWM channels might be of some use in the long-running candle project. More channels surely means a better simulation of the real deal?

The ATTiny13 has two PWM channels (8 bit) and so all previous work on this project has been limited to these specs. I have in the past configured three-in-one SMD 5050 LED such that two of the three LEDs are attached to a "slow rise/fall" channel and one LED for a "fast rise/fall" channel using a three-in-one SMD 5050 LED.

The result is a pretty good random flickering effect (peak intensity shown below in yellow). The plot is from 1000 points based on the code and then outputted to Serial on an Arduino Nano. The data was copied to a spreadsheet to make a pretty picture.



For three channels the result is quite different, with what I think is more natural "smoother" variation.



Some work still to be done:

1. Non-linear ramping (low pass filter or software?)

2. Separate ramping gradient for medium and fast ramping (e.g. different AND variably adjusted rates per ramp)

3. "Guttering" code - a natural phenomena whereby a candle will almost go out and then relight, for instance in response to a breeze.

4. Porting code in part or in entirety to assembly for efficiency.

5. Running the PFS154 at the lowest clock speed

6. Sleeping PFS154 between PWM adjustments?

The code itself was ported pretty much intact from an early ATTiny13-based version. I later developed that version into more efficient (smaller, faster) assembly code and as well wound the clock speed of the microcontroller down to around 128kHz. Is any of this possible also on the PFS-154? Watch this space.



No comments:

Post a Comment