Meanwhile, I have decided on the controller that will be dedicated to this project. Given that the Si5351 and my TFT display are both 3V3 devices, I decided to utilize the Adafruit PRO Trinket 3V3 device. This is essentially a 3V3, 12 Mhz Arduino Uno without the USB controller and with a couple of I/O pins being dedicated to other purposes and therefore unavailable (pins 2 and 7).
Since I developed the code on the ATMega2560, it seemed that my next task would be to convert the code to run on the ATMega328 processor found in this device and to make some final I/O pin assignments with this device in mind. The conversion was a little more complicated than I first anticipated due to my sloppy coding on the first go-around.
I didn't want to put header pins on this board for this project, so I used my Arduino Uno to verify the code changes (and to clean up my sloppiness). I have wired everything using the 3V3 source, but since the I/O pins are 5V on the Uno, I used an NTE4050B buffer to do the level conversion to 3V3 on the pins going to the display. This will not be necessary once I wire up the intended controller as it is a 3V3 device. The Si5351 is not shown in this image.
The setup of the 1.6.4 IDE to support the Trinket PRO was fairly straight forward, but here still be dragons. The Adafruit web site recommends just downloading the IDE with the Adafruit board support definitions already installed. This is convenient, but creates a set of additional problems which I will likely make the subject of a separate post.
The other thing I learned is that if a class name defined in your code happens to collide with a class name in an existing library in your installation, even if that library is not used in your project, that library will still be compiled and can cause duplicate symbol errors or can surface dependent library missing errors. I ran into this because I have in my project a file that defines a class for the Si5351, but I also have installed the Adafruit_Si5351 library into the IDE which also defines a class with that name, though in a different name space. Even though I am not using it, the Adafruit_Si5351 library gets compiled by my project, but since that library depends on the Adafruit_Unified_Sensor library which I had not installed, I got a compile error. Had the compiler error not occurred, I would have likely gotten link errors. I need to dig into this in more detail as I believe this to be a bug in the current 1.6.4 IDE from Arduino.cc but need to simplify the reproduction of the issue before filing a bug report. A lot of work has gone into this version's handling of libraries, but here still be dragons. My workaround was to delete the Adafruit_Si5351 library from my installation and able to recompile without errors.
So, now I need to make some software changes to allow me to eliminate the extra push button in favor of just the rotary encoder, its push button and the display being the entire user interface. I also want to provide a mechanism to enable/disable each clock as desired.
My son meanwhile has been busy printing my latest attempt at a case for this project. I am certain this will not be the final print, but the changes made were to eliminate the plastic posts to hold the display and to make the front panel thicker to give it more rigidity. I increased the lip size and provided a recess for the display to sit in. Hopefully it will be a nice friction fit, but if not, I will drill the case and install plastic screws to hold it in place at the corners.
|3x4x1.5 inch project box|
More to come...