Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
network_protocol_programming_lab:15.2_cc1200_programming [2020/04/29 11:37] – ↷ Page name changed from network_protocol_programming_lab:15_cc1200_programming to network_protocol_programming_lab:15.2_cc1200_programming adminnetwork_protocol_programming_lab:15.2_cc1200_programming [2022/04/18 17:16] (current) – [Controlling CC1200] fangenoorth
Line 47: Line 47:
 #define SFTX     0x3B /**< Lösche den TX FIFO. */ #define SFTX     0x3B /**< Lösche den TX FIFO. */
 #define SWORRST  0x3C /**< Setze die eWOR Zeit. */ #define SWORRST  0x3C /**< Setze die eWOR Zeit. */
-#define SNOP     0x3D  /**< Kein Kommando.  +#define SNOP     0x3D  /**< Kein Kommando. Wird benutzt um den Zustand des CC1200 zu ermitteln */
-                           Wird benutzt um den Zustand des CC1200 zu ermitteln */+
 </code> </code>
  
Line 84: Line 83:
 ===== Integrating SmartRF Studio Export Files ===== ===== Integrating SmartRF Studio Export Files =====
  
-As described in Section [[network_protocol_programming_lab:8_smartrf#Register Export]]), you are using SmartRF Studio to select a predefined CC1200 register setting and modify this setting to your needs. Afterwards the register settings will be exported. Now, you have to apply theses register setting to the CC1200. This is necessary, because the CC1200 will load default values to its registers after witching on the chip or preforming a reset. This registers have to be reprogrammed to obtain the desired behavior. Reprogramming is done by the use of function ''cc1200_reg_write''.+As described in Section [[network_protocol_programming_lab:8_smartrf]]), you are using 4C to select a predefined CC1200 register setting and modify this setting to your needs. Afterwards the register settings will be exported. Now, you have to apply theses register setting to the CC1200. This is necessary, because the CC1200 will load default values to its registers after witching on the chip or preforming a reset. This registers have to be reprogrammed to obtain the desired behavior. Reprogramming is done by the use of function ''cc1200_reg_write''.
  
 In the following, we will look at an example: In the following, we will look at an example:
  
-Open SmartRF Studio and open the device window of the CC1200Switch to expert mode and select the predefined register setting  “Symbolrate 38.4kbps, 2-GFSK, RX BW 100kHz, ETSI Standard (868MHz)”. Select the tab “Continuous RX” in the lower part of the window. Now, open the export file window and select the “SimpleTI setting” template.+Open 4C and switch to //RX Synchronous Serial Mode// of the mode menuThis will load the predefined register setting  “Symbolrate 38.4kbps, 2-GFSK, RX BW 100kHz, ETSI Standard (868MHz)” to the CC1200. Now, open the Export Register to C in file menu and export the register values.
  
-Export the setting into the file ''smartrf_CC1200.h''. This file contains all register setting to operate CC1200 with a Symbolrate of 38.4kkbps at 868MHz ... The file should look like this:+The beginning of the file should look like this:
  
 <code C> <code C>
-/*************************************************************** +/***************************************************************/ 
-  SmartRF Studio(tm) Export +/* C-file generated by CC1200 Control Center                   */ 
- * +/                                                            */ 
-  Radio register settings specifed with C-code +/*  Generated at x/x/2021  12:26.17                             */ 
-  compatible #define statements. +/***************************************************************/ 
- * +  
- *  RF deviceCC1200 +#define  IOCFG3             0x00  
- +#define  IOCFG2             0x01  
- ***************************************************************/+#define  IOCFG1             0x02  
 +#define  IOCFG0             0x03  
 +#define  SYNC3              0x04  
 +#define  SYNC2              0x05  
 +#define  SYNC1              0x06  
 +#define  SYNC0              0x07  
 +#define  SYNC_CFG1          0x08  
 +#define  SYNC_CFG0          0x09  
 +#define  DEVIATION_M        0x0A  
 +#define  MODCFG_DEV_E       0x0B  
 +#define  DCFILT_CFG         0x0C  
 +#define  PREAMBLE_CFG1      0X0D  
 +#define  PREAMBLE_CFG0      0x0E  
 +#define  IQIC               0x0F  
 +#define  CHAN_BW            0x10  
 +#define  MDMCFG1            0x11  
 +#define  MDMCFG0            0x12  
 +#define  SYMBOL_RATE2       0x13  
 +#define  SYMBOL_RATE1       0x14  
 +#define  SYMBOL_RATE0       0x15  
 +#define  AGC_REF            0x16  
 +#define  AGC_CS_THR         0x17  
 +#define  AGC_GAIN_ADJUST    0x18  
 +#define  AGC_CFG3           0x19  
 +#define  AGC_CFG2           0x1A  
 +#define  AGC_CFG1           0x1B  
 +#define  AGC_CFG0           0x1C  
 +#define  FIFO_CFG           0X1D  
 +#define  DEV_ADDR           0x1E  
 +#define  SETTLING_CFG       0x1F  
 +#define  FS_CFG             0x20  
 +#define  WOR_CFG1           0x21  
 +#define  WOR_CFG0           0x22  
 +#define  WOR_EVENT0_MSB     0x23  
 +#define  WOR_EVENT0_LSB     0x24  
 +#define  RXDCM_TIME         0x25  
 +#define  PKT_CFG2           0x26 
  
-#ifndef SMARTRF_CC1200_H 
-#define SMARTRF_CC1200_H 
- 
-#define SMARTRF_RADIO_CC1200 
-#define SMARTRF_SETTING_IOCFG2           0x08 
-#define SMARTRF_SETTING_IOCFG0           0x09 
-#define SMARTRF_SETTING_SYNC_CFG1        0xBF 
-#define SMARTRF_SETTING_MODCFG_DEV_E     0x0B 
-#define SMARTRF_SETTING_PREAMBLE_CFG1    0x01 
-#define SMARTRF_SETTING_PREAMBLE_CFG0    0x8A 
-#define SMARTRF_SETTING_IQIC             0xC8 
-#define SMARTRF_SETTING_CHAN_BW          0x10 
-#define SMARTRF_SETTING_MDMCFG1          0x02 
-#define SMARTRF_SETTING_MDMCFG0          0x05 
-#define SMARTRF_SETTING_SYMBOL_RATE2     0x8F 
-#define SMARTRF_SETTING_SYMBOL_RATE1     0x75 
-#define SMARTRF_SETTING_SYMBOL_RATE0     0x10 
-#define SMARTRF_SETTING_AGC_REF          0x27 
-#define SMARTRF_SETTING_AGC_CS_THR       0xEE 
-#define SMARTRF_SETTING_AGC_CFG3         0x11 
-#define SMARTRF_SETTING_AGC_CFG1         0x11 
-#define SMARTRF_SETTING_AGC_CFG0         0x94 
-#define SMARTRF_SETTING_FIFO_CFG         0x00 
-#define SMARTRF_SETTING_FS_CFG           0x12 
-#define SMARTRF_SETTING_PKT_CFG2         0x01 
-#define SMARTRF_SETTING_PKT_CFG1         0x00 
-#define SMARTRF_SETTING_PKT_CFG0         0x20 
-#define SMARTRF_SETTING_PKT_LEN          0xFF 
-#define SMARTRF_SETTING_IF_MIX_CFG       0x1C 
-#define SMARTRF_SETTING_FREQOFF_CFG      0x22 
-#define SMARTRF_SETTING_TOC_CFG          0x03 
-#define SMARTRF_SETTING_MDMCFG2          0x02 
-#define SMARTRF_SETTING_FREQ2            0x56 
-#define SMARTRF_SETTING_FREQ1            0xCC 
-#define SMARTRF_SETTING_FREQ0            0xCC 
-#define SMARTRF_SETTING_IF_ADC1          0xEE 
-#define SMARTRF_SETTING_IF_ADC0          0x10 
-#define SMARTRF_SETTING_FS_DIG1          0x07 
-#define SMARTRF_SETTING_FS_DIG0          0xAF 
-#define SMARTRF_SETTING_FS_CAL1          0x40 
-#define SMARTRF_SETTING_FS_CAL0          0x0E 
-#define SMARTRF_SETTING_FS_DIVTWO        0x03 
-#define SMARTRF_SETTING_FS_DSM0          0x33 
-#define SMARTRF_SETTING_FS_DVC0          0x17 
-#define SMARTRF_SETTING_FS_PFD           0x00 
-#define SMARTRF_SETTING_FS_PRE           0x6E 
-#define SMARTRF_SETTING_FS_REG_DIV_CML   0x1C 
-#define SMARTRF_SETTING_FS_SPARE         0xAC 
-#define SMARTRF_SETTING_FS_VCO0          0xB5 
-#define SMARTRF_SETTING_IFAMP            0x09 
-#define SMARTRF_SETTING_XOSC5            0x0E 
-#define SMARTRF_SETTING_XOSC1            0x03 
-#define SMARTRF_SETTING_SERIAL_STATUS    0x08 
- 
-#endif 
 </code> </code>
  
  
-Now, modified the “SimpleTI setting”, that the register address will be exported. Save the exported file to ''smartrf_adr_CC1200.h''. ''smartrf_adr_CC1200.h'' should look like this+Transfer this to the BeagleBone Black and include it into your C source code file. Following start programming the CC1200 registers:
- +
-<code C> +
-/*************************************************************** +
-  SmartRF Studio(tm) Export +
- * +
-  Radio register settings specifed with C-code +
-  compatible #define statements. +
- * +
-  RF device: CC1200 +
- * +
- ***************************************************************/ +
- +
-#ifndef SMARTRF_CC1200_ADR_H +
-#define SMARTRF_CC1200_ADR_H +
- +
-#define IOCFG2_ADR           0x0001 +
-#define IOCFG0_ADR           0x0003 +
-#define SYNC_CFG1_ADR        0x0008 +
-#define MODCFG_DEV_E_ADR     0x000B +
-#define PREAMBLE_CFG1_ADR    0x000D +
-#define PREAMBLE_CFG0_ADR    0x000E +
-#define IQIC_ADR             0x000F +
-#define CHAN_BW_ADR          0x0010 +
-#define MDMCFG1_ADR          0x0011 +
-#define MDMCFG0_ADR          0x0012 +
-#define SYMBOL_RATE2_ADR     0x0013 +
-#define SYMBOL_RATE1_ADR     0x0014 +
-#define SYMBOL_RATE0_ADR     0x0015 +
-#define AGC_REF_ADR          0x0016 +
-#define AGC_CS_THR_ADR       0x0017 +
-#define AGC_CFG3_ADR         0x0019 +
-#define AGC_CFG1_ADR         0x001B +
-#define AGC_CFG0_ADR         0x001C +
-#define FIFO_CFG_ADR         0x001D +
-#define FS_CFG_ADR           0x0020 +
-#define PKT_CFG2_ADR         0x0026 +
-#define PKT_CFG1_ADR         0x0027 +
-#define PKT_CFG0_ADR         0x0028 +
-#define PKT_LEN_ADR          0x002E +
-#define IF_MIX_CFG_ADR       0x2F00 +
-#define FREQOFF_CFG_ADR      0x2F01 +
-#define TOC_CFG_ADR          0x2F02 +
-#define MDMCFG2_ADR          0x2F05 +
-#define FREQ2_ADR            0x2F0C +
-#define FREQ1_ADR            0x2F0D +
-#define FREQ0_ADR            0x2F0E +
-#define IF_ADC1_ADR          0x2F10 +
-#define IF_ADC0_ADR          0x2F11 +
-#define FS_DIG1_ADR          0x2F12 +
-#define FS_DIG0_ADR          0x2F13 +
-#define FS_CAL1_ADR          0x2F16 +
-#define FS_CAL0_ADR          0x2F17 +
-#define FS_DIVTWO_ADR        0x2F19 +
-#define FS_DSM0_ADR          0x2F1B +
-#define FS_DVC0_ADR          0x2F1D +
-#define FS_PFD_ADR           0x2F1F +
-#define FS_PRE_ADR           0x2F20 +
-#define FS_REG_DIV_CML_ADR   0x2F21 +
-#define FS_SPARE_ADR         0x2F22 +
-#define FS_VCO0_ADR          0x2F27 +
-#define IFAMP_ADR            0x2F2F +
-#define XOSC5_ADR            0x2F32 +
-#define XOSC1_ADR            0x2F36 +
-#define SERIAL_STATUS_ADR    0x2F91 +
- +
-#endif +
-</code> +
- +
-Transfer these two files to the BeagleBone Black and include them into your C source code file. Following start programming the CC1200 registers:+
  
 <code C> <code C>
-cc1200_reg_write(IOCFG2_ADRSMARTRF_SETTING_IOCFG2); +cc1200_reg_write(RegSettings[0].adrRegSettings[0].val); // GPIO3 IO Pin Configuration 
-cc1200_reg_write(IOCFG0_ADRSMARTRF_SETTING_IOCFG0);+cc1200_reg_write(RegSettings[1].adrRegSettings[2].val); // GPIO2 IO Pin Configuration
  
 // ... // ...
  
 // Programm the RF frequency // Programm the RF frequency
-cc1200_reg_write(FREQ2_ADRSMARTRF_SETTING_FREQ2); +cc1200_reg_write(ExtRegSettings[12].adrExtRegSettings[12].val); //FREQ2 
-cc1200_reg_write(FREQ1_ADRSMARTRF_SETTING_FREQ1); +cc1200_reg_write(ExtRegSettings[13].adrExtRegSettings[13].val); //FREQ1 
-cc1200_reg_write(FREQ0_ADRSMARTRF_SETTING_FREQ0);+cc1200_reg_write(ExtRegSettings[14].adrExtRegSettings[14].val); //FREQ0
  
 // ... // ...
  
-cc1200_reg_write(SERIAL_STATUS_ADR, SMARTRF_SETTING_SERIAL_STATUS);+// you can program the above using a loop
 </code> </code>
  
network_protocol_programming_lab/15.2_cc1200_programming.1588153070.txt.gz · Last modified: 2020/04/29 11:37 by admin
CC Attribution-Noncommercial-Share Alike 4.0 International
Driven by DokuWiki Recent changes RSS feed Valid CSS Valid XHTML 1.0