Monday, May 25, 2015

Si5351 Signal Generator (continued)

My first attempt at 3D printing a case for my signal generator project was, shall we say a good learning process.  The printer printed what I created, but a number of rather fatal flaws in the design indicated the need to scrap it and try again.

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
My son is in the process of dialing in his 3D printer.  This one looks a little rough as he has sped up the head speed considerably in order to cut down on print time.  His extrusion feed rate is a little high and his X vs. Y axis accuracy in this print is about 0.06 mm (about 2.5 mil).  After calibration his accuracy is now about 0.02 mm (about 0.78 mil) so the next print should be a lot cleaner.  His extrusion feed rate causes his interior dimensions to suffer a bit as he is putting down too much material.  He should have that dialed in before he reprints this for me.  We also went to a 20% fill rather than solid, so it will be interesting to see how well that can be drilled.  The top is a tight fit so I will likely need to cut a thumbnail slot along the edge so I can get it off the case once the display fills the hole.  Once he has the new calibrations in place and I have verified my geometry will work with the parts I have in hand, we will print one more and it should look a lot better.

More to come...

1 comment:

  1. This comment has been removed by a blog administrator.

    ReplyDelete