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.

Logging thousands of sample over 1 sec ( 1/1000 or 1/2000 or above) in TM4C123G-QS-Logger

Hi
I facing difficulties in understanding--How these number represents seconds in menu.c file
    0x00000004, // 1/32
    0x00000008, // 1/16
    0x00000010, // 1/8
    0x00000020, // 1/4
    0x00000040, // 1/2
    0x00000100, // 1s
    0x00000500, // 5s
    0x00000A00, // 10s
    0x00003C00, // 1m - 60s
    0x00012C00, // 5m - 300s
    0x00025800, // 10m - 600s
    0x000E1000, // 1hr - 3600s
    0x00465000, // 5hr - 18000s
    0x008CA000, // 10hr - 36000s
    0x01518000, // 1d - 86400s
In addition, I also could not understand how these below array works in acquire.c file . How is it splitting seconds? If that corresponding hex number is right shifted by 8 and in another array again left shifted by 8...How is it practically splitting the seconds.
g_pui32MatchPeriod[0] = psConfig->ui32Period >> 8;
    g_pui32MatchPeriod[1] = (psConfig->ui32Period & 0xFF) << 8;
I have change the shifting amount from 1 bit to 32 bit and also in menu.c file to get 1/128. But I hardly got 52 samples in 1 second. 
I may have some mistake in basic understanding and I am actually sorry for that. I am hardly trying to understand the code and want to log more than 128 samples  over 1 second which is specified by qs-logger . My target is to achieve 1/2000 to 1/5000. Can anyone please help me with this problem?
Regards
Rupok
  • reading the comment before this table explain why this table is discontinuos between 1 second and half second:

    //*****************************************************************************

    //

    // Maps items from the period menu to match values for RTC.  Lower 8 bits

    // is subsecond value, upper 24 bits is seconds.  The lower 8 bits represent

    // subseconds in 7 bits, right-justififed.  So 0x01 is 1/128 of a second.

    // The order of the values here needs to match what appears in the PERIOD

    // menu in menus.c.

    //

    //*****************************************************************************

    static uint32_t g_pui32LogPeriod[] =

    {

       0x00000004, // 1/32  4/128 -> 1/32

       0x00000008, // 1/16  8/128 -> 1/16

       0x00000010, // 1/8  16/128 -> 1/32

  • HI Roberto

    Thank you for clarifying. I have read the comment but could not understand the comments properly. Now I understand how the division has been done. But yet, I don't understand-- How 128 has been calculated. That is, why  always 128 are being divided? Can you please explain?


    In addition, I have also tried to log data with 0x01 according to the comments in the code. But, it does not work. If I put 0x01 in the code, I got 52 samples per second whether I should get 128 samples per second. Can you also explain why this is happening?


    Again thank you for helping me.


    Regards

    Rupok

  • Mohammad Shams Arman Rupok said:
    In addition, I have also tried to log data with 0x01 according to the comments in the code. But, it does not work. If I put 0x01 in the code, I got 52 samples per second whether I should get 128 samples per second. Can you also explain why this is happening?

     Hi Mohammad, assuming you are using serial channel, sorry but it cannot work, you are using a slow channel to transfer too many data and this channel has limited bandwidth, 52 is a multiple of transmitted baud rate, you can obtain better performance saving data to flash pendrive or SD card, this can help a lot more due to channel speed two three order of magnitude greater than serial channel, if more is needed then and HIGH speed channel like network is absolutely necessary but 123 series just has on chip USB OTG (12Mbps) and SSI the fastest channel. Binary compressed RLL protocol can help raise serial transfer but don't expect to have more than 5 10K samples/sec.

  • Hi Roberto

    Thanks for your quick reply.

    I can store data both on flash pendrive and SD card. I have also remove the display part from the code to get more speed. I change the preferred storage option from code. However, I prefer SD storage option which uses SSI.

    are there any timing issues or interrupt issues involved that preventing the speed of logging data?

    The following post also discuss about this issue--but I am confused from where I can fix this issue..

    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/210147#pi239031349=1
    http://e2e.ti.com/support/microcontrollers/tiva_arm/f/908/t/251537

    regards
    Rupok
  • Hi Mohammad, like the thread you pointed me to, you MUST plan bandwidth of what are you storing or transferring to, TM4C1294XL can help you better using Ethernet due to better data rate of channel but in a busy network this can be again a bottleneck, so plan what you are trying to do, what you wish to store, bandwidth needed as Stellaris Dexter CB1 and other pointed to, if this is not clear then your project never can be run. THIS NEED TO BE GRASPED BEFORE TO WRITE CODE!!!!!!
    SDcard is limited to near 20MHz SSI clock and has some overhead too. USB 2.0 Full Speed (Not High speed 480Mbps) is limited to 12MBps then account for both USB and mass storage overhead has to be accounted on real bandwidth. At 5KHz maybe with some buffering data can be written succesfully to SD or USB, if data can be RLL or other way compressed than also serial channel can transfer too.
    YOur problem is unsolvable if you don't have knowledge of what to do... Sorry sed lex dura lex...