Nixie Clock 2

I built a second nixie clock as a gift, it is in the picture below.  It is similar to my first nixie clock, as it uses  5863SI nixie tubes and an ISD1110 for a chime.  There are two n0table differences, though. 

First, I use a Supertex 5622 for the high voltage driver.  Since the 5622 is a 12 volt part, I was concerned about interfacing it to the 5 volt ATMega8.  It turns out that the 5622 is 5 volt cmos compatible, there were no interfacing problems.

Second, I use a rotary encoder to set the time.  The red button cycles through setting the minute, then the hour.  Turning the grey knob adjusts the minute/hour up or down, depending on the direction of the turn.  Inexpensive mechanical rotary encoders are readily available, e.g. at Digikey.  I use the following code to interpret the results of the encoder, by polling the  function.

#define NULL 0

#define ZERO 1

#define PLUS 2

#define MINUS 3

flash char enc_val[16] = { ZERO, MINUS, PLUS, NULL,

                                      PLUS, ZERO, NULL, MINUS,

                                     MINUS, NULL, ZERO, PLUS,

                                     NULL, PLUS, MINUS, ZERO };

char enc_state = 0;

void get_enc_state(){

  enc_state = ENCA + (ENCB << 1);

}

 int get_enc_update(){

  char old_state, trans_state; old_state = enc_state;

    get_enc_state();

    trans_state = (old_state << 2) + enc_state;

    switch(enc_val[trans_state]){

    case PLUS:

        return 1;

    case MINUS:

        return -1;

    default:

        return 0;

    }

}