I have completed version 1.0 of my signal generator. There will definitely be a revision as there are a number of things still to straighten out, but overall I am pleased with the result.
The 3D printed box with 20% fill on the box walls, was easy to drill, though I recommend a drill press. I made the top cover thick enough that my controls (rotary encoder and switch) could be threaded into the plastic and no surface nuts required. This seems to work well, though it remains to be seen how it holds up over time.
The point-to-point wiring inside is a pain in the tush. Version B will definitely have a single PCB with all the components (display, power switch, rotary encoder, Trinket PRO, Si5351 and battery) plugged into it and mounted on stand-off spacers to the front panel. I also definitely need to screw down the display. The friction fit to the panel is good, but not good enough. The picture below was taken before the Si5351 was installed.
So, overall I am pleased and look forward to using this new addition to my tools.
Showing posts with label ST7735. Show all posts
Showing posts with label ST7735. Show all posts
Tuesday, May 26, 2015
Monday, May 25, 2015
So, what do you think?
The second round of 3D printing I think is very close to what I need for this simple Si5351 signal generator. The new mounting method for the display works well. A little bit of plastic needed to be trimmed in order for the display to fit into place, but not bad.
The display fits very snugly so I will let it be for now. I will likely drill out the corner holes and install screws to keep things in place.
The rotary encoder will be mounted to the right of the display. In reality, with a single line of code I can flip the rotation of the display by 180 degrees so it is easily adaptable to left or right handed operation.
I have been considering how to implement a single control interface using the rotary encoder and its built in push button. I think that I will use a single press of the encoder knob to cycle between the three clocks. The active clock is the one displayed in yellow.
Turning the rotary encoder will change the currently selected digit of the active frequency. To change the tuning rate, I am considering rotating the encoder while holding the knob depressed to select which digit is changed by the encoder.
Otherwise, there will be a power switch and the three clock SMA output connectors. I am unsure if I will mount them on the face along side of the display or if I will mount them on the side of the case. I plan to use a small LiPo battery to power the entire device.
Overall, I am pleased with 3D printing as a medium for prototyping things like this case. The aesthetics are not the greatest, but the strength of the case and the amount of accuracy of the print to the object design is quite good. It will be interesting to see if my son's calibration efforts on the printer will have any effect on the aesthetics.
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.
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...
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...
Tuesday, May 19, 2015
Si5351 Signal Generator - 3D print of case
Now that the software is in pretty good shape (with a couple lingering issues) I turned my attention to building a case for this project. Here is a simple front panel design I whipped up (ok, painfully slowly created after many mistakes...) using the online CAD software at www.onshape.com. They have a pretty cool product offering there and it is certainly sufficient for these kinds of simple projects.
At this point it is pretty handy to have a son with a 3D printer. Here it is printing this little guy. I will go pick it up tomorrow and see if my display will fit into it.
Here it is, finished in 56 minutes.
More to come...
My little display and rotary encoder should fit nicely onto this panel. As soon as I decide which Arduino board I am going to put into this project, I will work up a nice case back that this will snap into. Yeah, yeah, this is my first CAD project, so I am 100% certain I will need to redesign it in some fashion. Like for example, I suspect that I will have to put mounting screws through the panel into posts. Don't beat me up too badly about my lack of CAD skills.
Here it is, finished in 56 minutes.
More to come...
Sunday, May 17, 2015
UPDATED: Si5351 Signal Generator
I have been updating the UI on my Si5351 signal generator a little bit today. I think it is about where I want it to be. I display all three clock frequencies directly at the moment. There is the notion of a current clock that will be displayed in yellow text. The other two are displayed in white text. In the image below, CLK2 is active. The active clock is the one that will be modified if you rotate the rotary encoder.
Each of the clocks can be set anywhere in the 8 kHz to 160 MHz range. However, I still have some anomalys as at very low frequencies and at very high frequencies, the clock output does not follow the display. Obviously, I have more reading to do on the Si5351 datasheet to understand what I am doing wrong.
A button press will cycle through the three clocks. The rotary encoder press will cycle through the digits of the frequency allowing you to change the tuning rate. I may get rid of the button and have the rotary encoder button press cycle between selecting the clock (by turning the encoder) and changing the digit that is changed when the encoder is rotated. Dunno...
I may give some thought to treating one of the clocks as a VFO and another as a BFO and displaying the difference between them for the VFO clock, but setting the output frequency to the sum of the displayed frequency and the BFO frequency. This would allow for a receive frequency display while the actual VFO frequency is quite different. In this mode the signal generator could be a convenient receiver display. This could also be an update for another day. I also want to provide some indication of which digit will be changed when you turn the encoder. Currently no indicator is present.
Currently I am running this on my ATMega2560 but the plan is to use an ATTiny85 or perhaps one of the small ATMega328 units such as the Nano, or the Adafruit Trinket Pro.
So, once I get the frequency setting questions answered, I am going to put the arm on my oldest son to 3D print me a small box where I can package up the display, rotary encoder, power switch, Arduino and the Si5351 into a nice battery powered, portable signal generator unit.
Each of the clocks can be set anywhere in the 8 kHz to 160 MHz range. However, I still have some anomalys as at very low frequencies and at very high frequencies, the clock output does not follow the display. Obviously, I have more reading to do on the Si5351 datasheet to understand what I am doing wrong.
A button press will cycle through the three clocks. The rotary encoder press will cycle through the digits of the frequency allowing you to change the tuning rate. I may get rid of the button and have the rotary encoder button press cycle between selecting the clock (by turning the encoder) and changing the digit that is changed when the encoder is rotated. Dunno...
I may give some thought to treating one of the clocks as a VFO and another as a BFO and displaying the difference between them for the VFO clock, but setting the output frequency to the sum of the displayed frequency and the BFO frequency. This would allow for a receive frequency display while the actual VFO frequency is quite different. In this mode the signal generator could be a convenient receiver display. This could also be an update for another day. I also want to provide some indication of which digit will be changed when you turn the encoder. Currently no indicator is present.
Currently I am running this on my ATMega2560 but the plan is to use an ATTiny85 or perhaps one of the small ATMega328 units such as the Nano, or the Adafruit Trinket Pro.
So, once I get the frequency setting questions answered, I am going to put the arm on my oldest son to 3D print me a small box where I can package up the display, rotary encoder, power switch, Arduino and the Si5351 into a nice battery powered, portable signal generator unit.
Saturday, May 16, 2015
Si5351 Signal Generator
I have been expanding on my initial experiments with the Si5351 today while at the same time getting some experience with my little 1.8" colour TFT display. This is a nice little display that I picked up locally. It has an SPI interface and using an ST7735 controller.
I initially was bit-banging the SPI protocol using arbitrary pins on the ATMega2560, but was quite dis-satisfied with the performance. The display was very laggy and slowed down the entire experience.
By switching to use the hardware SPI support on the ATMega2560 (using pins 51 and 52 for MOSI and SCK signals respectively) the performance improvement was spectacular. On the UNO, the hardware pins are 11 and 13 for MOSI and SCK respectively.
I am using a modified version of the Adafruit graphics library and the Adafruit ST7735 driver for my experimentation.
I found a couple of problems which I don't know if I can attribute to the Adafruit libraries or to differences with the specific LCD panel I have in hand. I will have to order one of the Adafruit versions to determine which it is. I found that the color mappings were reversed between RED and BLUE and also between YELLOW and CYAN. If I can obtain a version of the Adafruit display I will test again and report my findings.
I set up my Si5351 clock generator and the TFT display as a three frequency signal generator. There is still some UI work to be done to select between the frequencies to be changed by the rotary encoder, but here is the general idea. I am reusing my previously published rotary encoder bits in this little project.
I will have the ability to independently set each of the clocks on the Si5351. At the moment the code sets the initial frequency of each clock and then moves them all when the rotary encoder turns. I plan to publish the code here when I have it all working satisfactorily.
Performance of the display is now very good, even when updating all three frequencies with the rotary encoder simultaneously. This might be a good candidate for a little Arduino Nano or other minimal Arduino board to allow packaging this up into a useful signal source.
I initially was bit-banging the SPI protocol using arbitrary pins on the ATMega2560, but was quite dis-satisfied with the performance. The display was very laggy and slowed down the entire experience.
By switching to use the hardware SPI support on the ATMega2560 (using pins 51 and 52 for MOSI and SCK signals respectively) the performance improvement was spectacular. On the UNO, the hardware pins are 11 and 13 for MOSI and SCK respectively.
I am using a modified version of the Adafruit graphics library and the Adafruit ST7735 driver for my experimentation.
I found a couple of problems which I don't know if I can attribute to the Adafruit libraries or to differences with the specific LCD panel I have in hand. I will have to order one of the Adafruit versions to determine which it is. I found that the color mappings were reversed between RED and BLUE and also between YELLOW and CYAN. If I can obtain a version of the Adafruit display I will test again and report my findings.
I set up my Si5351 clock generator and the TFT display as a three frequency signal generator. There is still some UI work to be done to select between the frequencies to be changed by the rotary encoder, but here is the general idea. I am reusing my previously published rotary encoder bits in this little project.
I will have the ability to independently set each of the clocks on the Si5351. At the moment the code sets the initial frequency of each clock and then moves them all when the rotary encoder turns. I plan to publish the code here when I have it all working satisfactorily.
Performance of the display is now very good, even when updating all three frequencies with the rotary encoder simultaneously. This might be a good candidate for a little Arduino Nano or other minimal Arduino board to allow packaging this up into a useful signal source.
Subscribe to:
Posts (Atom)
