Thursday, September 14, 2017

A SI5351 VFO-BFO UPDATE 9/15 9/16 9/21




Working on Pete's Simpleceiver + I need to build another VFO BFO.  The SI5351 based boards have been my favorite for several years now.  I have several different versions of boards that I have tried, but prefer the small module from Adafruit.  It is very small, and comes built for around $8 plus shipping.  One of the things I like about it is that the clock outputs are brought out to a header along with the SMA connectors.  I have used this board in several projects and have designed different boards for each one.  With this I plan on designing a board that can be used with many different projects.
  
The design considerations are, board size around 2" x 2",
Arduino Nano, rotary encoder, TFT display, a connector for the Adafruit SI5351 board. After an initial design and exchanging several e-mails with Pete I have expanded it to also provide a connector for a small  I2C OLED display.  Because there are several pinouts for these displays, some will plug in directly to the connector others will have to use a connector cable to the display. This connector could also be used to connect to a I2C version of a 1x16 or 2x16  line LCD display. With the correct software drivers you could use one of these LCD displays, a small OLED display, a 128x128 or 128x160 TFT display, or even a monochrome Nokia display.    I also added a connector that brings the rotary encoder connections out to a separate connector so you can  use either the bare encoder mounted on board, or one of the pre-wired encoder boards. I have not tried but you could probably use an optical encoder through this connector. 
One thing I added was provisions for a voltage divider that can be used to measure input voltage if the board is used in a battery powered project. Finally I decided to bring some of the unused Arduino pins out to an auxiliary connector for use in other projects.

Since the board layout is similar to several others I have done, I was able to modify one of them fairly quickly.  I did the board as a single sided board that can easily be made using the "toner transfer" method.  Although I usually etch my own boards, in this case I decided to order some from one of the inexpensive Chinese board houses.  If they turn out well, I will follow Pete's suggestion and make some available at a reasonable cost for those who are working on the Simpleceiver or other project that needs a VFO-BFO.  I think I will start with one of these boards as the basis of a simple signal generator for routine use.  This should be a easy way to test the different video drivers needed for the different display options available.

I ordered the boards on Sept 9 with DHL express delivery, and was pleasantly surprised when I received them on the 13th.  I quickly wired one of them up to see how they will work.  Changing some of my other sketches to reflect the correct pin configuration I tried the board with a small OLED display and a 128x128 TFT display. After getting a working display with each, I was sure that the board worked correctly. 
I installed a right angle female header strip so I could mount an external rotary encoder board, and took some pictures of possible display configurations. There are several more that I could try, but this is what I had handy.
I also took a picture of the Adafruit SI5351 board mounted on the back.  Depending on how the header pins are installed in the board, it can also be flipped to have the edge with the SMA connectors extending past the board edge.  I planned on the Nano and SI5351 board to be soldered to the board, but they could be socketed if you do not need to keep everything really compact.  As it is with everything soldered the package with the OLED or 128x128 TFT is about 2"x 2"x 1".  This should be small enough to fit in most project packages.  Now to write some software to fully test each of these configurations
9/15/17

I had some time today, so I took Pete's Simpleceiver Plus DCR sketch and modified it to reflect the changes in the pin assignments on the new board.  And after I had it working with the 160x128 TFT display I modified that to reflect the 128x128 display.  There are several different versions of the 128x128 display that use different driver chips, so I had to also change the driver library and initialization code. With a little tweaking on position on the display I was able to get a very similar looking display screen. I had taken all of the additional code in the sketch that reflects U/L side band selection and several other things that Pete has in his code to make it more modular in design.  When I get around to going to a superhet and then transceiver, these can be added in as separate .ino files in the main sketch directory.  That way it should be possible that no other changes in the additional .ino files should be necessary whatever display you are using.  Here are a couple pictures of the two displays.  Hope to get around to writing some code for a couple other display types this weekend.

128 x 128 display  Rotary encoder on board

160 x 128 display  External rotary encoder



I spent a little over an hour this evening modifying one of the earlier sketches to support a small 0.96" OLED display.  Most of that time was trying to fit everything on the screen, and make it look nice.  It is much easier to work with a screen that has more real estate to work with. This is listed as a two color display, but all pixels are either white or black, the color comes from  two different colored parts of the screen.  In an earlier project, I used the smaller color area to put current settings.  

One thing to be very careful about when using these small OLED displays is that looking at some of the pinouts for ones for sale on ebay, is that some have the VCC and GND pins reversed.  
SO BE VERY CAREFUL and check before just plugging it in the socket.  I still have one of the monochrome Nokia displays around, but with the problem I had trying to fit everything on the screen, I don't know if I will bother porting the code for that configuration.

Now that I know the boards work for multiple display types, I have decided that I will offer them for sale.  Because of Pete's urging, I ordered 50 of them to start with.  For now I only plan on shipping to US locations, but am working on getting the board layout as a shared project at the Chinese board house I used. This should make it easier for DX locations to order them directly.  I had checked at oshpark.com, but the board size made them rather expensive.  The board is single sided, so fairly easy to make with the "toner transfer method" if you want to make your own.  I will have the "toner transfer" image along with other documentation at 

https://www.dropbox.com/sh/2omkppe36797l15/AAD8BIuDPMa_-y6JxPI3XTHJa?dl=0

This dropbox will also have the Arduino sketches to use as a guide in using the board with different types of display.  They are very rough right now, I just did enough work on them to get the display and rotary encoder to work correctly.  I will be doing a lot of work as I progress with the Simpleceiver project and see what Pete has in store for us.

I am offering them at $5 each or $7.50 for two including shipping. If you are interested email me at duwayne@kv4qb.us and I will give put you on the list.  

9/17/17
I have just uploaded the files for this board to the supplier I used to their shared projects area.  You can download the gerber files from there or order directly.  I have placed several orders with this supplier, and have been very happy with the results.  Their pricing is very reasonable, and they offer several different shipping options that can be very reasonable. This will be the most economical way for DX builders to purchase boards. The project is at
https://www.pcbway.com/project/shareproject/W42368ASJ5_W42368ASJ4_si5351_vfo_bfo.html

And yes I do get a commission from boards sold. So if two people buy  sets of  5 boards I save enough on my next order that I can stop at McDonalds and get a cup of coffee when it is on sale.


9/21/17
Finished up the modifications to Pete's Simpleceiver sketch for use with my PCB.  I combined the direct conversion and super-het versions into one. There is a single flag variable dcr_mode that you can change to go from one to the other. I have it just before the start of the setup area in the sketch to make it easy to find.  I have it tested as much as I can without having the complete hardware.  Pete plans on building up one of the boards I sent him, and giving the software a test run.  It is located in the folder Simpleceiver_Plus_DCR_SSB_160x128  at the dropbox link


https://www.dropbox.com/sh/2omkppe36797l15/AAD8BIuDPMa_-y6JxPI3XTHJa?dl=0


