 
 void dds_update(Frequency frequency)
 {
-//  int32_t data = frequency * 4294967296.0 / 180.0e6;
-  unsigned long data = frequency * 4294967296 / (6 * (30000000 - VfoClockOffset));
+  // as in datasheet page 12 - modified to include calibration offset
+  unsigned long data = (frequency * 4294967296) / (180000000 - VfoClockOffset);
 
   Serial.printf(F("dds_update: frequency=%ld, VfoClockOffset=%d, data=%ld\n"),
                 frequency, VfoClockOffset, data);
-  
+
+  // start programming the DDS-60
   for (int b = 0; b < 4; ++b, data >>= 8)
   {
     dds_tfr_byte(data & 0xFF);
   }
-  
   dds_tfr_byte(0x001);
   dds_pulse_high(DDS_FQ_UD);
 }

  lcd.print(BlankRow);
  lcd.setCursor(0, 1);
  for (int i = 0; i < length; ++i)
    lcd.write(ALLSET_CHAR);
}

//----------------------------------------

  ulong2buff(buf, num_digits, value);

  // create special underlined selection character including selected digit
  lcd.createChar(SelectChar, sel_digits[int(buf[index])]);

  // we set cursor here because we lose cursor position after lcd.createChar()!?
  // would prefer to set cursor position outside this function, but ไม่เป็นไร.
