Difference between revisions of "VFO-003"

From Land Boards Wiki
Jump to navigation Jump to search
Line 357: Line 357:
 
* [https://www.best-microcontroller-projects.com/rotary-encoder.html Best code]
 
* [https://www.best-microcontroller-projects.com/rotary-encoder.html Best code]
 
** Glitch free due to state machine
 
** Glitch free due to state machine
 +
*** Test by going to top or bottom of the rotation and trying to go past end
 
** Fast rotation rate
 
** Fast rotation rate
 +
*** No delay loops for deglitching
  
 
=== Feature Adds ===
 
=== Feature Adds ===

Revision as of 17:08, 15 October 2021

VFO-003 P1861 720px.jpg

Features

Software controlled Variable Frequency Oscillator (VFO)

  • Arduino Pro Mini Microprocessor
    • 8-bit ATMEGA328 CPU
    • 8 MHz
    • 3.3V
    • 30KB of Flash Memory (32KB - 2KB bootloader)
    • 2KB of SRAM
    • EEPROM
    • Program Flash over FTDI connection
  • Detachable Rotary Encoder/OLED card
  • Si5351A Oscillator
  • Menu options - Minimal Viable Product
    • Select between 3 VFOs
    • Adjust frequency
    • Step sizes: 1Hz, 10 Hz, 100 Hz, 1 KHz, 10 KHz, 100 KHz, 1 MHz, 10 MHz steps (software controllable)
    • Adjust frequency accuracy to 0.01 Hz precision
    • Turn VFO Off/On (Off = 3.3V)
    • Save default values which are loaded at power up
  • Power
    • MINI-360 DC/DC Buck regulator
    • 5-24 VDC
    • 30mA at 12VDC
    • High efficiency
    • Jumper to remove Power into card - protects 3.3V devices while adjusting the output voltage
  • Fits in standard extruded enclosure
    • Aluminum Project Box Enclosure DIY 100*76*35mm

Arduino Pro Mini

ArdruinoProMini-EBAY PART-720px.png

Power

  • 5-24 VDC
  • 30mA at 12VDC
  • 55mA at 5V
  • 35mA at 9V
  • 28mA at 14V
  • 33mA at 23V

TCXO

  • TXCO requires very little frequency correction
  • 27 MHz TCXO crystal oscillator
    • Package / Case: 5 mm x 3.2 mm
    • Frequency: 27 MHz
    • Frequency Stability: 2.5 PPM
    • Supply Voltage - Max: 3.3 V
  • 25 MHz - Alternate would require software changes

Connectors

J1 - OLED

  • Located on display/encoder board
  1. SDA
  2. SCL
  3. Vcc
  4. GND

VFO-003 J1.PNG

J2 - Display Encoder/OLED (Display card)

  • Connect via cable to display/encoder board
  1. Encoder A
  2. Encoder B
  3. Encoder Switch
  4. SCL
  5. SDA
  6. Vcc
  7. GND

VFO-003 J2.PNG

J3 - Display Encoder/OLED (Main card)

  • Connect via cable to display/encoder board
  1. Encoder A
  2. Encoder B
  3. Encoder Switch
  4. SCL
  5. SDA
  6. Vcc
  7. GND

VFO-003 J3.PNG

J4 - FTDI

  • Can install 1x6 header on the Arduino Pro Mini and not install this
  1. GND
  2. GND
  3. Vcc
  4. RX
  5. Tx
  6. DTR

VFO-003 J4.PNG

J5 - Arduino A0-A3/C10-D13

  1. A3
  2. A2
  3. A0
  4. D13
  5. D12
  6. D11
  7. D10
  8. Vcc (not connected on Rev 1 PCB)
  9. GND (not connected on Rev 1 PCB)

VFO-003 J5.PNG

J6 - Disconnect for Mini-360 Power Supply

  • The Mini360 Buck Converter comes adjusted for a very high output voltage
  • Remove jumper to adjust the output voltage to 3.3V without powering the rest of the card
  • Install to power the card from the power supply only after adjusting output

VFO-003 J6.PNG

Mini-360-004.jpg

J7 - Output disconnects

  • Cut rear side trace to disconnect
  • Can be used to install external LP filters
  • Limited use due to 74AC14 drivers

VFO-003 J7.PNG

J8 - Arduino P5-P9

  1. P5
  2. P6
  3. P7
  4. P8
  5. P9
  6. Vcc
  7. GND

VFO-003 J8.PNG

J12 - I2C

VFO-003 J12.PNG

P1-P3 - Outputs (BNCs)

Measurements

  • NanoVNA
  • 10 Mhz signal from the VFO-003
  • 1-100 MHz

Tinysa LOGMAG S11 2021-10-12 12-29-43.png

Tinysa LOGMAG S11 2021-10-12 12-09-58.png

1-350 MHz scan

Tinysa LOGMAG S11 2021-10-12 12-27-58.png

Harmonic content

  • 10MHz fundamental = +12.25 dBm
  • 20MHz harmonic = -16.75 dBm
  • 30MHz harmonic = +2.4 dBm
  • 50MHz harmonic = -2.1 dBm

Tinysa LOGMAG S11 2021-10-12 12-19-33.png

Schematic

Software

VFO-003 P1867-720pxV.jpg

Memory Usage

  • Minimal Viable Product Build - GitHub repo
  • Arduino bootloader 2048 of Flash
  • Display code: 10260 of Flash and 1033 of SRAM using u8g2
  • Alternate display code: 6198 of Flash and 446 of SRAM using u8x8
  • Si5351 code: 12076 of Flash and 378 of SRAM

Total Memory usage with u8g2 Library

Sketch uses 25970 bytes (84%) of program storage space. Maximum is 30720 bytes. Global variables use 1503 bytes (73%) of dynamic memory, leaving 545 bytes for local variables. Maximum is 2048 bytes.

Total Memory usage with u8x8 Library

  • ~4K less than the u2g2 library
Sketch uses 22064 bytes (71% of program storage space. Maximum is 30720 bytes. Global variables use 925 bytes (45%) of dynamic memory, leaving 1142 bytes for local variables. Maximum is 2048 bytes.

Minimal u8g2 code

Sketch uses 10260 bytes (33%) of program storage space. Maximum is 30720 bytes. Global variables use 1033 bytes (50%) of dynamic memory, leaving 1015 bytes for local variables. Maximum is 2048 bytes.
  • Code
void setup(void)
{
  u8g2.begin();

}

void loop(void)
{
  printStringToOLED("VFO-003");
}

void printStringToOLED(char * charStr)
{
  u8g2.clearBuffer();
  u8g2_prepare();
  u8g2.drawStr( 0, 0, charStr);
  u8g2.sendBuffer();
}

// u8g2_prepare()
// Setup the screen font, etc
// List of fonts
// https://github.com/olikraus/u8g2/wiki/fntlist8#u8g2-fonts-capital-a-height-38
void u8g2_prepare(void)
{
  u8g2.setFont(u8g2_font_t0_11b_tf); // 8 Pixel tall font
  u8g2.setFontRefHeightExtendedText();
  u8g2.setDrawColor(1);
  u8g2.setFontPosTop();
  u8g2.setFontDirection(0);
}

Minimal u8x8 code

Sketch uses 6198 bytes (20%) of program storage space. Maximum is 30720 bytes. Global variables use 446 bytes (21%) of dynamic memory, leaving 1602 bytes for local variables. Maximum is 2048 bytes.
  • Code
// https://github.com/olikraus/u8g2/wiki/u8x8reference#c-example

#include <Arduino.h>
#include <SPI.h>
#include <U8x8lib.h>

#define U8X8_HAVE_HW_I2C

U8X8_SSD1306_128X32_UNIVISION_HW_I2C u8x8(U8X8_PIN_NONE);

void setup() {
  // put your setup code here, to run once:
  u8x8.begin();
}

void loop() {
  // put your main code here, to run repeatedly:
  u8x8.setFont(u8x8_font_victoriabold8_r);
  u8x8.drawString(0,0,"Hello World!");
  delay(1000);

}

Minimal Si5351 code

Sketch uses 12072 bytes (39%) of program storage space. Maximum is 30720 bytes. Global variables use 378 bytes (18%) of dynamic memory, leaving 1670 bytes for local variables. Maximum is 2048 bytes.
#include <Arduino.h>
#include "si5351.h"

// Constructors
Si5351 si5351;
// End of constructor list

void setup(void)
{
  unsigned long VFO_0_Freq;
  unsigned long VFO_1_Freq;
  unsigned long VFO_2_Freq;
  bool i2c_found;
  VFO_0_Freq = 14000000;
  VFO_0_Freq = 14000000;
  VFO_0_Freq = 14000000;
  // Si8351 initialiation
  si5351.init(SI5351_CRYSTAL_LOAD_6PF, 27000000, 0);
  si5351.set_freq(VFO_0_Freq, SI5351_CLK0);
  si5351.set_freq(VFO_1_Freq, SI5351_CLK1);
  si5351.set_freq(VFO_2_Freq, SI5351_CLK2);
  si5351.update_status();  
  si5351.set_correction(0, SI5351_PLL_INPUT_XO);
  si5351.drive_strength(SI5351_CLK0,SI5351_DRIVE_8MA);
  si5351.drive_strength(SI5351_CLK1,SI5351_DRIVE_8MA);
  si5351.drive_strength(SI5351_CLK2,SI5351_DRIVE_8MA);
}

void loop(void)
{
}

Rotary Encoder

  • Best code
    • Glitch free due to state machine
      • Test by going to top or bottom of the rotation and trying to go past end
    • Fast rotation rate
      • No delay loops for deglitching

Feature Adds

Mechanicals/Enclosure

  • Detachable Front Panel OLED with Rotary Encoder

VFO-003 P1871 720px.jpg

  • Designed to fit into Aluminum Project Box Enclosure DIY 100*76*35mm - ebay search

VFO-003 CAD Dimensioned.PNG

VFO-003 FrontPanel Holes.PNG

VFO-003 RearPanel Holes.PNG

Rev 1 Board Issues List

No major issues

  • J5-9 and J5-10 are missing connections
    • Add wires on reverse side of the PCB if needed
  • Note orientation of I2C termination resistors
    • Installed sideways by accident on first build

Rev1-Rework R10,R11.PNG

  • Note orientation of Mini360
    • Put on backwards on first build
    • Always use a current limited power supply (I did, no damage)
    • Always adjust Mini360 with 3.3V SEL jumper removed
    • Solder in with short leads - space up a bit to allow rework
    • Orientation is with inductor towards edge of card

Rev1-Rework Mini360 Oientation.PNG

Rev 3 Design

  • Adds J12, I2C connector
    • Use with I2C Peripheral like port expanders

Rev3- J12 I2C.PNG

  • Add silkscreen, "VADJ>" pointing to the adjustment pot on Mini360

Rev2-Rework Mini360 VADJ.PNG

  • Add breakaways for Front Panel to make it easier to separate

Rev3- OLED Breakaways.PNG

  • Switch to 0.1" pitch SMA edge launch connectors

Rev3- SMA Smaller.PNG

Assembly Sheet / Parts List

VFO-003 Assembly Sheet - Rev 1