19 comments:

  1. Very nice DuWayne, I would be interested in one when it's offical.

    David
    KG7WFM

    ReplyDelete
  2. very nice ,also i want 2 pcb but pls tell me the price for shipping to Croatia,thanks in advance.

    ReplyDelete
  3. I decided to only ship to US locations, but in the latest update I have a link to the supplier I used. Boards can be ordered directly from them, and will be the cheapest way for non US builders to get boards

    ReplyDelete
  4. Replies
    1. Hi Mike,

      did you already order the PCB to Europe from PCBWAY.COM ?
      72/3`s de sTef DM5TU / VY1QRP

      Delete
  5. Hi DuWayne, my name is sTef DM5TU / VY1QRP.

    I was trying to compile the arduino sketch. The following errors are reported by my Arduino IDE 1.6.11 . Do you see any chance to give me a hint where to look at or what to do to get is solved. It is somewhere in the rotary section.... Tnx es 72/3 de sTef DM5TU

    "----
    C:\Users\DM5TU\AppData\Local\Temp\build8498a2cd1db95c79b63900dee4cf847f.tmp\libraries\Rotary-master\Rotary.cpp.o (symbol from plugin): In function `Rotary::Rotary(char, char)':

    (.text+0x0): multiple definition of `Rotary::Rotary(char, char)'

    C:\Users\DM5TU\AppData\Local\Temp\build8498a2cd1db95c79b63900dee4cf847f.tmp\sketch\Rotary.cpp.o (symbol from plugin):(.text+0x0): first defined here

    C:\Users\DM5TU\AppData\Local\Temp\build8498a2cd1db95c79b63900dee4cf847f.tmp\libraries\Rotary-master\Rotary.cpp.o (symbol from plugin): In function `Rotary::Rotary(char, char)':

    (.text+0x0): multiple definition of `Rotary::Rotary(char, char)'

    C:\Users\DM5TU\AppData\Local\Temp\build8498a2cd1db95c79b63900dee4cf847f.tmp\sketch\Rotary.cpp.o (symbol from plugin):(.text+0x0): first defined here

    C:\Users\DM5TU\AppData\Local\Temp\build8498a2cd1db95c79b63900dee4cf847f.tmp\libraries\Rotary-master\Rotary.cpp.o (symbol from plugin): In function `Rotary::Rotary(char, char)':

    (.text+0x0): multiple definition of `Rotary::process()'

    C:\Users\DM5TU\AppData\Local\Temp\build8498a2cd1db95c79b63900dee4cf847f.tmp\sketch\Rotary.cpp.o (symbol from plugin):(.text+0x0): first defined here

    collect2.exe: error: ld returned 1 exit status

    Bibliothek Rotary-master im Ordner: C:\Program Files (x86)\Arduino\libraries\Rotary-master (legacy) wird verwendet
    Bibliothek SPI in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI wird verwendet
    Bibliothek Adafruit-GFX-Library-master in Version 1.1.9 im Ordner: C:\Users\DM5TU\Documents\AFU und QRP\Arduino Projects\Projects\libraries\Adafruit-GFX-Library-master wird verwendet
    Bibliothek Adafruit-ST7735-Library-master in Version 1.0.8 im Ordner: C:\Users\DM5TU\Documents\AFU und QRP\Arduino Projects\Projects\libraries\Adafruit-ST7735-Library-master wird verwendet
    Bibliothek toneAC im Ordner: C:\Users\DM5TU\Documents\AFU und QRP\Arduino Projects\Projects\libraries\toneAC (legacy) wird verwendet
    Bibliothek Wire in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire wird verwendet
    exit status 1
    Fehler beim Kompilieren für das Board Arduino Nano.

    ReplyDelete
  6. Looks like you probably have a different version of the Rotary library. I have a copy of the correct one in a dropbox folder at https://www.dropbox.com/sh/kw7c14euqqi28pn/AABc384tePRDZBoqo6s4YDCRa?dl=0 I will update the sketches with links to the correct library locations.

    ReplyDelete
  7. Tnx fer your Link DuWayne. I am sorry to report the following error while using the advised rotary.zip file. All files (Rotary.ccp rotary.h Si5351.ccp and SI5351.h - these ones used from Pete`s blog) are in the same folder with the sketch. I tried the Simpleceiver VFO sketch as well as the SNA JR Sketch with my Arduino IDE 1.11.6. Here is the error report. Looks still the same. The Simpleceiver sketch from Pete (N6QW) is running well with his rotary and SI5351 files. Did someone else report problems?


    72/3`s sTef DM5TU

    ReplyDelete
  8. "------
    Linking everything together...
    "C:\Program Files (x86)\Arduino\hardware\tools\avr/bin/avr-gcc" -w -Os -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp/sna-jr128X160-v2.ino.ino.elf" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\sketch\rotary.cpp.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\sketch\si5351.cpp.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\sketch\sna-jr128X160-v2.ino.ino.cpp.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\SPI\SPI.cpp.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Rotary\rotary.cpp.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Adafruit-GFX-Library-master\glcdfont.c.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Adafruit-GFX-Library-master\Adafruit_GFX.cpp.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Adafruit-ST7735-Library-master\Adafruit_ST7735.cpp.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Wire\Wire.cpp.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Wire\utility\twi.c.o" "C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp/core\core.a" "-LC:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp" -lm
    C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Rotary\rotary.cpp.o (symbol from plugin): In function `Rotary::Rotary(char, char)':

    (.text+0x0): multiple definition of `Rotary::Rotary(char, char)'

    C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\sketch\rotary.cpp.o (symbol from plugin):(.text+0x0): first defined here

    C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Rotary\rotary.cpp.o (symbol from plugin): In function `Rotary::Rotary(char, char)':

    (.text+0x0): multiple definition of `Rotary::Rotary(char, char)'

    C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\sketch\rotary.cpp.o (symbol from plugin):(.text+0x0): first defined here

    C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\libraries\Rotary\rotary.cpp.o (symbol from plugin): In function `Rotary::Rotary(char, char)':

    (.text+0x0): multiple definition of `Rotary::process()'

    C:\Users\DM5TU\AppData\Local\Temp\build1c1e57b0e1e27625cc05e7aac20428dd.tmp\sketch\rotary.cpp.o (symbol from plugin):(.text+0x0): first defined here

    collect2.exe: error: ld returned 1 exit status

    Bibliothek SPI in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\SPI wird verwendet
    Bibliothek Rotary im Ordner: C:\Program Files (x86)\Arduino\libraries\Rotary (legacy) wird verwendet
    Bibliothek Adafruit-GFX-Library-master in Version 1.1.9 im Ordner: C:\Users\DM5TU\Documents\AFU und QRP\Arduino Projects\Projects\libraries\Adafruit-GFX-Library-master wird verwendet
    Bibliothek Adafruit-ST7735-Library-master in Version 1.0.8 im Ordner: C:\Users\DM5TU\Documents\AFU und QRP\Arduino Projects\Projects\libraries\Adafruit-ST7735-Library-master wird verwendet
    Bibliothek Wire in Version 1.0 im Ordner: C:\Program Files (x86)\Arduino\hardware\arduino\avr\libraries\Wire wird verwendet
    exit status 1
    Fehler beim Kompilieren für das Board Arduino/Genuino Uno.

    ----"

    ReplyDelete
    Replies
    1. One of the error messages seems to indicate that you have the rotary files in two places, and has found multiple files with the same name. If you have the rotary files in your sketch folder, try changing the include from include to include "Rotary.h>" That will tell the compiler to look in the sketch folder for the files instead of in the default library folder.

      Delete
    2. quick correction the modified include should be #include "Rotary.h"

      Delete
  9. by the way... I totally accept your "BEER-WARE LICENSE" .... :-)

    ReplyDelete
  10. This comment has been removed by the author.

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. You are so right!! I found it out too, but why. is it because the rotary files are in the same folder as the sketch itself?

    ReplyDelete
  13. This was a real learning. Thanks DuWayne. It even helped me with some other Arduino issues. I now have to change my wiring from Pete`s to your sketch. Great stuff. Keep you updated. Its already late over here across the pond. Location is 1 hr south of Erfurt. Cheers sTef DM5TU

    ReplyDelete
  14. Do you inform Pete about the changes in the sketch concerning the #include rotary section () into ("/") ? He is also promoting to put the rotary files in the same folder as the sketch. Maybe some other hams run into the same topic. I dont know.

    ReplyDelete
  15. Last changes to be made.. so that the display is running, too:
    #define __CS 5 (should be 10)
    #define __DC 7 (should be 9)
    #define __RST 6 (should be 8)

    These were inconsistent with the PIN definitions in the header section on the sketch... I hope I am doing right with this. Now the display is running.

    I am waiting for my pcb from your gerber files being homemade by DH4YM... TNX es 72/3`s de sTef DM5TU / VY1QRP

    ReplyDelete
  16. Some of the errors look like you already had a different version of the rotary files in your default library folder. using the #include tells the compiler to first look in that folder to compile them. After that is done the comipiler compiles all the files in your sketch folder. That caused the errors with multiple definitions. By telling the comipiler to use the "filename" path it ignores the default library folder and just looks in the sketch folder. I think that if you do not have matching filename files in the library folder it will just use what it finds in the sketch folder. Problems with duplicate named libraries has been the biggest problem I have ran into when helping others with my sketches. Have a good evening in Kaulsdorf, I spent about 3 years in Karlsruhe in the 1970's my call there was DA1SC

    ReplyDelete