• Transformer Corner part 3

    Transformer Corner part 3

    Designing your own HV Transformer

    In Transformer Corner Part 2, I looked at the power supply used in my early Prototype, and showed how to determine the key requirements for the HV transformer.

    Now, let’s see how I could choose the materials and design the transformer – without any pesky mathematical formulae!

    A hand-wound HV transfomer!
    The end goal – a hand-wound HV transfomer!

    Picking a core

    The first challenge was to find a suitable core from my junk box. First off, recall from Part 1 that this couldn’t be iron (too ‘slow’ for 151 kHz), and it couldn’t be air (too ‘weak’ for 25mA). I suppose I could have tried plastic, milk, or even beer – but I knew better. I knew about a substance called Ferrite.

    (more…)

  • Transformer Corner part 2

    Transformer Corner part 2

    In Transformer Corner part 1, I introduced one of the key parts of the Oscilloclock – the HV transformer, and tried to illustrate some of the concepts and history behind it.

    Next, let’s explore the Prototype’s power supply configuration. This will tell us a lot more about the transformer I had to wind!

    Power supply design

    My greedy little Oscilloclock wanted lots of different voltages…

    (more…)

  • Do chips have bugs?

    Do chips have bugs?

    There are probably many people who think that microcontrollers are bug-free. After all, they are glorified integrated circuits; a hard-wired jumble of infinitesimal transistor logic gates. There should be no unexpected behavior, as long as you operate the device within the rated voltage and temperature parameters….

    Wrong!

    What we tend to forget from our CPU architecture classes is that a CPU actually has a program inside. Known as microcode, its primary function is to interpret each instruction into the right electrical signals to drive the various parts of the CPU. For example, an addlw 0x7F instruction might involve directing the ALU’s input to the next word in program memory (0x7F), and then telling the ALU to add it to WREG, with output set back in WREG. The microcode for addwf MyVar would be different again; it needs to get a value in RAM, and set the result back there too.

    Well, where there is a program, there will definitely be bugs.

    My first experience with a microcontroller bug cost me several weekends of frustration, fretting, and frantic but fruitless rework. Here’s how it happened:

    Oscilloclock Gone Wild

    It was the early days of the Prototype, And things were looking great! My dream was coming to fruition! Except… every once in a while, the clock would go absolutely berserk. Seemingly at random, it would start displaying crazy, meaningless images, and controls would cease to function. Sometimes it would recover; other times, it would exhibit brain death – requiring a hard reset.

    April Fool's? No - it's a PIC bug!
    April Fool’s? No – it’s a PIC bug!

    No amount of testing or experimentation could tell me what the problem was. I rewrote huge blocks of code. I removed massive chunks to simplify the code. I drank more and more coffee. Sleepless nights and grumpy days ensued, wasting my precious youth!

    (more…)

  • Font & Figure Creator!

    Font & Figure Creator!

    Those of you who own, or are building, an Oscilloclock may have realized how tedious it is to create a new character or drawing. My little Casper (October, Seasonal Treats post) required a grueling 5 hours to get him looking good!

    Casper - as drawn by my son (L) and then the Oscilloclock (R)
    Casper – as drawn by my son (L) and then the Oscilloclock (R)

    The current method – Painful

    I have another blog post series in progress describing the theory behind Circle Graphics figure display, so I won’t elaborate on details, but the current process of getting a figure from paper to screen is very much manual:

    1. Roughly sketch out your figure on graph paper.
    2. Split out your lines and curves into blanked circle and line segments.
    3. For each segment, roughly ascertain the circle’s radius (width and height) and centre coordinates.
    4. Type the numbers into the code file, in PIC assembly language syntax.
    5. Build the code and Program the PIC.
    Easy?

    NO.The figure looks NOTHING like you expect. The size is wrong. The edges don’t meet up. The curvature is out. The thing is upside down. All of the above!

    • Repeat steps 3, 4, 5 for several hours. Drink coffee. Redraw and repeat for yet another few hours.

    • Finally – Celebrate the birth of a new figure!

    The Easier Way

    The new Oscilloclock Figure Creator utility allows you to easily create and modify font characters, graphic images, and sprites – interactively.

    (more…)

  • Circle Graphics – Lissajous figures

    Circle Graphics – Lissajous figures

    By the time you read this post, you must have seen the term “Circle Graphics” in a thousand places across the site.

    In fact, “Circle Graphics” is not an official term – I just use it to describe how shapes are drawn on these clocks:

    Everything you see on this screen is made up of CIRCLES! Blank out part of a circle and you get an arc. Squish an arc and you get a line. This clock simply draws circles, lines, and arcs of different sizes at various points around the screen. It does it quickly. And it does it very, very well!

    The effect of using circles is beautiful – shapes are smooth and precise, with no jagged edges or pixelation.

    Beautiful circles with no jagged edges

    Making “perfect” circles

    I carry on as if it were some incredible new concept or discovery, like the Higgs boson. But in fact, the analog technique of constructing perfect circles, ovals, and lines on a CRT is very, very old. These figures are really part of a class of shapes called Lissajous Figures.

    (more…)