I have already used this cute IV-21 8-digit VFD to take a while, very cool, so I think it is fun around design a small desktop clock.
I will mainly introduce some of the working principles of this project. Includes software hardware. The software is working on some major tasks, and all of these tasks must run at the same time. First, the atmega328p must produce a higher voltage for the electronics and use Timer1 running in ~ 62.5kHz (the duty cycle will increase the open circuit from ~ 30-120V, respectively). Fortunately, the load (VFD tube) does not really change much during operation, so I only run the boost converter open ring, although it is very simple to turn off the loop by adding some code to the interrupt.
In addition, we need a way to automatically update multiple times to all numbers. This is done in the Timer2 interrupt configured to trigger 2kHz. In this interruption, we did a few things. First, similar to my word and discrete 8-bit LED clock, the interrupt will gradually pass through one in each iteration, and set the correct segment to be sent. The data is sent serially through the SPI peripherals, so we don't have to waste time to manually knock your feet to send the 20 points you need to update the next bit. In fact, it is strange that because the MCU only handles only 8 SPI packets at a time, we finally have to send 3 bytes (24-bit), and the top 4 finally was discarded.
Therefore, we now have high pressure and data flow to the electronic tube driver. What we have to do is to read the button input, dialogue with the real-time clock, and send a beep / beep when pressing the button. I originally wanted to use Timer0 to generate buzz, but found that it is the reason why Arduino libraries to generate delays, and disrupted it will be some annoying. Therefore, in contrast, I just look for a buzzer flag that can set any function to control the buzzer, if the flag is set, it will switch the buzzer pin in the interrupt. Since it can only be switched once within each interrupt period, the frequency is ultimately half of the interrupt frequency, namely 1kHz (a proper sound, but not too annoying for the beep).
The real-time clock can also be controlled by SPI, but I am a little lazy, just contain the library files used for signal signal before I have previously written (I certainly share data and clocks with the MAX6921 drive chip. And give RTC a separate chip choose). We have a lot of free big head, so why not.
For button pins, I think of a separate pin change interrupt to read them, but I just simply reuse the Timer Interrupt with 2kHz frequency polling button and set the global flag, any other function can use this flag. The response button is pressed. In addition, during pressing the buzzer code, the button flag is read in the buzzer code in the interrupt to make a beep when you press any button to obtain user feedback.
Therefore, this is all the content of the software. I found a major error, there seems to always set the number 0 segment a, and it has been tracked to display multiple multiplexer code in the interrupt, so once it has time, I will fix it.
Surprisingly, only the first byte of the SPI packet is set to the number 0 (here 0xFF, but should be 0x00). Anyway, once I solved this error, I will upload all design files to the project page.
hardware
The hardware requirements of the project are very simple: two buttons are used for setting time, a small speaker is used to make a beep, and may increase the alert function in the future, the "high voltage" boost converter controlable by the onboard software can be 5V generates approximately 30-70V, USB micro power input, battery supported real-time clock, and software controllable DC filament driver / driver blanking. In the past, I did the same clock using a large IV-18 tube, and the PCB was done on the prototype by handwired, but this time I want to look more professional.
This design consists of two plates. The first is a motherboard containing all electronic devices to hold time, generate the necessary electronic pipe drive voltage and control all multiple multiplexing segments of the display. I want to keep the circuit board compact, single-sided to assemble, and don't confuse the micro surface mounting components. Most of the digital devices are used for surface mount, but the boost converter assembly is through hole, and the spacing is appropriate for easy replacement or find suitable alternatives. All low pressure items are condensed on the left, while the high pressure items are on the right, while the header is at the end. I chose to do only DC filament drivers because the experience of the brightness gradient caused by DC is not compared to the complexity of the transfer to the AC drive, especially for small pipes like this. This is the circuit and layout I determined:
Be
The second board is just a wiring channel, allowing VFD to be installed above the motherboard and is connected by standard 0.1 inch pin and female aperture to facilitate replacement (in preventing the fire, the end of the unfortunate end) Rough bumps or farther). As follows:
I actually passed a fun time and came up with a simple way to calculate the position of the radial pad. Because Eagle does all operations with Cartesian coordinates, it is easy to make the pads uniformly arranged into a circle. I am still not familiar with Eagle's scripting language, so I will finally set up the coordinates of each keyboard, but in order to make my life easier, I have written a fast Excel spreadsheet if you insert X and Y value, The number of sales, radius, and angular intervals are required. Well, I often hear people say that they never use triangles after graduation, but now these equations are used to use me! Then, what you need to do is to insert the output X and Y coordinates into the Eagle's strike pad position setting, they will be completely aligned!
This "calculator" finally became very useful, I will definitely use it in future projects. I also plan to use various pipe DIY projects.
There are still some small problems in the digital clock scheme circuit. I accidentally wired C6 (large electrolytic capacitance) to wiring to the wrong point (immediately after the switching transistor, not 5V input DOH!), So the boost converter cannot boost. I cut off the line and easily generated a voltage of more than 100V from the 5V input. The second question I encountered is that I connect the MAX6921 HV driver chip to the MISO pin of Atmega. This doesn't seem to have a problem, but it is obvious that the MICO pin is hardwired when the Atmega is configured as the main SPI device, and cannot be reconfigured to be used as an output. But I looked up the MAX6921 pin and connected the bridge line on the Open A1 output pin of Atmega, so everything is OK.
Finally, after all hardware is installed correctly, I can start writing firmware. Here is a short demonstration and compilation video, telling the hardware situation of this project.
Be
Copyright statement: HackADAY authorization, Circuit City original translation video, declined!
If you also like open source projects, and want to share your own open source work, contribute your strength for the open source world!
Video content delivery channel:
[email protected]
Our other product: