PU2CLR Si4735 Arduino Library  2.0.0
Arduino Library for Si47XX Devices - By Ricardo Lima Caratti
Si4735-D60 Single Side Band (SSB) support

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...
 
si4735_eeprom_patch_header SI4735::downloadPatchFromEeprom (int eeprom_i2c_address)
 Transfers the content of a patch stored in an eeprom to the SI4735 device. More...
 

Detailed Description

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.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; pages 3 and 5

Function Documentation

◆ setSSBBfo()

void SI4735::setSSBBfo ( int  offset)

Sets the SSB Beat Frequency Offset (BFO).

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; pages 5 and 23
Parameters
offset16-bit signed value (unit in Hz). The valid range is -16383 to +16383 Hz.

References SI4735::waitToSend().

◆ setSSBConfig()

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.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
Parameters
AUDIOBWSSB Audio bandwidth; 0 = 1.2KHz (default); 1=2.2KHz; 2=3KHz; 3=4KHz; 4=500Hz; 5=1KHz.
SBCUTFLTSSB 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_DIVIDERset 0 for SSB mode; set 3 for SYNC mode.
AVCENSSB Automatic Volume Control (AVC) enable; 0=disable; 1=enable (default).
SMUTESELSSB Soft-mute Based on RSSI or SNR.
DSP_AFCDISDSP AFC Disable or enable; 0=SYNC MODE, AFC enable; 1=SSB MODE, AFC disable.

References SI4735::sendSSBModeProperty().

◆ setSSBDspAfc()

void SI4735::setSSBDspAfc ( uint8_t  DSP_AFCDIS)

Sets DSP AFC disable or enable.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
Parameters
DSP_AFCDIS0 = SYNC mode, AFC enable; 1 = SSB mode, AFC disable

References SI4735::sendSSBModeProperty().

◆ setSSBSoftMute()

void SI4735::setSSBSoftMute ( uint8_t  SMUTESEL)

Sets SSB Soft-mute Based on RSSI or SNR Selection:

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
Parameters
SMUTESEL0 = Soft-mute based on RSSI (default); 1 = Soft-mute based on SNR.

References SI4735::sendSSBModeProperty().

◆ setSSBAutomaticVolumeControl()

void SI4735::setSSBAutomaticVolumeControl ( uint8_t  AVCEN)

Sets SSB Automatic Volume Control (AVC) for SSB mode.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
Parameters
AVCEN0 = Disable AVC; 1 = Enable AVC (default).

References SI4735::sendSSBModeProperty().

◆ setSSBAvcDivider()

void SI4735::setSSBAvcDivider ( uint8_t  AVC_DIVIDER)

Sets AVC Divider.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
Parameters
AVC_DIVIDERSSB mode, set divider = 0; SYNC mode, set divider = 3; Other values = not allowed.

References SI4735::sendSSBModeProperty().

◆ setSBBSidebandCutoffFilter()

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.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
Parameters
SBCUTFLT0 or 1; see above

References SI4735::sendSSBModeProperty().

◆ setSSBAudioBandwidth()

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.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; page 24
Parameters
AUDIOBWthe valid values are 0, 1, 2, 3, 4 or 5; see description above

References SI4735::sendSSBModeProperty().

◆ setSSB() [1/2]

void SI4735::setSSB ( uint8_t  usblsb)

Set the radio to AM function.

Todo:
Adjust the power up parameters

Set the radio to SSB (LW/MW/SW) function.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; pages 13 and 14
setAM()
setFrequencyStep()
void SI4735::setFrequency(uint16_t freq)
Parameters
usblsbupper or lower side band; 1 = LSB; 2 = USB

References SI4735::radioPowerUp().

◆ setSSB() [2/2]

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.

See also
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE; pages 13 and 14
setAM()
setFrequencyStep()
void SI4735::setFrequency(uint16_t freq)
Parameters
fromFreqminimum frequency for the band
toFreqmaximum frequency for the band
initialFreqinitial frequency
stepstep used to go to the next channel
usblsbSSB Upper Side Band (USB) and Lower Side Band (LSB) Selection; value 2 (banary 10) = USB; value 1 (banary 01) = LSB.

◆ sendSSBModeProperty()

void SI4735::sendSSBModeProperty ( )
protected

◆ queryLibraryId()

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 (REV 1.0) page 219].

See also
Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 64 and 215-220.
struct si47x_firmware_query_library
Returns
a struct si47x_firmware_query_library (see it in SI4735.h)

References SI4735::powerDown(), and SI4735::waitToSend().

◆ patchPowerUp()

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).

See also
setMaxDelaySetFrequency()
MAX_DELAY_AFTER_POWERUP
Si47XX PROGRAMMING GUIDE; AN332 (REV 1.0); pages 64 and 215-220 and
AN332 REV 0.8 UNIVERSAL PROGRAMMING GUIDE AMENDMENT FOR SI4735-D60 SSB AND NBFM PATCHES; page 7.

References SI4735::waitToSend().

◆ ssbSetup()

void SI4735::ssbSetup ( )

Starts the Si473X device on SSB (same AM Mode).

Same SI4735::setup optimized to improve loading patch performance

References SI4735::reset().

◆ ssbPowerUp()

void SI4735::ssbPowerUp ( )

This function can be useful for debug and test.

References SI4735::waitToSend().

◆ downloadPatch()

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:

const PROGMEM uint8_t ssb_patch_content_full[] =
{ // SSB patch for whole SSBRX full download
0x15, 0x00, 0x0F, 0xE0, 0xF2, 0x73, 0x76, 0x2F,
0x16, 0x6F, 0x26, 0x1E, 0x00, 0x4B, 0x2C, 0x58,
0x16, 0xA3, 0x74, 0x0F, 0xE0, 0x4C, 0x36, 0xE4,
.
.
.
0x16, 0x3B, 0x1D, 0x4A, 0xEC, 0x36, 0x28, 0xB7,
0x16, 0x00, 0x3A, 0x47, 0x37, 0x00, 0x00, 0x00,
0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0x29};
const int size_content_full = sizeof ssb_patch_content_full;
See also
Si47XX PROGRAMMING GUIDE; ;AN332 (REV 1.0) pages 64 and 215-220.
Parameters
ssb_patch_contentpoint to array of bytes content patch.
ssb_patch_content_sizearray size (number of bytes). The maximum size allowed for a patch is 15856 bytes
Returns
false if an error is found.

◆ downloadPatchFromEeprom()

si4735_eeprom_patch_header SI4735::downloadPatchFromEeprom ( int  eeprom_i2c_address)

Transfers the content of a patch stored in an eeprom to the SI4735 device.

To used this method, you will need an eeprom with the patch content stored into it.

This content have to be generated by the sketch SI47XX_09_SAVE_SSB_PATCH_EEPROM on folder SI47XX_09_TOOLS.

See also
SI47XX_09_SAVE_SSB_PATCH_EEPROM
si4735_eeprom_patch_header https://github.com/pu2clr/SI4735/tree/master/examples/SI47XX_09_TOOLS/SI47XX_09_SAVE_SSB_PATCH_EEPROM
Parameters
eeprom_i2c_address
Returns
false if an error is found.