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.

RF430FRL152H: Sampling rate

Part Number: RF430FRL152H
Other Parts Discussed in Thread: TRF7970A

Hello team,

Could you please advice me how can i control the sampling rate of RF430FRL152h? Currently, i have connected my sensor to ADC0 and i am reading the data from android phone. I am receiving data/s currently. I need to increase it to data/ms. Your suggession in this regard is really appreciated.

Best regards

Ataur

  • Hello Ataur,

    please see the "Technical Reference Manual" page 204 for the possible sampling rates depending on the accuracy:

    http://www.ti.com/lit/ug/slau506/slau506.pdf

    I assume you are using the build in ROM firmware of the RF430FRL152H. To speed up the sampling you have to configure the "ADC0 Sensor Configuration Register (Adr. 0xF87A)" and set the filter parameter which results in different sampling speed.

    The start of a sampling can either be done by setting the start bit every time you want to get a new value or setting up the scheduler with infinite sampling once it is started. Infinite sampling is set in the "Interrupt Control Register" bit 0. "Number of Passed Register (Adr. 0xF86C)" must be set to "2" in this case and the "Frequency Register (Adr. 0xF86B)" to the desired value to achieve the required speed.

    Firmware Users Guide:

     http://www.ti.com/lit/pdf/slau603b

    Please see also the following thread which covers a similar problem:

    https://e2e.ti.com/support/wireless-connectivity/other-wireless/f/667/p/956315/3535078

    Best Regards,

    Helfried

  • Hi Helfried,

    Thanks very much for your quick reply.

    Yes, i am using the build in ROM firmware.

    I tried the following steps according to your suugession and it didn't work;

    i) In Demo mode of GUI interface, i started the demo.

    ii) In Gen. divice config:  General control register > checked  Start sampling process > checked LPM3; Sensor control register >checked light sensor; Number of passes register > 2; Frequency register > custom time; and then checked the infinite sampling.

    iii) In Sensor config: Light sensor configuration register > Gain (1) > Filter type (CIC) > Overs sampling (32)

    iv) In Alarm control: Store samples memory >1

    v) In Sensor threshold configuration: Custom time register > 40 ms in Block 3.

    Then i clicked the "write all setting". After that i removed the patch from the TI reader and read by android app. Still i am receiving one data point/s. Did i do anything wrong here? Was the chip not configured with those steps?

    Do i need to check anything on the System tab as well? And how to select the   "interept control register" bit 0?

    Looking forward to your reply.

    Best regards

    Ataur

  • Hello Ataur,

    I took my setup and did the same as you did and all seems to be ok.

    When you finally do the "Write All Settings" go to the "Gen. Device Config" tab and do a "Read only this tab". you should see in the Status register "Sampling in Progress". When you switch to the "View Sensor Data" tab and repeatedly press "Read Logged Data" you will notice that the Light Sensor data will vary.

    So far everything is ok. But when you remove the RF430FRL152H from the RF field it needs to be started by setting the "Start Sampling Process" again. That is the reason why you will not get data with your android app.

    If the start bit was set before just do a "Read Single Block 0" with your Android App and write the data back again with "Write Single Block 0".

    You can try this also with the Demo GUI. After removing the Board from the field write back the data in the "Gen. device config" tab to restart the measurement.

    Best Regards,

    Helfried 

  • Dear Helfried,

    Thanks for the reply. We are actually struggling with the given instruction for setting interupt control resister (0), Number of passes register (2), and frequency register (to the required value) in the android app. We found the following initial setting under command o in the code.

    Initial settings:

    (byte) 0x01, //-General Control Register

    (byte) 0x00, //-Status Register

    (byte) 0x07, //-Sensor Control Register

    (byte) 0x03, //-Frequency Register

    (byte) 0x01, //-Number of Passes Register

    (byte) 0x01, //-Extra Sampling Register

    (byte) 0x00, //-Power Modes

    (byte) 0x40

     

    Result: Getting 1 data point per second.

     We changed the setting as follows:

    Settings now:

    (byte) 0x00, //-General Control Register

    (byte) 0x00, //-Status Register

    (byte) 0x07, //-Sensor Control Register

    (byte) 0X00, //-Frequency Register

    (byte) 0x02, //-Number of Passes Register

    (byte) 0x01, //-Extra Sampling Register

    (byte) 0x00, //-Power Modes

    (byte) 0x40

    Result: Getting around 5 data points per second.

    Could you please let me know what does it mean by command 0,command 1.....command 8? And how to set up the instruction you suggested. I couldn't find the interupt control register in the given code. How to put the bit to acheive 40 ms of sampling period? Could you please guide us for the settings of the register mentioned above to get required sampling rate?

    Thanks in advance for your cooperation.

    Best regards

    Ataur

  • Hello Ataur,

    the sampling speed you see is from the setting in the "Frequency Register" which set to '00' which means 4 times a second. When you need a faster speed you have to set it to "Custom Time" and define the time in the "Custom Timer Value Register" (Block 3 byte 0). Please see the Firmware User's Guide.

    How do you program the registers with your android app? I assume you are doing a write single block with 8 byte blocks.

    I have written a small Windows GUI which is maybe helpful for a better understanding. To use it with the TRF7970A reader and the RF430FRL152H EVM press at first "Init Reader" in the first tab. In the second tab you see all the RF430FRL152H registers. When selecting a register the associated byte in the block data will be highlighted. All registers are located in the blocks 0 - 8 (each are 8 byte blocks).

    RF430FRL152H_Util_V1_2_0F.zip

    Best Regards,

    Helfried

  • Hi Helfried,

    Thanks very much. The GUI appication was very helpful in understanding the registers.

    My target is to acheive 40 ms sampling period. What i understood is we have to select 16 (according to the Firmware user guide) in frequency register of BlockNr -0  and then set the custom timer vaue in BlockNr -3 which is an 8 bit register.

    Could you please guide me how to set time in 8 bit custom timer value register?

    I was actually talking about the source code of Android app in my previous mail. We found that by changing the number in the frequency register of command 0 in the source code, we could vary samlpling on the app according to the firmware user guide except for the custom timer. Is the command 3 reflecting the BlockNr 3 of the GUI application you have provided? If it is the case do we need to change the custom time value in the command 3?

    Best regards

    Ataur

  • Hello Ataur,

    your understanding is correct, you have to set the "Frequency" register to 16 ( = 10 hex) to be able to specify a "Custom Timer Value".  

    The "Custom Time Value" can be set to the required 40ms (= 28 hex) with the ISO15693 command "Write Single Block", BlockNumber = 3, Blockdata = "28000000FFFFFFFF", assuming the "Low/High Threshold Reference ADC1" registers, which are the "FFFFFFFF" part of the blockdata , are not used and stay at their default.

    Best Regards,

    Helfried

  • Dear Helfried,

    Thanks again.

    I set up the block data as follows in the ISO15693 command "write single block" block number =3. I didn't see the sampling for 40 ms. Could you please further check if i am doing anything wrong and correct me accordingly?

    byte Command0[] = new byte[] { 
          (byte) 0x01, //-General Control Register 
          (byte) 0x00, //-Status Register 
          (byte) 0x07, //-Sensor Control Register 
          (byte) 0x10, //-Frequency Register 
          (byte) 0x02, //-Number of Passes Register 
          (byte) 0x01, //-Extra Sampling Register, Averaging register 
          (byte) 0x00, //-Power Modes, Interupt register 
          (byte) 0x40  // error control register 
    }; 
    byte Command1[] = new byte[] { 
          (byte) 0x00, //-Reference ADC1 Sensor Skip counter 
          (byte) 0x00, //-Thermistor ADC2 Sensor Skip counter 
          (byte) 0x00, //-ADC0 Sensor Skip Counter 
          (byte) 0x00, //-Frequency Register, Internal Sensor Skip Counter 
          (byte) 0x00, //-Digital Sensor1  Skip Counter 
          (byte) 0x00, //-Digital Sensor 2 Skip Counter 
          (byte) 0x00, //-Digital Sensor 3 Skip Counter 
          (byte) 0x00  // Number of blocks received 
    }; 
    byte Command2[] = new byte[] { 
          (byte) 0x19, //-Reference ADC1 configuration 
          (byte) 0x19, //-Thermistor ADC2 configuration 
          (byte) 0x18, //-ADC0 sensor configuration 
          (byte) 0x00, //-Internal sensor configuration 
          (byte) 0x00, //-Initial Delay period Setup 
          (byte) 0x00, //-JTAG Enable Password 
          (byte) 0x00, //-Initial Delay period 
          (byte) 0x00  //-JTAG 
    }; 
    byte Command3[] = new byte[] { 
          (byte) 0x28, //-Custom Timer Value 
          (byte) 0x00, //-Custom Timer Value 
          (byte) 0x00, //-Custom Timer Value 
          (byte) 0x00, //-Custom Timer Value 
          (byte) 0xFF, //-Low threshold Reference-ADC1 
          (byte) 0xFF, //-Low threshold Reference-ADC1 
          (byte) 0xFF, //-High threshold Reference-ADC1 
          (byte) 0xFF  //-High threshold Reference-ADC1 
    }; 
    byte Command4[] = new byte[] { 
          (byte) 0x00, //-Low Threshold Thermistor-ADC2 Sensor 
          (byte) 0x00, //-Low Threshold Thermistor-ADC2 Sensor 
          (byte) 0x00, //-High Threshold Thermistor-ADC2 Sensor 
          (byte) 0x00, //-High Threshold Thermistor-ADC2 Sensor 
          (byte) 0x00, //-Low Threshold ADC0 Sensor 
          (byte) 0x00, //-Low Threshold ADC0 Sensor 
          (byte) 0x00, //-High Threshold ADC0 Sensor 
          (byte) 0x00  //-High Threshold ADC0 Sensor 
    }; 
    byte Command5[] = new byte[] { 
          (byte) 0x00, //-Low Threshold Internal Temperature Sensor 
          (byte) 0x00, //-Low Threshold Internal Temperature Sensor 
          (byte) 0x00, //-High Threshold Internal Temperature Sensor 
          (byte) 0x00, //-High Threshold Internal Temperature Sensor 
          (byte) 0x00, //-Low Threshold Digital 1 Sensor 
          (byte) 0x00, //-Low Threshold Digital 1 Sensor 
          (byte) 0x00, //-High Threshold Digital 1 Sensor 
          (byte) 0x00  //-High Threshold Digital 1 Sensor 
    }; 
    byte Command6[] = new byte[] { 
          (byte) 0x00, //-Low Threshold Digital 2 Sensor 
          (byte) 0x00, //-Low Threshold Digital 2 Sensor 
          (byte) 0x00, //-High Threshold Digital 2 Sensor 
          (byte) 0x00, //-High Threshold Digital 2 Sensor 
          (byte) 0x00, //-Low Threshold Digital 3 Sensor 
          (byte) 0x00, //-Low Threshold Digital 3 Sensor 
          (byte) 0x00, //-High Threshold Digital 3 Sensor 
          (byte) 0x00  //-High Threshold Digital 3 Sensor 
    }; 
    byte Command7[] = new byte[] { 
          (byte) 0x00, //-Reference or ADC1 Alarm Configuration 
          (byte) 0x00, //-Thermistor and ADC2 Alarm Configuration 
          (byte) 0x00, //-ADC0 Alarm Configuration 
          (byte) 0x00, //-Internal Alarm Configuration 
          (byte) 0x00, //-Digital 1 Alarm Configuration 
          (byte) 0x00, //-Digital 2 Alarm Configuration 
          (byte) 0x00, //-Digital 3 Alarm Configuration 
          (byte) 0x00 
    }; 

     

    WriteSingleBlock code: 

     

    Iso15693WriteSingleBlock iso15693WriteSingleBlock = new Iso15693WriteSingleBlock(mContext, mTag, 1, 1); 
    iso15693WriteSingleBlock.WriteSingleBlock((byte) 1, Command1, mOnCommandExecutedCallBack); 
    iso15693WriteSingleBlock.WriteSingleBlock((byte) 2, Command2, mOnCommandExecutedCallBack); 
    iso15693WriteSingleBlock.WriteSingleBlock((byte) 3, Command3, mOnCommandExecutedCallBack); 
    iso15693WriteSingleBlock.WriteSingleBlock((byte) 4, Command4, mOnCommandExecutedCallBack); 
    iso15693WriteSingleBlock.WriteSingleBlock((byte) 5, Command5, mOnCommandExecutedCallBack); 
    iso15693WriteSingleBlock.WriteSingleBlock((byte) 6, Command6, mOnCommandExecutedCallBack); 
    iso15693WriteSingleBlock.WriteSingleBlock((byte) 7, Command7, mOnCommandExecutedCallBack); 
    iso15693WriteSingleBlock.WriteSingleBlock((byte) 0, Command0, mOnCommandExecutedCallBack); 

    ....................................................................................................................................................

    Looking forward to your cooperation.

    Best regards

    Ataur

     

  • Hello Ataur,

    you have 3 different sensors enabled (Sensor Control Register = 0x07). The custom time specified is 40ms. The scheduler tries to read all enabled sensors in 40ms which is not possible. You can either reduce to only one sensor with a minimum sample time of 32ms or you have to extend the custom time.

    Best Regards,

    Helfried