Skip to content

Commit 5bd9869

Browse files
committed
Fix LC and IF calibration
1 parent 0e22546 commit 5bd9869

7 files changed

Lines changed: 1905 additions & 1907 deletions

File tree

-12 Bytes
Binary file not shown.

scm_v3c/applications/ble_tx/Objects/ble_tx.hex

Lines changed: 915 additions & 916 deletions
Large diffs are not rendered by default.
36 Bytes
Binary file not shown.

scm_v3c/applications/ble_tx_154_rx/Objects/ble_tx_154_rx.hex

Lines changed: 982 additions & 980 deletions
Large diffs are not rendered by default.

scm_v3c/applications/ble_tx_154_rx/ble_tx_154_rx.c

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@
1919
#define LENGTH_PACKET 125 + LENGTH_CRC ///< maximum length is 127 bytes
2020
#define LEN_RX_PKT 20 + LENGTH_CRC ///< length of rx packet
2121

22-
#define TIMER_PERIOD 2500 ///< 500 = 1ms@500kHz
22+
#define TIMER_PERIOD 7500 ///< 500 = 1ms@500kHz
2323
#define BLE_TX_PERIOD 50
2424

25-
#define BLE_CALIBRATE_LC false
25+
#define BLE_CALIBRATE_LC true
2626
#define BLE_SWEEP_FINE true
2727

2828
//=========================== variables =======================================
@@ -114,11 +114,15 @@ int main(void) {
114114

115115
// Initial frequency calibration will tune the frequencies for HCLK, the RX/TX chip clocks, and the LO
116116

117+
// For the LO, calibration for RX channel 11, so turn on AUX, IF, and LO LDOs
118+
// by calling radio rxEnable
119+
radio_rxEnable();
120+
117121
#if BLE_CALIBRATE_LC
118122
optical_enableLCCalibration();
119123

120-
// Turn on LO, DIV, PA
121-
ANALOG_CFG_REG__10 = 0x68;
124+
// Turn on LO, DIV, PA, and IF
125+
ANALOG_CFG_REG__10 = 0x78;
122126

123127
// Turn off polyphase and disable mixer
124128
ANALOG_CFG_REG__16 = 0x6;
@@ -127,10 +131,6 @@ int main(void) {
127131
optical_setLCTarget(250020);
128132
#endif
129133

130-
// For the LO, calibration for RX channel 11, so turn on AUX, IF, and LO LDOs
131-
// by calling radio rxEnable
132-
radio_rxEnable();
133-
134134
// Enable optical SFD interrupt for optical calibration
135135
optical_enable();
136136

scm_v3c/ble.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,6 @@ void ble_set_channel(uint8_t channel) {
218218
ble_vars.channel = channel;
219219
}
220220

221-
222221
void ble_set_name_tx_en(bool name_tx_en) {
223222
ble_vars.name_tx_en = name_tx_en;
224223
}

scm_v3c/optical.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,8 +221,6 @@ void optical_sfd_isr(){
221221
++optical_vars.cal_LC_coarse;
222222
if (optical_vars.cal_LC_coarse > LC_CAL_COARSE_MAX) {
223223
optical_vars.optical_LC_cal_finished = true;
224-
// Turn off divider.
225-
divProgram(480,0,0);
226224
printf("coarse: %u, mid: %u, fine: %u\n", optical_vars.LC_coarse, optical_vars.LC_mid, optical_vars.LC_fine);
227225
}
228226
}

0 commit comments

Comments
 (0)