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.

Wireless motor monitor reference design details

Other Parts Discussed in Thread: CC2650, MSP-DSPLIB

Hi Everyone,

I'm working on making this reference design for a wireless motor monitor. I've got the design working but the guide is a bit vague on how to actually operate the device.

Specially it makes no mention of the structure of the GATT server. I know it's based on the simpleBLEperipheral profile but I don't know what to write to what get it to actually output values.

Also the design is supposed to be used with an IOS app to graph/visualise the motor vibration. The app is called techbasic, it's basically a small IDE for IOS. I have the app but the code needed to run it is not included in the design files. It would be great if I could get a copy of the techbasic code so I can use the design.

Thanks for your help!

  • Hi John,

    There are two characteristics used to talk to the platform:

    0xFFF1 is written to write to the MSP430. Whatever you write to this characteristic is forwarded to the MSP430 via the UART connection between the CC2650 and MSP430. You'll see in the MSP430 code there are several cases defined for changing operating modes based on what gets written to the MSP430 UART.

    0xFFF5 is read from to receive data coming from the MSP430 UART. The data is sent from the MSP430 to the CC2650 with a frame index in 20 byte packets. The iOS application simply scans this characteristic and updates application data and GUI when a complete set of 20 byte packets have been received.

    I'll need to get approval through our review process to give you the techBASIC code.

    BR,
    Leo
  • Hi Leonardo,

    Thanks for the reply and the design! It’s quite neat. I think I should be alright without the tech basic code now, i’ve nearly finished building a script that graphs the output but i’m sure it will be useful for others. I actually used “pythonista” which is a python ide for iOS which has bluetooth support. I’d highly recommend it if anyone is looking for a tech basic alternative.

    I just have one last question, i’m having a problem where the device will crash once I subscribe for updates on 0xFFF5, after writing the appropriate command to 0xFFF1. I haven’t modified the code at all. At the moment i’m trying to modify the ble peripheral code to update slower but not sure if this is the cause of the problem.

    Thanks!

  • Ok, I think i get it now, you can't use updates because you're writing bytes one at a time to 0xFFF5. So basically you just keep reading 0xFFF5 until you've got one new set of data? I think I might modify the program to update on another register when there's a new set of data, then my client will get notified of that can can check 0xFFF5. I guess I could also buffer the incoming data and only write it to 0xFFF5 once. 

    Is there anything useful in the other code that's commented out of the SimpleBLEPeriferial? 

    Also, is this the actual FFT algorithm?

    for(k=0; k<numSamples/2; k++){

    zArrayFFT[k] = abs(zArray[j]*zArray[j])/256;

    zArrayFFT[k] += abs(zArray[j+1]*zArray[j+1])/256;

    j+=2;

    }   }

  • Hi John,
    Bluetooth Low Energy enables reading/writing 20 bytes at a time - so when you read 0xFFF5 - you'll get 20 bytes at a time. 20 bytes at a time are also communicated between the MSP430 and CC2650 for this reason.
    The code above represents the calculation of the normalized power of the FFT - not the FFT itself. The FFT library not available at the time of this design's release. I'll check to see where this is now.
    BR,
    Leo
  • Hi John,

    I ran into this problem with notifications also. Instead of using notifications, I wrote my iOS app to just repeatedly read(poll) the data and check the frame number. Although I got some repeated reads - this seemed to work well for repeatedly graphing data with a refresh rate of a second or two on my iPAD3. I'm not sure where the root cause of this notification issue might lie - you might check to see whether you see it with the unmodified SimpleBLEPeripheral example code if you're trying to get higher refresh rates.

    BR,
    Leo
  • Any progress on this? We're (my company) are currently waiting on it to get the device working.

  • The FFT code/library^^
  • Hey Leo,

    Any update on this? I cant seem to find any 4k fft code that will fit on the microcontroller. To be honest i've been pretty annoyed and frustrated by the lack of detail in this project. Seems more of a show piece than a reference design. I won't be using any other TI reference designs and probably parts in the future. 

  • Hi John,

    I apologize for not getting back to you sooner.  The FFT code should be released within a few weeks.  I'll be happy to help you with it as soon as it's been released.

    BR,
    Leo

  • Hi Leo,

    How's this going? Any idea when the library might be released?

  • You could use the FIX_FFT code that I have seen around if for some reason that library doesn't get produced in your timeline.

    Is one reference of it in action within TI there are many flavors of it out there.

    Here is another more recent use of this library since it is open for public use.

    Below is some C code I made that will also produce a table for you to use inside this fix_fft.c (This is tested some so keep in mind that it might need a tweek or too) 

    You would just run the c code in an online IDE and the output can be copied and pasted into fix_fft.c 


    #include <stdio.h>
    #include <math.h>
    #define POINTS 128
    #define BITS   16
    
    
    
    
    int main(void)
    {
      int n;
      int a=0;
      int TF_FLAG=POINTS-POINTS/4;
    printf("#define N_WAVE      %d    /* full length of Sinewave[] */\n",POINTS);
    printf("#define LOG2_N_WAVE %d      /* log2(N_WAVE) */\n",(long)log2(POINTS));
    printf("/* 3/4 of N_WAVE = %d  */\n",TF_FLAG);
    printf("const int8_t Sinewave[N_WAVE-N_WAVE/4] = {\n");
      for (n=0; n<POINTS; n++){
            if(n==TF_FLAG){
              printf("/*");
            }
    
    
    
    
      if(a<15){
        printf("%d,", (int)floor(0.5 + ((1 << (BITS-1)) - 0.50001) * sin(2 * 3.1415926535897932 / POINTS * n)));
            a++;}
           else{
            a=0;
            printf("%d,\n", (int)floor(0.5 + ((1 << (BITS-1)) - 0.50001) * sin(2 * 3.1415926535897932 / POINTS * n)));
            }
    }
    printf("*/");
    printf("};\n");
    
    
    
    
      return 0;
    }

    Hope that helps or gets you started :-)

  • Hi John,

    The library has just been released! You can download it from:

    http://msp430.sc.ti.com/msp430_releases/DSPLib/1_10_00_10/

    BR,
    Leo

  • Thanks very much for this Leonardo! Unfortunately I get a DNS error when I try to download the files. Maybe it's just taking a while to update?

  • msp_cmplx_fft_fixed_q15(const msp_cmplx_fft_q15_params *params, int16_t *src) Is the function I would study as this will pass the source and the params list (I think which is a struct....) 

  • Hi Leo any luck with this we are doing similar stuff ?
  • Hi Aman,

    The MSP-DSPlib has been released for a while now. Have you tried downloading from this site?

    www.ti.com/.../MSP-DSPLIB

    BR,
    Leo