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 NFC and battary

Other Parts Discussed in Thread: RF430FRL152H, RF430FRL152HEVM

Hello, can you help me?
I have a problem, when i used RF430frl152h as TAG and dont used LPM it work good, but if i use LPM3 mode he don't defined as TAG

  • Are you using the NFC example that was recently released?

    http://www.ti.com/lit/zip/slac691

    You need to make sure that when you enter LPM3 mode that global interrupts are enabled.  See example below:

    __bis_SR_register(LPM3_bits + GIE);

    If this does not help, if you would post some parts of your code I would be willing to review it.

  • Yes, i use RF430FRL152H_NFC_Only_Simple_Project, but i use WDT:

    WDTCTL = WDTPW | WDTSSEL_1 | WDTCNTCL | WDTTMSEL | WDTIS_3;

    and my WDT function

    #pragma vector = WDT_VECTOR
    __interrupt void WDT_ISR(void)
    {
    function where i use ADC and save result in FRAM
    }
  • Hello Bazilio,

    Are you making any modifications in order to run the ADC using that project? My understanding is that when enabling the NFC functionality for the FRL there are additional modifications needed to then re-enable the ADC operation. These aren't included in the example project to my knowledge.
  • i used
    void SetupSD14(unsigned char channel)
    {
    SD14CTL1 = SD14RBEN1 + SD14RATE_5 + SD14RBEN0 + SD14UNI + SD14GAIN0 + SD14INTDLY0 + channel;
    SD14CTL0 = SD14IE + SD14SGL + SD14DIV1; // 2 kHz sampling rate, ACLK source, SVSS ground (.125V), interrupt enable
    }

    SD14CTL0 |= SD14EN; // SD14 module enabled,
    SD14CTL0 |= SD14SC; // start the conversion

    start module and conversion in WDT interrupt 

  • It is best to save SD14 results in the SD14 ISR. To start a conversion you can use the Watchdog ISR.
    I don't see a problem with the code that you posted. Perhaps you can post it all?
  • #include <rf430frl152h.h>
    #include <string.h>
    #include "types.h"
    
    //*****************************FUNCTION PROTOTYPES********************************/
    void DeviceInit(void);
    void initISO15693(u16_t parameters );
    void SetupSD14(unsigned char channel);
    void userCustomCommand();
    //********************************************************************************/
    u16_t SamplesBuffer[4];
    u08_t State;
    
    enum state_type
    {
        IDLE_STATE              						= 1,
        ONE_SHOT_TEMP_REFERENCE_SAMPLE_STATE            = 2,
        ONE_SHOT_TEMP_THERMISTOR_SAMPLE_STATE           = 3
    };
    
    enum Channel_Types
    {
        ADC0_CHANNEL                        = 0x0,
        INTERNAL_TEMPERATURE_CHANNEL        = 0x1,
        THERMISTOR_ADC2_CHANNEL             = 0x2,
        REFERENCE_ADC1_CHANNEL              = 0x3,
    };
    
    //*****************************DEFINES *******************************************/
    #define CLEAR_BLOCK_LOCKS                            	BIT3
    #define FRAM_LOCK_BLOCK_AREA_SIZE  						38
    #define FRAM_LOCK_BLOCKS								0xF840  //Address of ISO15693 lock blocks
    
    
    #define ROM_EUSCI_SUPPORT_ENABLED       BIT2
    #define EROM_EUSCI_SUPPORT_DISABLED     0
    #define ROM_SENSOR_SUPPORT_ENABLED      BIT7
    #define ROM_SENSOR_SUPPORT_DISABLED     0
    #define	NFC_BRIDGE_DISABLED 			BIT6
    #define	NFC_BRIDGE_ENABLED  			0
    #define	EIGHT_BYTE_BLOCK    			BIT0
    #define	FOUR_BYTE_BLOCK     			0
    #define	FIRST_ISO_PAGE      			BIT1
    #define	SECOND_ISO_PAGE     			0
    #define FIRMWARE_CONTROL_ADDRESS 	0xF867
    #pragma RETAIN(Firmware_System_Control_Byte);
    #pragma location = FIRMWARE_CONTROL_ADDRESS
    const u08_t Firmware_System_Control_Byte = ROM_SENSOR_SUPPORT_DISABLED + EROM_EUSCI_SUPPORT_DISABLED + NFC_BRIDGE_DISABLED + FOUR_BYTE_BLOCK + FIRST_ISO_PAGE; //0x7F,		// this value sets the firmware system control register
    
    // ROM variables - DO NOT CHANGE !!!
    // Declared to protect from use by compiler
    /********************************************/
    #pragma RETAIN(DS)
    #pragma location = 0x1C00
    u08_t DS;
    #pragma RETAIN(RF)
    #pragma location = 0x1C6A
    const u08_t RF;
    #pragma RETAIN(NRX)
    #pragma location = 0x1CA4 //rx
    const u08_t NRX[34];
    #pragma RETAIN(NTX)
    #pragma location = 0x1CC6 //tx
    const u08_t NTX[33];
    #pragma RETAIN(EL)
    #pragma location = 0x1CF2
    const u08_t EL;
    #pragma RETAIN(PF)
    #pragma location = 0x1C0A
    const u16_t PF[48];
    
    typedef void(*DriverFunction)(void);
    
    #define DRIVER_TABLE_START 				0xFFCE               	// starting address for driver table
    #define DRIVER_TABLE_KEY  				0xCECE               	// identifier indicating start and end of driver table
    #define USER_CUSTOM_COMMAND_ID       	0x00AA               	// user custom command, range from A0 - D0
    
    #define NUMBER_OF_DRIVER_FUNCTIONS 		1                     	// we only driver two functions here
    //------------------------------------------------------------------------------
    #define DRIVER_1_COMMAND (DRIVER_TABLE_START-2)  				// DIGITAL_SENSOR_DRIVER_ID, see below
    #define DRIVER_1_ADDR    (DRIVER_TABLE_START-4)
    
    //#define DRIVER_2_COMMAND (DRIVER_1_ADDR-2)                		// INIT_DIGITAL_SENSOR_DRIVER_ID, see below
    //#define DRIVER_2_ADDR    (DRIVER_1_ADDR-4)
    
    //#define DRIVER_3_COMMAND (DRIVER_2_ADDR-2)                		// INIT_DIGITAL_SENSOR_DRIVER_ID, see below
    //#define DRIVER_3_ADDR    (DRIVER_2_ADDR-4)
    
    #define DRIVER_TABLE_END  (DRIVER_TABLE_START-2-(NUMBER_OF_DRIVER_FUNCTIONS*4))
    
    #pragma RETAIN(START_KEY);
    #pragma location = DRIVER_TABLE_START
    const u16_t START_KEY = DRIVER_TABLE_KEY;
    
    
    //First ID, address pair
    //ID
    #pragma RETAIN(CustomCommandID);
    #pragma location = DRIVER_1_COMMAND														// the location of the command ID
    const u16_t  CustomCommandID = USER_CUSTOM_COMMAND_ID;              					// the function identifier
    
    // Function address
    #pragma RETAIN(CustomCommandAddress);
    #pragma location = DRIVER_1_ADDR														// the location of the address
    const DriverFunction CustomCommandAddress = (DriverFunction)&userCustomCommand;     	// the location the function is in
    
    ////Second ID, address pair?
    //#pragma RETAIN(Digital_Sensor_Driver_ID);
    //#pragma location = DRIVER_2_COMMAND
    //const u16_t  Digital_Sensor_Driver_ID = DIGITAL_SENSOR_DRIVER_ID;                    // the function identifier
    //
    //#pragma RETAIN(DigitalSensorMeasurementFunctionAddress);
    //#pragma location = DRIVER_2_ADDR
    //const DriverFunction DigitalSensorMeasurementFunctionAddress = (DriverFunction)&DigitalSensorMeasurement;   // the location the function is in
    
    
    //Third ID, address pair?  If so, update NUMBER_OF_DRIVER_FUNCTIONS to 3...
    #define BLOCK3	0xF874
    unsigned long *FRAM_write_ptr;
    
    //Ending key
    #pragma RETAIN(END_KEY);
    #pragma location = DRIVER_TABLE_END
    const u16_t END_KEY = DRIVER_TABLE_KEY;
    
    #define ADDRESS  0xF868
    u32_t * unit = (u32_t *) ADDRESS;
    u32_t i = 0;
    
    
    
    void main()
    {
        WDTCTL = WDTPW | WDTSSEL_1 | WDTCNTCL | WDTTMSEL | WDTIS_3;                   // Stop watchdog
        SFRIE1 = WDTIE;
        // ROM RF13M module setup ** The following three lines are needed for proper RF stack operation
        DS = 1; 									// ROM variable needs to be initialized here
        asm ( " CALL #0x5CDA "); 					// Call ROM function ( Initialize function pointers)
        asm ( " CALL #0x5CAC "); 					// Call ROM function ( Check part configuration)
    
    
    	initISO15693(CLEAR_BLOCK_LOCKS);
    	DeviceInit();
    	while(1)
    	{
    		__bis_SR_register(LPM3_bits + GIE); // sampling here two channels, SD14_ADC will wake up twice and store the conversions
    	}
    }
    
    /*  SetupSD14                                                                    						*
     *  The channel to be sampled (thermistor or reference resistor)                  						*
     *  Function:  This function is setup for sampling either a thermistor or a reference resistor         	*/
    
    /**************************************************************************************************************************************************
    *  DeviceInit
    ***************************************************************************************************************************************************
    *
    * Brief : Initialize the clock system and other settings
    *         Patchable function
    *
    * Param[in] :   parameters:  has these independent options
    *                            INITIALIZE_DEVICE_CLOCK_SYSTEM - initializes the clock system
    *                            POPULATE_INTERRUPT_VECTOR_IN_INITIALIZATION - populate the default interrupt vectors and recalculate their CRC
    *
    * Param[out]:  None
    *
    * Return  None
    *
    * Patchable :   Yes
    **************************************************************************************************************************************************/
    void DeviceInit(void)
    {
    	P1SEL0 = 0xF0; //keep JTAG
    	P1SEL1 = 0xF0; //keep JTAG
        P1DIR &= ~0xEF;
        P1REN = 0;
    
        CCSCTL0 = CCSKEY;                        // Unlock CCS
    
        CCSCTL1 = 0;                             // do not half the clock speed
        CCSCTL4 = SELA_1 + SELM_0 + SELS_0;      // Select VLO for ACLK and select HFCLK/DCO for MCLK, and SMCLK
        CCSCTL5 = DIVA_3 + DIVM_1 + DIVS_5;      // Set the Dividers for ACLK (4), MCLK, and SMCLK to 1
        CCSCTL6 = XTOFF;                         // Turns of the crystal if it is not being used
        CCSCTL8 = ACLKREQEN + MCLKREQEN + SMCLKREQEN; //disable clocks if they are not being used
    
        CCSCTL0_H |= 0xFF;                       // Lock CCS
    
      return;
    }
    
    /**************************************************************************************************************************************************
    *  initISO15693
    ***************************************************************************************************************************************************
    *
    * Brief : Initializes the RF Stack
    *
    * Param[in] :   parameter - the configuration to setup the ISO15693 (option to clear the lock blocks)
    *
    * Param[out]:   None
    *
    * Return        None
    **************************************************************************************************************************************************/
    void initISO15693(u16_t parameters )
    {
    
      // enable interrupts  ** Do not change the following two lines, needed for proper RF stack operatoin
      RF13MCTL |= RF13MTXEN + RF13MRXEN + RF13MRFTOEN; 	// set up rx and tx functionality on RF13M module
      RF13MINT |= RF13MRXIE + RX13MRFTOIE;  			// enable interrupts on RX and on timeout and over and under flow checking
    
      if (parameters & CLEAR_BLOCK_LOCKS )
      {
        //initializeBlockLocks();   //inline function
        memset ((u08_t *) FRAM_LOCK_BLOCKS, 0xFF, FRAM_LOCK_BLOCK_AREA_SIZE);     //block is locked with a zero bit, clears FRAM and RAM lock blocks
      }
    }
    
    /**************************************************************************************************************************************************
    *  userCustomCommand
    ***************************************************************************************************************************************************
    *
    * Brief : This function is called by the RF stack whenever a custom command by its ID number is transmitted
    *
    * Param[in] :   None
    *
    * Param[out]:   None
    *
    * Return        None
    **************************************************************************************************************************************************/
    #define CRC_LENGTH_IN_BUFFER          2
    
    void userCustomCommand()
    {
    
    	u16_t test;
    
    	//use RF13MRXF to receive two bytes
    	//use RF13MRXF_L to receive one byte
    	//same for RF13MTXF, RF13MTXF_L
    	//Device has 32 byte in FIFO and 32 byte out FIFO, this includes the CRC bytes
    
    	test = RF13MRXF_L;  // pull one byte from the recieve FIFO
    
        if( RF13MFIFOFL_L == CRC_LENGTH_IN_BUFFER)         // if all bytes have been read out, the only thing left should be the CRC bytes, 2 of them
        {
        	RF13MTXF_L = 0;      // no error, send out
        	RF13MTXF_L = test;   // send out the received byte
    
        }
        else
        {
        	RF13MTXF_L = 0x1; 	// an error response
        }
    }
    
    //#pragma vector = RFPMM_VECTOR
    //__interrupt void RFPMM_ISR(void)
    //{
    //}
    //
    //#pragma vector = PORT1_VECTOR
    //__interrupt void PORT1_ISR(void)
    //{
    //}
    //
    //#pragma vector = SD_ADC_VECTOR
    //__interrupt void SD_ADC_ISR(void)
    //{
    //}
    //
    //#pragma vector = USCI_B0_VECTOR
    //__interrupt void USCI_B0_ISR(void)
    //{
    //}
    //#pragma CODE_SECTION(RF13M_ISR, ".fram_driver_code")  // comment this line for using ROM's RF13M ISR, uncomment next one, see .cmd file for details
    #pragma CODE_SECTION(RF13M_ISR, ".rf13m_rom_isr") 		// comment this line for creating a custom RF13M ISR that will exist in FRAM, bypassing ROM's, uncomment previous
    #pragma vector = RF13M_VECTOR
    __interrupt void RF13M_ISR(void)
    {
    	// Right now this vector is pointing to the ROMs firmware location that runs the RF stack. 
        // Entering code here will, without changing the CODE_SECTION lines
    	// above, will cause an error.
        // Changing the code section above will cause the ROM RF stack to be bypassed.  New handler will need to be created.
    }
    
    #pragma vector = WDT_VECTOR
    __interrupt void WDT_ISR(void)
    {
        i++;
        unit[0] = i;
    }
    //
    //#pragma vector = TIMER0_A1_VECTOR
    //__interrupt void TimerA1_ISR(void)
    //{
    //}
    //
    //#pragma vector = TIMER0_A0_VECTOR
    //__interrupt void TimerA0_ISR(void)
    //{
    //}
    //
    //#pragma vector = UNMI_VECTOR
    //__interrupt void UNMI_ISR(void)
    //{ 
    //}
    //
    //#pragma vector = SYSNMI_VECTOR
    //__interrupt void SysNMI_ISR(void)
    //{
    //}


    for this code, if use only NFC this work good (NFC in android see tag), but if use battary - NFC in android dont see tag


  • Several thoughts on if using a battery is not working:

    1. Make sure that SV7 has a jumper.

    2. For the battery to be used, make sure that switch S6 is set to "Battery".

    3. Please make sure that the battery is inserted in the correct orientation.  To make sure, if you have a DMM, measure the voltage between GND (SV10 pin 1) and to the SV7 jumper.

    4. Set S3 to "S" mode.

  • No, you don't understand my question.My code for board works good with battary, but with battary NFC in my phone don't get response from board. If i remove battery from board it works well.

  • So my previous response was assuming that using a battery in the RF430FRL152HEVM was not working for you.


    However when you say that the "board works good with battery" and " but with battery in NFC ... don't get response from board" what are the setups in each case (phone model, NFC reader, EVM used)?  This is a little bit unclear.  If you could go into more detail that would help.

  • Sorry for my bad english, but i try again. I use only RF430FRL152HEVM, code Which i post here, and mobil phone with NFC (asus padfone infinity). And my apk, if i use this board without battery - it work good (i can read FRAM blocks on RF430FRL152HEVM). But if i use board with battery i can't read FRAM blocks on RF430FRL152HEVM, because i don't have NFC response. The board works because the value in the block changes with time, but the phone is not answered NFS.

    Thanks.

  • Then I understood you correctly.

    Have you tried the four steps ?

    1. Make sure that SV7 has a jumper.

    2. For the battery to be used, make sure that switch S6 is set to "Battery".

    3. Please make sure that the battery is inserted in the correct orientation. To make sure, if you have a DMM, measure the voltage between GND (SV10 pin 1) and to the SV7 jumper.

    4. Set S3 to "S" mode.

    Please reply to what you measured for step 3.
  • Yes, i tried it.
    1. jumper sv7 - ok
    2. S6 set to battery
    3. 1.482 V
    4. S3 set to "S" mode

    Again, board works well! And the code is running! This means that everything is set up correctly. But I do not get a response from the NFС!

    Thanks.
  • Hello, help me please.
  • Can you get any RF responses from the a handset or a TRF7970AEVM when the battery is inserted?

    What kind of battery are you using?

    Please also verify that the battery is inserted in the correct orientation.

  • The battery is inserted in the correct orientation.

    I get RF responses from the a TRF7970AEVM when the battery is inserted.

    I DONT get RF responses from the a handset when the battery is inserted.!