"Main" Code (i.e. Before setup)

Is there anything wrong with the below code placed BEFORE setup??

#include <EEPROM.h>
//#include <LiquidCrystal.h>
#include <SPI.h>
#include <LiquidCrystal_I2C.h>
#include <Wire.h>

#define TIMECTL_MAXTICKS 4294967296 // 2^32
#define DDS_CLOCK 125000000 //DDS reference clock freq
#define Fstep10 10 // 10 Hz step
#define Fstep100 100
#define Fstep1K 1000
#define Fstep10K 10000 //10,000 Hz step
//100K step bigger then 16 bits

//encoder
const int enclk = A0; //define encoder pin A
const int endata = A1; //define encoder pin B

volatile int c = HIGH; // init state of pin A
volatile int cLast = HIGH; // init last val the same, low
volatile int d = HIGH; // make data val low

//frequency tuning
volatile int stepsize = 4; // tuning rate pointer
word stepK ; // temp storage of freq tuning step

volatile int BANDpointer = 2; // init band pointer to 80M
volatile int state; // switch state register

//define switch input pins
const int band_sw1 = A2; // change freq tuning step
const int rate_sw2 = A3; // change bands
const int txen_sw3 = 7; // enable RF output when low. Original = A4. Trying pin D4 (pin 7).
const int F_ud = 10; // DDS frequency load pin

boolean txen_state = LOW;

const int transmit_on = 8;

long int tword; //the tuning word for the module
long int freq = 0; //a value for frequency
volatile long int max_low_limit = 0 ; // lowest tuning limit
volatile long int max_high_limit = 30000000; // highet tuning limit
volatile long int low_band_limit; //low limit, band tuning
volatile long int high_band_limit; //high limit, band tuning

//LiquidCrystal lcd(7, 6, 5, 4, 3, 2); //set up lCD pins. This is only for palin vanilla LCD !!!
LiquidCrystal_I2C lcd(0X27,16,2);

Your topic was Moved to it's current location / section as it is more suitable.

Could you also take a few moments to Learn How To Use The Forum.
Other general help and troubleshooting advice can be found here.
It will help you get the best out of the forum in the future.

You have a lot of int that could be byte, costing you some memory, both in flash and in SRAM.

Can the tuning limits go negative? If not, then unsigned long could be used.

This
#define TIMECTL_MAXTICKS 4294967296 // 2^32
is bigger than will fit in unsigned long, which can hold 2^32 - 1

const int enclk = A0;         //define encoder pin A
const int endata = A1;        //define encoder pin B

Unless you're expecting large numbers of negative pin numbers, or even large numbers of positive pin numbers, use "const byte" for pin numbers.

And please, as always, remember to use code tags when posting code.

Discovered Nano pin A6 cannot be used as a digital.

Solved problem by using an actual digital pin.

ardocman:
Discovered Nano pin A6 cannot be used as a digital.

First reference to A6 on this page.

ardocman:
Discovered Nano pin A6 cannot be used as a digital.

Solved problem by using an actual digital pin.

You would have gotten better responses if you had stated that you were actually having some problem with your code, and giving a description of the problem as well as posting the entire sketch. A general "is there anything wrong with this code" just leaves people guessing at what you want.

Is there anything wrong with the below code placed BEFORE setup??

Are you trying to ensure that something runs before setup() ?

If so, then you may be interested in the real main() function, how it runs setup() then repeatedly calls loop()

/*
  main.cpp - Main loop for Arduino sketches
  Copyright (c) 2005-2013 Arduino Team.  All right reserved.

  This library is free software; you can redistribute it and/or
  modify it under the terms of the GNU Lesser General Public
  License as published by the Free Software Foundation; either
  version 2.1 of the License, or (at your option) any later version.

  This library is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  Lesser General Public License for more details.

  You should have received a copy of the GNU Lesser General Public
  License along with this library; if not, write to the Free Software
  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
*/

#include <Arduino.h>

// Declared weak in Arduino.h to allow user redefinitions.
int atexit(void (* /*func*/ )()) { return 0; }

// Weak empty variant initialization function.
// May be redefined by variant files.
void initVariant() __attribute__((weak));
void initVariant() { }

void setupUSB() __attribute__((weak));
void setupUSB() { }

int main(void)
{
 init();

 initVariant();

#if defined(USBCON)
 USBDevice.attach();
#endif
 
 setup();
    
 for (;;) {
 loop();
 if (serialEventRun) serialEventRun();
 }
        
 return 0;
}

If you really want to you can write your own main() function in the IDE to replace the built in one above but this is rarely necessary and puts the responsibility for setting up the hardware on you.