From d4da08a3d7c0fbd7225f989c423d3cc4a4c935e4 Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Wed, 17 Oct 2012 15:59:47 -0700 Subject: [PATCH] Oops! Forgot to change MAX2837 mode from RX to TX when transceiver mode is changed. Initialize MAX5864 earlier, in "transceiver" mode (where both ADC and DAC are active), and then shift SSP1 into MAX2837 mode and leave it there, for faster tuning and RX/TX switching. --- firmware/usb_performance/usb_performance.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/firmware/usb_performance/usb_performance.c b/firmware/usb_performance/usb_performance.c index c681c625..efa25151 100644 --- a/firmware/usb_performance/usb_performance.c +++ b/firmware/usb_performance/usb_performance.c @@ -178,9 +178,13 @@ void set_transceiver_mode(const transceiver_mode_t new_transceiver_mode) { if( transceiver_mode == TRANSCEIVER_MODE_RX ) { gpio_clear(PORT_LED1_3, PIN_LED3); usb_endpoint_init(&usb_endpoint_bulk_in); + + max2837_rx(); } else { gpio_set(PORT_LED1_3, PIN_LED3); usb_endpoint_init(&usb_endpoint_bulk_out); + + max2837_tx(); } sgpio_configure(transceiver_mode, true); @@ -443,6 +447,9 @@ int main(void) { usb_run(&usb_device); ssp1_init(); + ssp1_set_mode_max5864(); + max5864_xcvr(); + ssp1_set_mode_max2837(); max2837_setup(); @@ -456,8 +463,6 @@ int main(void) { max2837_set_frequency(freq); max2837_start(); max2837_rx(); - ssp1_set_mode_max5864(); - max5864_xcvr(); while(true) { // Wait until buffer 0 is transmitted/received.