This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP-EXP430FR5739: Board inaccessible since implementing ADC

Part Number: MSP-EXP430FR5739
Other Parts Discussed in Thread: UNIFLASH

Hi All,

I've been using a MSP-EXP430FR5739 board to develop some code to read a potentiometer input and send it to UART. 

A significant issue is that when the ADC has been set up and is functional, I can no longer access the board through Uniflash or CCS.This occured with multiple boards.

This leaves me unable to re-flash the board or sometimes not even access it  through putty.

I have tried the reset button during connection attempts but I am no sure if this helps.

Did I implement the ADC peripheral incorrectly such that the board is inoperable? This code has other aspects to it such as PWM via timers. 

ADC code below:

    //--------ADC for Pot Control-------
    // P3.0 set for analog input P3.0 -> A12
    P3SEL0 |= BIT0;

    ADC10CTL0 &= ~ADC10SHT0_H;         // Clear ADCSHT
    ADC10CTL0 |= ADC10SHT_2;           // Change to 16 cycles
    ADC10CTL0 |= ADC10ON;              // Turn on ADC

    ADC10CTL1 |= ADC10SSEL_2;          // ADC clock source
    ADC10CTL1 |= ADC10SHP;             // Sampling timer

    ADC10CTL2 &=  ~ADC10RES;           // Clear resolution
    ADC10CTL2 |= ADC10RES;             // 10-bit resolution

    ADC10MCTL0 |= ADC10INCH_12;         // Send A6 to ADC memory

Thanks

  • The following code is in the main loop:

           int value = ADC10MEM0;

           ADC10CTL0 |= ADC10ENC | ADC10SC;        // Enable and start conversion

           while ((ADC10IFG & ADC10IFG0) == 0){};    // wait for conversion

         

  • Hello,

    What kind of error are you receiving when you try to flash the program?  Are you able to debug the program?  Also, can I see all of the code in the program you are trying to run?

    Sincerely,

    Kyle Holub

  • Hi Kyle,

    Thanks for the reply.

    On Uniflash, the board is not detector at all. The board does show up in device manager as a COM port on windows.

    On CCS, attempting to flash loads the debugger but it hangs up for a few minutes before declaring "Could not find MSP-FET430UIF on specified COM port."

    I will try to gather the code for review. This snippet below is also a new bit of code that may have affected me as well. All other code was functioning correctly until the ADC and this code was added.

     char* msg = IntToHexArray(value); // used to convert the ADC value into a char array for UART output

           SerialPrint(msg, 3); // Function that sends arrays out to UART - USB, read through putty
           free(msg);
           SerialPrint("\n\r", 2);

    char * IntToHexArray(int val){
        unsigned short i = 0;
        int val_buff = val;
        while (val_buff){
            val_buff /= 10;
            i++;
        }

        char* out_arr = (char *)calloc(i, sizeof(char));

        if (out_arr == NULL){
            return (char *) NULL;
        }

        while (i--){
            out_arr[i] = (val % 10) + '0';
            val /= 10;

        }
        return out_arr;

    }

  • Quick Update: I am able to connect to Putty using a different computer. This is the case for two boards I have tried. For one I can connect to Uniflash and Putty. For the other I can only connect using putty

    Thanks

  • Hello,

    It is definitely odd that CCS can't find the debugger.  I currently don't think there is anything wrong with the code.  I am curious about the state of the debugger when you plug it in.  Can you look through the below screenshot concerning the debugger LED outputs and tell me what the LEDs look like on your board?  Also, what does your hardware set up look like?

    Sincerely,

    Kyle Holub

**Attention** This is a public forum