![]() |
PU2CLR Si4735 Arduino Library
1.1.9
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
|
Single Side Band (SSB) implementation.
First of all, it is important to say that the SSB patch content is not part of this library. The paches used here were made available by Mr. Vadim Afonkin on his Dropbox repository. It is important to note that the author of this library does not encourage anyone to use the SSB patches content for commercial purposes. In other words, this library only supports SSB patches, the patches themselves are not part of this library.
More...
Functions | |
void | SI4735::setSSBBfo (int offset) |
Sets the SSB Beat Frequency Offset (BFO). More... | |
void | SI4735::setSSBConfig (uint8_t AUDIOBW, uint8_t SBCUTFLT, uint8_t AVC_DIVIDER, uint8_t AVCEN, uint8_t SMUTESEL, uint8_t DSP_AFCDIS) |
Sets the SSB receiver mode. More... | |
void | SI4735::setSSBDspAfc (uint8_t DSP_AFCDIS) |
Sets DSP AFC disable or enable. More... | |
void | SI4735::setSSBSoftMute (uint8_t SMUTESEL) |
Sets SSB Soft-mute Based on RSSI or SNR Selection: More... | |
void | SI4735::setSSBAutomaticVolumeControl (uint8_t AVCEN) |
Sets SSB Automatic Volume Control (AVC) for SSB mode. More... | |
void | SI4735::setSSBAvcDivider (uint8_t AVC_DIVIDER) |
Sets AVC Divider. More... | |
void | SI4735::setSBBSidebandCutoffFilter (uint8_t SBCUTFLT) |
Sets SBB Sideband Cutoff Filter for band pass and low pass filters. More... | |
void | SI4735::setSSBAudioBandwidth (uint8_t AUDIOBW) |
SSB Audio Bandwidth for SSB mode. More... | |
void | SI4735::setSSB (uint8_t usblsb) |
Set the radio to AM function. More... | |
void | SI4735::setSSB (uint16_t fromFreq, uint16_t toFreq, uint16_t intialFreq, uint16_t step, uint8_t usblsb) |
void | SI4735::sendSSBModeProperty () |
Just send the property SSB_MOD to the device. Internal use (privete method). More... | |
si47x_firmware_query_library | SI4735::queryLibraryId () |
Query the library information of the Si47XX device. More... | |
void | SI4735::patchPowerUp () |
This method can be used to prepare the device to apply SSBRX patch. More... | |
void | SI4735::ssbSetup () |
Starts the Si473X device on SSB (same AM Mode). More... | |
void | SI4735::ssbPowerUp () |
This function can be useful for debug and test. More... | |
bool | SI4735::downloadPatch (const uint8_t *ssb_patch_content, const uint16_t ssb_patch_content_size) |
Transfers the content of a patch stored in a array of bytes to the SI4735 device. More... | |
bool | SI4735::downloadPatch (int eeprom_i2c_address) |
Transfers the content of a patch stored in a eeprom to the SI4735 device. More... | |
Single Side Band (SSB) implementation.
First of all, it is important to say that the SSB patch content is not part of this library. The paches used here were made available by Mr. Vadim Afonkin on his Dropbox repository. It is important to note that the author of this library does not encourage anyone to use the SSB patches content for commercial purposes. In other words, this library only supports SSB patches, the patches themselves are not part of this library.
This implementation was tested only on Si4735-D60 device.
SSB modulation is a refinement of amplitude modulation that one of the side band and the carrier are suppressed.
What does SSB patch means? In this context, a patch is a piece of software used to change the behavior of the SI4735 device. There is little information available about patching the SI4735.
The following information is the understanding of the author of this project and it is not necessarily correct.
A patch is executed internally (run by internal MCU) of the device. Usually, patches are used to fixes bugs or add improvements and new features of the firmware installed in the internal ROM of the device. Patches to the SI4735 are distributed in binary form and have to be transferred to the internal RAM of the device by the host MCU (in this case Arduino boards). Since the RAM is volatile memory, the patch stored into the device gets lost when you turn off the system. Consequently, the content of the patch has to be transferred again to the device each time after turn on the system or reset the device.
I would like to thank Mr Vadim Afonkin for making available the SSBRX patches for SI4735-D60 on his Dropbox repository. On this repository you have two files, amrx_6_0_1_ssbrx_patch_full_0x9D29.csg and amrx_6_0_1_ssbrx_patch_init_0xA902.csg. It is important to know that the patch content of the original files is constant hexadecimal representation used by the language C/C++. Actally, the original files are in ASCII format (not in binary format). If you are not using C/C++ or if you want to load the files directly to the SI4735, you must convert the values to numeric value of the hexadecimal constants. For example: 0x15 = 21 (00010101); 0x16 = 22 (00010110); 0x01 = 1 (00000001); 0xFF = 255 (11111111);
ATTENTION: The author of this project does not guarantee that procedures shown here will work in your development environment. Given this, it is at your own risk to continue with the procedures suggested here. This library works with the I²C communication protocol and it is designed to apply a SSB extension PATCH to CI SI4735-D60. Once again, the author disclaims any liability for any damage this procedure may cause to your SI4735 or other devices that you are using.
void SI4735::setSSBBfo | ( | int | offset | ) |
Sets the SSB Beat Frequency Offset (BFO).
offset | 16-bit signed value (unit in Hz). The valid range is -16383 to +16383 Hz. |
References SI4735::waitToSend().
void SI4735::setSSBConfig | ( | uint8_t | AUDIOBW, |
uint8_t | SBCUTFLT, | ||
uint8_t | AVC_DIVIDER, | ||
uint8_t | AVCEN, | ||
uint8_t | SMUTESEL, | ||
uint8_t | DSP_AFCDIS | ||
) |
Sets the SSB receiver mode.
You can use this method for:
1) Enable or disable AFC track to carrier function for receiving normal AM signals;
2) Set the audio bandwidth;
3) Set the side band cutoff filter;
4) Set soft-mute based on RSSI or SNR;
5) Enable or disbable automatic volume control (AVC) function.
AUDIOBW | SSB Audio bandwidth; 0 = 1.2KHz (default); 1=2.2KHz; 2=3KHz; 3=4KHz; 4=500Hz; 5=1KHz. |
SBCUTFLT | SSB side band cutoff filter for band passand low pass filter if 0, the band pass filter to cutoff both the unwanted side band and high frequency component > 2KHz of the wanted side band (default). |
AVC_DIVIDER | set 0 for SSB mode; set 3 for SYNC mode. |
AVCEN | SSB Automatic Volume Control (AVC) enable; 0=disable; 1=enable (default). |
SMUTESEL | SSB Soft-mute Based on RSSI or SNR. |
DSP_AFCDIS | DSP AFC Disable or enable; 0=SYNC MODE, AFC enable; 1=SSB MODE, AFC disable. |
References SI4735::sendSSBModeProperty().
void SI4735::setSSBDspAfc | ( | uint8_t | DSP_AFCDIS | ) |
Sets DSP AFC disable or enable.
DSP_AFCDIS | 0 = SYNC mode, AFC enable; 1 = SSB mode, AFC disable |
References SI4735::sendSSBModeProperty().
void SI4735::setSSBSoftMute | ( | uint8_t | SMUTESEL | ) |
Sets SSB Soft-mute Based on RSSI or SNR Selection:
SMUTESEL | 0 = Soft-mute based on RSSI (default); 1 = Soft-mute based on SNR. |
References SI4735::sendSSBModeProperty().
void SI4735::setSSBAutomaticVolumeControl | ( | uint8_t | AVCEN | ) |
Sets SSB Automatic Volume Control (AVC) for SSB mode.
AVCEN | 0 = Disable AVC; 1 = Enable AVC (default). |
References SI4735::sendSSBModeProperty().
void SI4735::setSSBAvcDivider | ( | uint8_t | AVC_DIVIDER | ) |
Sets AVC Divider.
AVC_DIVIDER | SSB mode, set divider = 0; SYNC mode, set divider = 3; Other values = not allowed. |
References SI4735::sendSSBModeProperty().
void SI4735::setSBBSidebandCutoffFilter | ( | uint8_t | SBCUTFLT | ) |
Sets SBB Sideband Cutoff Filter for band pass and low pass filters.
0 = Band pass filter to cutoff both the unwanted side band and high frequency components > 2.0 kHz of the wanted side band. (default)
1 = Low pass filter to cutoff the unwanted side band. Other values = not allowed.
SBCUTFLT | 0 or 1; see above |
References SI4735::sendSSBModeProperty().
void SI4735::setSSBAudioBandwidth | ( | uint8_t | AUDIOBW | ) |
SSB Audio Bandwidth for SSB mode.
0 = 1.2 kHz low-pass filter (default).
1 = 2.2 kHz low-pass filter.
2 = 3.0 kHz low-pass filter.
3 = 4.0 kHz low-pass filter.
4 = 500 Hz band-pass filter for receiving CW signal, i.e. [250 Hz, 750 Hz] with center frequency at 500 Hz when USB is selected or [-250 Hz, -750 1Hz] with center frequency at -500Hz when LSB is selected* .
5 = 1 kHz band-pass filter for receiving CW signal, i.e. [500 Hz, 1500 Hz] with center frequency at 1 kHz when USB is selected or [-500 Hz, -1500 1 Hz] with center frequency at -1kHz when LSB is selected.
Other values = reserved.
If audio bandwidth selected is about 2 kHz or below, it is recommended to set SBCUTFLT[3:0] to 0 to enable the band pass filter for better high- cut performance on the wanted side band. Otherwise, set it to 1.
AUDIOBW | the valid values are 0, 1, 2, 3, 4 or 5; see description above |
References SI4735::sendSSBModeProperty().
void SI4735::setSSB | ( | uint8_t | usblsb | ) |
Set the radio to AM function.
Set the radio to SSB (LW/MW/SW) function.
usblsb | upper or lower side band; 1 = LSB; 2 = USB |
References SI4735::radioPowerUp().
void SI4735::setSSB | ( | uint16_t | fromFreq, |
uint16_t | toFreq, | ||
uint16_t | initialFreq, | ||
uint16_t | step, | ||
uint8_t | usblsb | ||
) |
Tunes the SSB (LSB or USB) receiver to a frequency between 520 and 30 MHz in 1 kHz steps.
fromFreq | minimum frequency for the band |
toFreq | maximum frequency for the band |
initialFreq | initial frequency |
step | step used to go to the next channel |
usblsb | SSB Upper Side Band (USB) and Lower Side Band (LSB) Selection; value 2 (banary 10) = USB; value 1 (banary 01) = LSB. |
|
protected |
Just send the property SSB_MOD to the device. Internal use (privete method).
References SI4735::waitToSend().
Referenced by SI4735::setSBBSidebandCutoffFilter(), SI4735::setSSBAudioBandwidth(), SI4735::setSSBAutomaticVolumeControl(), SI4735::setSSBAvcDivider(), SI4735::setSSBConfig(), SI4735::setSSBDspAfc(), and SI4735::setSSBSoftMute().
si47x_firmware_query_library SI4735::queryLibraryId | ( | ) |
Query the library information of the Si47XX device.
SI47XX PATCH RESOURCES
Used to confirm if the patch is compatible with the internal device library revision.
You have to call this function if you are applying a patch on SI47XX (SI4735-D60).
The first command that is sent to the device is the POWER_UP command to confirm that the patch is compatible with the internal device library revision.
The device moves into the powerup mode, returns the reply, and moves into the powerdown mode.
The POWER_UP command is sent to the device again to configure the mode of the device and additionally is used to start the patching process.
When applying the patch, the PATCH bit in ARG1 of the POWER_UP command must be set to 1 to begin the patching process. [AN332 page 219].
References SI4735::powerDown(), and SI4735::waitToSend().
void SI4735::patchPowerUp | ( | ) |
This method can be used to prepare the device to apply SSBRX patch.
Call queryLibraryId before call this method. Powerup the device by issuing the POWER_UP command with FUNC = 1 (AM/SW/LW Receive).
References SI4735::waitToSend().
void SI4735::ssbSetup | ( | ) |
Starts the Si473X device on SSB (same AM Mode).
Same SI4735::setup optimized to improve loading patch performance
References SI4735::reset().
void SI4735::ssbPowerUp | ( | ) |
This function can be useful for debug and test.
References SI4735::waitToSend().
bool SI4735::downloadPatch | ( | const uint8_t * | ssb_patch_content, |
const uint16_t | ssb_patch_content_size | ||
) |
Transfers the content of a patch stored in a array of bytes to the SI4735 device.
You must mount an array as shown below and know the size of that array as well.
It is importante to say that patches to the SI4735 are distributed in binary form and have to be transferred to the internal RAM of the device by the host MCU (in this case Arduino). Since the RAM is volatile memory, the patch stored into the device gets lost when you turn off the system. Consequently, the content of the patch has to be transferred again to the device each time after turn on the system or reset the device.
The disadvantage of this approach is the amount of memory used by the patch content. This may limit the use of other radio functions you want implemented in Arduino.
Example of content:
ssb_patch_content | point to array of bytes content patch. |
ssb_patch_content_size | array size (number of bytes). The maximum size allowed for a patch is 15856 bytes |
bool SI4735::downloadPatch | ( | int | eeprom_i2c_address | ) |
Transfers the content of a patch stored in a eeprom to the SI4735 device.
TO USE THIS METHOD YOU HAVE TO HAVE A EEPROM WRITEN WITH THE PATCH CONTENT
ATTENTION: Under construction...
eeprom_i2c_address |
References SI4735::waitToSend().