Showing posts with label TFT. Show all posts
Showing posts with label TFT. Show all posts

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.

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.