Hello community,
this is Alberto and I am and italian master engineering student. In the past month I have been working on EM-CC430F6137-900 board used as transmitter. Actually the real aim of this project (that is my master thesis project) is working on the receiving board (a home made board with MSP430), but to do so I need make the transmitter working ( EM-CC430F6137-900 board).
My starting point has been RF Studio which I am already a kind of familiar with. From RF Studio I can send Data with On/Off Keying modulation with 868 Mhz career frequency, 250 Kbps data rate, +10dbm transmission power and I can see the radio signal on the receiver.
The problem is that (I actually didn't get why) RF Studio doesn't allow sending packages greater than 61 bytes. For my application I need to send about 150 bytes or even more (the payload size). For this reason and many other I decided to write the code for the transmitter and I started from the code examples "RF_Examples_IAR" provided by TI website. I am using the project called "Fixed_GT_FIFO" that from the description seems to fit my case.
I used the "register export" tool of RF Studio to export the registers settings for (OOK, 868 Mhz, 250 Kbps, +10dbm) that are the following:
0x06, // IOCFG0 GDO0 Output Configuration
0x47, // FIFOTHR RX FIFO and TX FIFO Thresholds
0x05, // PKTCTRL0 Packet Automation Control
0x06, // FSCTRL1 Frequency Synthesizer Control
0x21, // FREQ2 Frequency Control Word, High Byte
0x62, // FREQ1 Frequency Control Word, Middle Byte
0x76, // FREQ0 Frequency Control Word, Low Byte
0xFD, // MDMCFG4 Modem Configuration
0x3B, // MDMCFG3 Modem Configuration
0x33, // MDMCFG2 Modem Configuration
0x62, // MDMCFG1 Modem Configuration
0x15, // DEVIATN Modem Deviation Setting
0x10, // MCSM0 Main Radio Control State Machine Configuration
0x16, // FOCCFG Frequency Offset Compensation Configuration
0x87, // WOREVT1 High Byte Event0 Timeout
0x6B, // WOREVT0 Low Byte Event0 Timeout
0xFB, // WORCTRL Wake On Radio Control
0x11, // FREND0 Front End TX Configuration
0xEA, // FSCAL3 Frequency Synthesizer Calibration
0x2A, // FSCAL2 Frequency Synthesizer Calibration
0x00, // FSCAL1 Frequency Synthesizer Calibration
0x1F, // FSCAL0 Frequency Synthesizer Calibration
0x81, // TEST2 Various Test Settings
0x35, // TEST1 Various Test Settings
0x09, // TEST0 Various Test Settings
0x7F, // LQI Demodulator Estimate for Link Quality
0x80, // RSSI Received Signal Strength Indication
0x94, // VCO_VC_DAC Current Setting from PLL Calibration Module
These are right the registers values that RFStudio provided. I put these settings into the RfRegSettings.c file of Fixed_GT_FIFO project in place of the default values which are:
// Chipcon
// Product = CC430Fx13x
// Chip version = C (PG 0.7)
// Crystal accuracy = 10 ppm
// X-tal frequency = 26 MHz
// RF output power = 0 dBm
// RX filterbandwidth = 101.562500 kHz
// Deviation = 19 kHz
// Datarate = 38.383484 kBaud
// Modulation = (1) GFSK
// Manchester enable = (0) Manchester disabled
// RF Frequency = 867.999939 MHz
// Channel spacing = 199.951172 kHz
// Channel number = 0
// Optimization = -
// Sync mode = (3) 30/32 sync word bits detected
// Format of RX/TX data = (0) Normal mode, use FIFOs for RX and TX
// CRC operation = (1) CRC calculation in TX and CRC check in RX enabled
// Forward Error Correction =
// Length configuration = (0) Fixed packet length, packet length configured by PKTLEN
// Packetlength = 61
// Preamble count = (2) 4 bytes
// Append status = 1
// Address check = (0) No address check
// FIFO autoflush = 0
// Device address = 0
// GDO0 signal selection = ( 6) Asserts when sync word has been sent / received, and de-asserts at the end of the packet
// GDO2 signal selection = (41) RF_RDY
RF_SETTINGS rfSettings = {
0x08, // FSCTRL1 Frequency synthesizer control.
0x00, // FSCTRL0 Frequency synthesizer control.
0x21, // FREQ2 Frequency control word, high byte.
0x62, // FREQ1 Frequency control word, middle byte.
0x76, // FREQ0 Frequency control word, low byte.
0xCA, // MDMCFG4 Modem configuration.
0x83, // MDMCFG3 Modem configuration.
0x93, // MDMCFG2 Modem configuration.
0x22, // MDMCFG1 Modem configuration.
0xF8, // MDMCFG0 Modem configuration.
0x00, // CHANNR Channel number.
0x34, // DEVIATN Modem deviation setting (when FSK modulation is enabled).
0x56, // FREND1 Front end RX configuration.
0x10, // FREND0 Front end TX configuration.
0x18, // MCSM0 Main Radio Control State Machine configuration.
0x16, // FOCCFG Frequency Offset Compensation Configuration.
0x6C, // BSCFG Bit synchronization Configuration.
0x43, // AGCCTRL2 AGC control.
0x40, // AGCCTRL1 AGC control.
0x91, // AGCCTRL0 AGC control.
0xE9, // FSCAL3 Frequency synthesizer calibration.
0x2A, // FSCAL2 Frequency synthesizer calibration.
0x00, // FSCAL1 Frequency synthesizer calibration.
0x1F, // FSCAL0 Frequency synthesizer calibration.
0x59, // FSTEST Frequency synthesizer calibration.
0x81, // TEST2 Various test settings.
0x35, // TEST1 Various test settings.
0x09, // TEST0 Various test settings.
0x47, // FIFOTHR RXFIFO and TXFIFO thresholds.
0x29, // IOCFG2 GDO2 output pin configuration.
0x06, // IOCFG0 GDO0 output pin configuration. Refer to SmartRF® Studio User Manual for detailed pseudo register explanation.
0x04, // PKTCTRL1 Packet automation control.
0x04, // PKTCTRL0 Packet automation control.
0x00, // ADDR Device address.
0x64 // PKTLEN Packet length.
};
Of course it doesn't work!! But I have noticed something that should be definitely wrong:
in the RF1A.h file the RFSETTINGS structure is defined as the following:
typedef struct S_RF_SETTINGS {
unsigned char fsctrl1; // Frequency synthesizer control.
unsigned char fsctrl0; // Frequency synthesizer control.
unsigned char freq2; // Frequency control word, high byte.
unsigned char freq1; // Frequency control word, middle byte.
unsigned char freq0; // Frequency control word, low byte.
unsigned char mdmcfg4; // Modem configuration.
unsigned char mdmcfg3; // Modem configuration.
unsigned char mdmcfg2; // Modem configuration.
unsigned char mdmcfg1; // Modem configuration.
unsigned char mdmcfg0; // Modem configuration.
unsigned char channr; // Channel number.
unsigned char deviatn; // Modem deviation setting (when FSK modulation is enabled).
unsigned char frend1; // Front end RX configuration.
unsigned char frend0; // Front end RX configuration.
unsigned char mcsm0; // Main Radio Control State Machine configuration.
unsigned char foccfg; // Frequency Offset Compensation Configuration.
unsigned char bscfg; // Bit synchronization Configuration.
unsigned char agcctrl2; // AGC control.
unsigned char agcctrl1; // AGC control.
unsigned char agcctrl0; // AGC control.
unsigned char fscal3; // Frequency synthesizer calibration.
unsigned char fscal2; // Frequency synthesizer calibration.
unsigned char fscal1; // Frequency synthesizer calibration.
unsigned char fscal0; // Frequency synthesizer calibration.
unsigned char fstest; // Frequency synthesizer calibration control
unsigned char test2; // Various test settings.
unsigned char test1; // Various test settings.
unsigned char test0; // Various test settings.
unsigned char fifothr; // RXFIFO and TXFIFO thresholds.
unsigned char iocfg2; // GDO2 output pin configuration
unsigned char iocfg0; // GDO0 output pin configuration
unsigned char pktctrl1; // Packet automation control.
unsigned char pktctrl0; // Packet automation control.
unsigned char addr; // Device address.
unsigned char pktlen; // Packet length.
} RF_SETTINGS;
This structure definition looks like the default register settings (in number 35 and sequence of register names) BUT NOT THE ONE PROVIDED BY RF STUDIO (which is the one I need).
So I tried to mix my sequence of my registers with the default one replacing only the ones with the same names obtaining this sequence:
0x06, // FSCTRL1 Frequency synthesizer control.
0x00, // FSCTRL0 Frequency synthesizer control.
0x21, // FREQ2 Frequency control word, high byte.
0x62, // FREQ1 Frequency control word, middle byte.
0x76, // FREQ0 Frequency control word, low byte.
0xFD, // MDMCFG4 Modem configuration.
0x3B, // MDMCFG3 Modem configuration.
0x33, // MDMCFG2 Modem configuration.
0x62, // MDMCFG1 Modem configuration.
0xF8, // MDMCFG0 Modem configuration.
0x00, // CHANNR Channel number.
0x15, // DEVIATN Modem deviation setting (when FSK modulation is enabled).
0x56, // FREND1 Front end RX configuration.
0x11, // FREND0 Front end TX configuration.
0x10, // MCSM0 Main Radio Control State Machine configuration.
0x16, // FOCCFG Frequency Offset Compensation Configuration.
0x6C, // BSCFG Bit synchronization Configuration.
0x05, // AGCCTRL2 AGC control.
0x00, // AGCCTRL1 AGC control.
0x91, // AGCCTRL0 AGC control.
0xEA, // FSCAL3 Frequency synthesizer calibration.
0x2A, // FSCAL2 Frequency synthesizer calibration.
0x00, // FSCAL1 Frequency synthesizer calibration.
0x1F, // FSCAL0 Frequency synthesizer calibration.
0x59, // FSTEST Frequency synthesizer calibration.
0x81, // TEST2 Various test settings.
0x35, // TEST1 Various test settings.
0x09, // TEST0 Various test settings.
0x47, // FIFOTHR RXFIFO and TXFIFO thresholds.
0x29, // IOCFG2 GDO2 output pin configuration.
0x06, // IOCFG0 GDO0 output pin configuration. Refer to SmartRF® Studio User Manual for detailed pseudo register explanation.
0x04, // PKTCTRL1 Packet automation control.
0x05, // PKTCTRL0 Packet automation control.
0x00, // ADDR Device address.
0x64 // PKTLEN Packet length.
It still doesn't work and I also noticed that some of the register names provided by RF Studio DON'T EXIST in the default sequence and so I skip them. These registers are:
0x87, // WOREVT1 High Byte Event0 Timeout
0x6B, // WOREVT0 Low Byte Event0 Timeout
0xFB, // WORCTRL Wake On Radio Control
and:
0x7F, // LQI Demodulator Estimate for Link Quality
0x80, // RSSI Received Signal Strength Indication
0x94, // VCO_VC_DAC Current Setting from PLL Calibration Module
Is this a problem of RF Studio register export tool?? How can I solve the problem? where am I supposed to put these registers settings?
Besides I have also noticed that the structure in RF1A.h is called S_RF_SETTINGS instead of RF_SETTINGS named in the default value.
The Fixed_GT_FIFO code is supposed to work also with other configuration of modulation, transmission power, data rate etc etc simply changing the registers settings or something else is supposed to be done? I am interested only in the transmitting part of the code not in the receiving one but it doesn't bother me anyway :) .
I am sorry I am a kind of familiar with MSP430 but not with Radio Modules. This is the first time I have been working on that.I looked into the forum but I didn't find the solution of my problem in any discussion. I have also read the CC430 Family User's Guide. I really would appreciate any help! I am completely stuck with my thesis and I don't know what to do.
Thank you very much in advance.
Alberto.