Nixie Blanking Code

Markd77

Joined Sep 7, 2009
2,806
I think this should make the chime length shorter and adjustable. I've added a line to the section I posted in post #11:

chime_length EQU d'20' ;length of chime (hundredths of second)
 

Attachments

Thread Starter

PICmetoo

Joined Apr 6, 2012
21
The chime adjustment has worked really well. I've brought it right down to 1. I did try to bring it down just a little more but I received an error using a decimal point which was a shame. I've sent you a private message.
 

Markd77

Joined Sep 7, 2009
2,806
This should make the pulses shorter. I had used a bit of a shortcut in the last version which was OK for pulses over about 1/20 second but not so good for really short ones. Possible values are 1-100.
 

Attachments

Thread Starter

PICmetoo

Joined Apr 6, 2012
21
I've just tried your new code and the chime duration is now perfect. I have no need for add resistors etc. The only thing i have noticed is that the chime is in 24hr mode. Basically if it's say 2100hr i now get 21 chimes. Would this be because of the new routine.
 

Markd77

Joined Sep 7, 2009
2,806
I haven't done anything that would change the number of chimes. In fact the code doesn't work properly even for 24 hour mode chimes:
Rich (BB code):
SETCHIME MOVF    HOUR,W        ;On hour change set chimes
        MOVWF    CHIME
        MOVF    HOUR10,F
        BZ        J2
        MOVLW    D'10'
        ADDWF    CHIME,F
J2        RETURN
If HOUR10 is not zero it always adds 10 to HOUR, meaning that it would chime 19 times at 1900h but then only 10 times at 2000h.
I'll see what I can do to put the chimes into 12 hour mode, it might not be tonight.
 

Markd77

Joined Sep 7, 2009
2,806
I like this kind of code, it's got a nice (and unnecessary) level of complexity. Anyway, new file attached.
Rich (BB code):
SETCHIME 
;new code
    movf HOUR10, W        ;convert 0, 1 or 2 into 0, 10, or 20
    addwf PCL, F
    addlw -d'9'            ;HOUR10 = 0 :0-9-9+18=0
    addlw -d'9'            ;HOUR10 = 1 :1-9+18=10
    addlw d'18'            ;HOUR10 = 2 :2+18=20
    addwf HOUR, W
    movwf CHIME
;chime now contains 0-23, subtract 12 if over 11
    movlw d'12'
    subwf CHIME, W
    btfsc STATUS, C
    movwf CHIME
    movf CHIME, W        ;if CHIME is zero make it 12
    btfsc STATUS, Z
    movlw d'12'
    movwf CHIME
    

    return
 

Attachments

Thread Starter

PICmetoo

Joined Apr 6, 2012
21
Thank you for new code. I probably overlooked the chime function as it's been too loud in the past.I will give it a try tonight. All this additional code has really made a big difference in how the clock can be used. I've come across many single, four and six digit Nixie clocks and although the circuits are sound the software is often lacking. Nearly always tube life is overlooked.
 

Thread Starter

PICmetoo

Joined Apr 6, 2012
21
I've loaded up the code and it's running well, the chimes are now correct and the blanking/unblanking is also fine. I've noticed that if the clock is turned on within an unblanking period, that period is ignored, would that be correct. I'm keeping my eye on it at the moment as it's the first time all your work has come together and so far so good. Will Keep you posted.
 

Markd77

Joined Sep 7, 2009
2,806
I'm not sure exactly what you mean, if it's a power up thing could you post the settings section of the code, and describe what's happening so I can try and reproduce it?
 

Thread Starter

PICmetoo

Joined Apr 6, 2012
21
I have tried everything to recreate the problem i spoke about but it hasn't happened again. Basically the first unblank time was set for 0800 to 1000. The clock wasn't powered up, i turned it on and set the current time which was 0900. The display went off and didn't come on until the second unblank time which was set for later in the afternoon. I don't see it as a problem as it was just a one-off. If i wanted to add or delete blank/unblank times do i need to make any other alterations to the code.
My original test bed clock is now looking very second hand so the next item on the list is to build a new clock and case.
 

Markd77

Joined Sep 7, 2009
2,806
I have tried everything to recreate the problem i spoke about but it hasn't happened again. Basically the first unblank time was set for 0800 to 1000. The clock wasn't powered up, i turned it on and set the current time which was 0900. The display went off and didn't come on until the second unblank time which was set for later in the afternoon. I don't see it as a problem as it was just a one-off.
It shouldn't happen, let me know if it does again.
If anyone else fancies trying to spot a bug in the code, please do.
If i wanted to add or delete blank/unblank times do i need to make any other alterations to the code.
To get rid of an unblanking period, setting the blank time earlier than the unblank time should do it.
If you want me to add more periods just say how many you want in total, it's pretty much just copying and pasting and changing a few names.
 

Thread Starter

PICmetoo

Joined Apr 6, 2012
21
I've been using different blanking/unblanking times and turning the clock on and off and it's been fine but i will keep an eye on it over the next couple of days. It's very useful to know that i can easily change to one unblank/blank time. To be honest i'm not really interested in having someone else look over the code as it's perfect for my needs.
 

Thread Starter

PICmetoo

Joined Apr 6, 2012
21
Thanks to Markd77 my single digit clock is running really well. Recently I've been looking at some 4 digit clock schematics and I've narrowed it down to 2 designs both based on the PIC16F84A. Why an obsolete PIC? Well, I just happen to have a few and basically I've had no problems running Nixie clocks with them in the past.
The fist build is from Davide Bucci.
http://davbucci.chez-alice.fr/index.php?argument=elettronica/orolnixie21/orolnixie21.inc
I like this build as it's a no frills basic clock. I spoke to Davide recently asking him why he used only MSPA42 for switching the nixies. He said that was all he had, fair enough.
The second clock is from Christian Klippel.
http://www.jogis-roehrenbude.de/Leserbriefe/Simple_DCF-Nixie-Clock/Simple_Nixie-Clock.htm
This is almost the opposite the Davide's build. It's far more complex with a DCF timing option, date,alarm, snooze and a nice feature is adjustable timing within the software. Even the switch inputs are sort of multiplexed!
Why pick two totally different designs, I guess there seem quirky in there own way, and the reason why i'm still using this thread, both designs seem to lack any real tube blanking features.
As before any help regarding the build of either one would be greatly appreciated especially regarding prolonging tube life.
 

Markd77

Joined Sep 7, 2009
2,806
The German one is unfortunately a non starter. He says in the comments that he is using 1008 of the 1024 program memory, so without finding a good optimisation or removing functionality to free up space it doesn't look possible to add blanking. Also it's pretty complex so would take a while to figure out.
I'll have another look later today.
 

Markd77

Joined Sep 7, 2009
2,806
I mentioned that I wasn't going to help quite as much with this one.
It shouldn't be too tricky for you to modify the French / Italian code as it's quite well commented and pretty simple. Most of the code I wrote for the single digit one is transferable. Probably the first thing to do is get the simulator in MPlab going and have a look at the instruction summary in the datasheet. There's only 35 instructions and they probably aren't all used.
The main difference is that the single digit clock used 4 variables for tens of hours, hours, tens of minutes and minutes, while the four digit clock only uses hours and minutes. That is easier, but needs a few changes (mainly making the code shorter).
Anyway, have a try and feel free to ask questions, I'd suggest making it clear which bits of code are changed (like I did with the ";new code" comments) to make it easier to follow.
 
Top