2.4 KiB
AT-VFD
Goal: Controlling a VFD with an Atmel microcontroller
Compatible hardware: Princeton PT6302, OKI ML9208 (note that in naming the PT6302 datasheeet is followed)
Project is work in progress, breaing changes might come in the future
Using the driver library
Modify PT6302.h
- Re-define the macro
DISPLAY_DIGITSto the number of digits on your VFD - replace the pins in
enum pinswith th pins you have wired to the given controller interface pins
Include the PT6302.h in your application and use the functions to display whatever you want.
Building
Use either GNU make or CMake whichever you're familiar with.
Dependencies
The project uses avr-libc as well as avr-gcc, please install the packages neccesary. For building you need either GNU make or CMake.
If you're using CLion, it should automatically pick up on CMakeLists.txt, but you still need to modify it to your hardware.
GNU make
Modify Makefile:
- Change
MCUto your target microcontroller - Change
F_CPUto the frequency of your microcontroller's clock source - In
CFLAGSmake sure that the path afterIis where you have your avr c libraries TARGETshould be the project name (or keep it as is, it doesn't matter)- In
SRCSreplacemainwith your application's c and header files - Change the avrdude command in
flashto the device and port you're using for downloading the firmware
Then in the project directory run
make && make flash
to compile and download firmware.
CMake
Modify CMakeLists.txt:
- Change
TARGET_CPUto your target microcontroller (in thesetstatement) - Change
F_CPUto the frequency of your microcontroller's clock source (in thesetstatement) - Put the full path to your avr c libraries int the
include_directoriesstatement - Replace
main.cwith the name of your c source and header files in theadd_executablestatement - Change the avrdude command in the custom targeg
FLASHto the device and port you're using for downloading the firmware
Create a building directory for cmake and change into it:
mkdir cmake-build-debug && cd cmake-build-debug
Then compile, link and flash:
cmake .. && cmake --build . -t FLASH