Hi all,
I am making a simple toy which has a wireless remote and a motor controller. Both ends have a CC1101. These are my settings at both ends.
#define CC1101_DEFVAL_IOCFG2 0x29 // GDO2 Output Pin Configuration
#define CC1101_DEFVAL_IOCFG1 0x2E // GDO1 Output Pin Configuration
#define CC1101_DEFVAL_IOCFG0 0x06 // GDO0 Output Pin Configuration
#define CC1101_DEFVAL_FIFOTHR 0x07 // RX FIFO and TX FIFO Thresholds
#define CC1101_DEFVAL_SYNC1 0xB5 // Synchronization word, high unsigned char
#define CC1101_DEFVAL_SYNC0 0x47 // Synchronization word, low unsigned char
#define CC1101_DEFVAL_PKTLEN 0xFF // Packet Length
#define CC1101_DEFVAL_PKTCTRL1 0x06 // Packet Automation Control
#define CC1101_DEFVAL_PKTCTRL0 0x45 // Packet Automation Control
#define CC1101_DEFVAL_ADDR 0x01 // Device Address
#define CC1101_DEFVAL_CHANNR 0x00 // Channel Number
#define CC1101_DEFVAL_FSCTRL1 0x08 // Frequency Synthesizer Control
#define CC1101_DEFVAL_FSCTRL0 0x00 // Frequency Synthesizer Control
// Carrier frequency = 868 MHz
#define CC1101_DEFVAL_FREQ2_868 0x21 // Frequency Control Word, High unsigned char
#define CC1101_DEFVAL_FREQ1_868 0x62 // Frequency Control Word, Middle unsigned char
#define CC1101_DEFVAL_FREQ0_868 0x76 // Frequency Control Word, Low unsigned char
// Carrier frequency = 902 MHz
#define CC1101_DEFVAL_FREQ2_915 0x22 // Frequency Control Word, High unsigned char
#define CC1101_DEFVAL_FREQ1_915 0xB1 // Frequency Control Word, Middle unsigned char
#define CC1101_DEFVAL_FREQ0_915 0x3B // Frequency Control Word, Low unsigned char
#define CC1101_DEFVAL_MDMCFG4 0xCA // Modem Configuration
#define CC1101_DEFVAL_MDMCFG3 0x83 // Modem Configuration
#define CC1101_DEFVAL_MDMCFG2 0x1B // Modem Configuration
#define CC1101_DEFVAL_MDMCFG1 0x22 // Modem Configuration
#define CC1101_DEFVAL_MDMCFG0 0xF8 // Modem Configuration
#define CC1101_DEFVAL_DEVIATN 0x35 // Modem Deviation Setting
#define CC1101_DEFVAL_MCSM2 0x07 // Main Radio Control State Machine Configuration
//#define CC1101_DEFVAL_MCSM1 0x30 // Main Radio Control State Machine Configuration
#define CC1101_DEFVAL_MCSM1 0x20 // Main Radio Control State Machine Configuration
#define CC1101_DEFVAL_MCSM0 0x18 // Main Radio Control State Machine Configuration
#define CC1101_DEFVAL_FOCCFG 0x16 // Frequency Offset Compensation Configuration
#define CC1101_DEFVAL_BSCFG 0x6C // Bit Synchronization Configuration
#define CC1101_DEFVAL_AGCCTRL2 0x03 // AGC Control(max dvga gain=0, max lna gain=0, magn target=3)
#define CC1101_DEFVAL_AGCCTRL1 0x49 // AGC Control(select between strategies for LNA gain adjustment,disable cs_rel_thr, enable cs_abs_thr 7 db below)
#define CC1101_DEFVAL_AGCCTRL0 0x91 // AGC Control(freeze AGC after sync word has been found, filter_length=64,
#define CC1101_DEFVAL_WOREVT1 0x87 // High unsigned char Event0 Timeout
#define CC1101_DEFVAL_WOREVT0 0x6B // Low unsigned char Event0 Timeout
#define CC1101_DEFVAL_WORCTRL 0xFB // Wake On Radio Control
#define CC1101_DEFVAL_FREND1 0x56 // Front End RX Configuration
#define CC1101_DEFVAL_FREND0 0x10 // Front End TX Configuration
#define CC1101_DEFVAL_FSCAL3 0xE9 // Frequency Synthesizer Calibration
#define CC1101_DEFVAL_FSCAL2 0x2A // Frequency Synthesizer Calibration
#define CC1101_DEFVAL_FSCAL1 0x00 // Frequency Synthesizer Calibration
#define CC1101_DEFVAL_FSCAL0 0x1F // Frequency Synthesizer Calibration
#define CC1101_DEFVAL_RCCTRL1 0x41 // RC Oscillator Configuration
#define CC1101_DEFVAL_RCCTRL0 0x00 // RC Oscillator Configuration
#define CC1101_DEFVAL_FSTEST 0x59 // Frequency Synthesizer Calibration Control
#define CC1101_DEFVAL_PTEST 0x7F // Production Test
#define CC1101_DEFVAL_AGCTEST 0x3F // AGC Test
#define CC1101_DEFVAL_TEST2 0x81 // Various Test Settings
#define CC1101_DEFVAL_TEST1 0x35 // Various Test Settings
#define CC1101_DEFVAL_TEST0 0x09 // Various Test Settings
I am trying to operate at 902MHz. To turn the motor forward I send 0x01,0x21,0x02,0x0F,0x00,0xDF,0x04 and to turn it backwards I send 0x01,0x21,0x02,0xF1,0xFF,0xDF,0x04.
The forward command experiences a lot of data loss. I have tried Can someone tell me what could be happening here. I have enabled manchester encoding and data whitening but there seems to be no effect.
The system works correctly when the same data is sent via UART. So, I dont think this is an application issue.
Any help will be appreciated
Thanks!
Sid