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.

how could i measure/test the connection interval?

Other Parts Discussed in Thread: CC2540

Hi everyone! I need to measure my connection interval which was set in 100 ms.

But i need to do some tests and i don´t sure that the connection interval was set correctly.

I proved with an oscilloscope the SimpleBlePeripheral disabling

all periodic and external events.

In Osal.c:

osal_run_system( void ){

...

osal_pwrmgr_powerconserve();

P1_7 ^= 1;

}

So for only in a connection interval the proccessor should wake up.

But when i measure the P1_7 pin shows a signal of 500ms instead of 100ms. 


Any help will be appreciated.

Thanks, Greetings to all!

Martin Romero

  • Hi,

     

    There are some wrap issues in your post, some information is missing.

    Is it possible for you to break the lines so it can be readable?

  • Thanks to all, i've resolved my problem.
    Therea are two ways to verify the connection interval.
    One is as application note "AN092" said, 
    and the other, which is easier, is :
    ...
        P1_7=0;
    osal_pwrmgr_powerconserve(); // Put the processor/system into sleep
    P1_7=1;
    ...
    If no events, in the oscilloscope you can see the connection interval through P1_7. 
    
    
    Bye!
  • In fact I was about to suggest to:

    P1_7 ^=1;
    osal_pwrmgr_powerconserve();
    
    
    In other words, to change the order of the statements :)
    So we can mark all this as solved.
    Bye!

  • Kazola,

    Your solution is also valid, thanks

    Bye!

  • Hi Martin, I have the CC2540 development kit, and I want to send a data from a computer through the CC2540 dongle and receive it at the keyfob, and then I want to take this data from the keyfob's test pins and send it to another hardware through a wired-connection. I am able to send the data from the computer and receive it at the keyfob, but I don't know how to assign the received data to the test pins of the keyfob, I think it has something to do with the osal.c file and I need to make certain changes so that I can observe the received data at the test pins of the keyfob and then take it to another hardware through wired connection. I am using the Simple BLE Application that is provided by TI. Can you possibly help me?

    Thanks,

    Oguz 

  • Hi Oguz... Once you have received the data from pc app to the keyfob, if you want to output this data over the test pins

    you should configure these test pins as output.

    For example in SimpleBLEPeripheral.c, in the SimpleBLEPeripheral_Init function,

    when the example sets the ports, you should configure the test pins like:

    P2SEL = 0; // Configure Port 2 as GPIO

    P2DIR = 0xFF; // All port2 pins as output

    You should use the pins that are mapped in keyfob.

    Then if you want to output data over this pins, you could do

    P2 = dataByte;

    If you want send this data to another micro you could use i2c or spi.

    In the cc2540 datasheet explains what pins that you should set and tells you how these protocols work.

    Best regards,

    Martín Romero

  • Thank you for the response. Do you happen to know if the data is transmitted from the dongle serially or parallel? Also I need to send the received data to the test pins as it is easier to get the data from, and test pins have the P1_2, P1_3, P1_4, P1_5, P1_7, P0_0, P0_1, P0_6, P0_7 connected to CC2540.  Also P0_0, P0_1 are connected to the 2 buttons on the keyfob, and P1_2, P1_3, P1_4, P1_5, P1_7 are connected to the Acc meter, so I cant use them, it seems like I can only use P0_6, P0_7 to assign the received data and then take it from. How can I assign 8 bit data to 2 pins? Also you say P2= dataByte, in the SimpleBLEPeripheral.c what corresponds to dataByte? 

    Thank you in advance,

    Oguz

  • You can use SPI to output data serially. You can view Keyfob example which uses spi to comunicate with accelerometer.

    // Accelerometer connected at:
    // P1_2 = -/CS
    // P1_3 = SCK
    // P1_4 = MISO
    // P1_5 = MOSI <-- The data is output on this pin.
    // P1_7 = CS/DATA_READY
    (In HAL_BOARD_CFG_H you can configure SPI protocol)
    With an oscilloscope you can check the output data.
  • Can you please tell me what part of the SimpleBLEPeripheral.c's code (In which method) I will implement this SPI in the Keyfob example?

  • Hi!

    In SimpleBLEPeripheral project...

    In HAL\Target\CC2540EB\Config\   you can find HAL_BOARD_CFG_H file, which contains SPI Api. 

    Probably you have to modify the code for adapt to your goal.

    Then, in SimpleBLEPeripheral_Main you should call the SPI_INIT() macro after to the HalDriverInit().

    The Keyfob project is an example of how to use SPI.

    Best regards,

    Martín Romero