diff --git a/Firmware/radio/main.c b/Firmware/radio/main.c index eb4e37a5..da07c4df 100644 --- a/Firmware/radio/main.c +++ b/Firmware/radio/main.c @@ -114,7 +114,17 @@ main(void) feature_opportunistic_resend = param_get(PARAM_OPPRESEND)?true:false; feature_golay = param_get(PARAM_ECC)?true:false; feature_rtscts = param_get(PARAM_RTSCTS)?true:false; - + g_board_frequency= param_get(PARAM_MAIN_FREQUENCY); + switch (g_board_frequency) + { + case FREQ_433: + case FREQ_470: + case FREQ_868: + case FREQ_915: + break; + default: + g_board_frequency = FREQ_433; + } // Do hardware initialisation. hardware_init(); diff --git a/Firmware/radio/parameters.c b/Firmware/radio/parameters.c index 42d51473..762d1ab6 100644 --- a/Firmware/radio/parameters.c +++ b/Firmware/radio/parameters.c @@ -39,7 +39,7 @@ /// with an 8-bit XOR checksum appended to the end of the flash range. /// - +#include "board_info.h" #include "radio.h" #include "tdm.h" #include @@ -65,7 +65,8 @@ __code const struct parameter_info { {"LBT_RSSI", 0}, {"MANCHESTER", 0}, {"RTSCTS", 0}, - {"MAX_WINDOW", 131} + {"MAX_WINDOW", 131}, + {"Main_FREQ", FREQ_433} }; /// In-RAM parameter store. diff --git a/Firmware/radio/parameters.h b/Firmware/radio/parameters.h index cce7ddee..da627e46 100644 --- a/Firmware/radio/parameters.h +++ b/Firmware/radio/parameters.h @@ -62,6 +62,8 @@ enum ParamID { PARAM_MANCHESTER, // enable manchester encoding PARAM_RTSCTS, // enable hardware flow control PARAM_MAX_WINDOW, // The maximum window size allowed + PARAM_MAIN_FREQUENCY, // Main Frquenct FREQ_433 FREQ_470 FREQ_868 FREQ_915 FREQ_NONE + PARAM_MAX // must be last }; diff --git a/README.markdown b/README.markdown index 63cbe38d..9c3971d5 100644 --- a/README.markdown +++ b/README.markdown @@ -1,5 +1,36 @@ # SiK - Firmware for SiLabs Si1000 ISM radios +===================================================== +Change Main Frequency Feature: +I added parameter #16 where you can change the frequency of Telemetry using AT commands only. No need to upgrade Firmware. + +Please make sure to use proper Antenna for the selected frequency. + + +The AT commands of the Telemetry can be found here http://copter.ardupilot.com/wiki/common-using-the-3dr-radio-for-telemetry-with-apm-and-px4/ +The new commands is #16 called "Main_Freq". + +Values that should be set there are: + + + FREQ_433 = 0x43, + FREQ_470 = 0x47, + FREQ_868 = 0x86, + FREQ_915 = 0x91, + + i.e. ATS16=145 sets frequency to 915 MHz. + + +Typical steps to change frequency are: + +++ to enter AT commands mode. + ATS16=67 to change to 433 MHz + AT&W to save settings + ATZ to reboot (Mandatory) + +===================================================== + + + For user documentation please see this site: http://code.google.com/p/ardupilot-mega/wiki/3DRadio