Close

PWMing 2

A project log for Floppy-bird

Use a floppy-disk as a multi-frame-buffer, store audio-samples, and increase capacity to boot!

eric-hertzEric Hertz 04/12/2018 at 01:291 Comment

Again, we cannot send our PWM *data* directly to the floppy-drive's /Write-data pin. Instead we need to send two falling-edge pulses for each PWM-nibble. Confusingly, I plan to use a PWM-output from the microcontroller to create those *two* precisely-timed falling-edges. Thus requiring *two* uC-PWM cycles to write *one* PWM-nibble to disk.

In order to write the PWM-data, I've come up with a couple possibilities: 

In both cases, the negative-going /WR pulses will vary in duration depending on the value of the PWM-nibble to be written. This shouldn't matter, as the flux-transition is triggered by the falling-edge.

The second case is a little less-intuitive, as the PWM-output cycle starts midway through the PWM-data signal.

Importantly: the PWM-signal will have a constant period, possibly saving several instruction-cycles, which may be near the limit.

These cases both assume a PWM-output that starts high and goes low after a set duration... AVRs allow for the opposite, or it could easily be done with an inverter, but I've yet to analyze whether that could be helpful (e.g. in aligning a *data* start with a *signal* start?). My intuition is that doing-so would require both PWM-output cycles to vary in period, e.g. duration1=value, duration2=2us-value, eating into our valuable instruction-cycles.

Discussions

Eric Hertz wrote 01/03/2019 at 05:32 point

I especially like the part where when I finally got around to coding, I'd completely forgotten *both* of these techniques, and coded-up the third: the one which was dismissed early-on when it was only a vague idea, due to its having the most computational overhead... Then, apparently re-discovering the hard way there may be too much computational-overhead.

On the plus-side, now I've got some ideas to reduce that!

Note to self: There's a bunch of these original thoughts painstakingly-thumb-typed on my phone... PUT THOSE IN v62! Then read them!

  Are you sure? yes | no