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.

Question about Battery-less NFC Keyboard source code

Other Parts Discussed in Thread: RF430CL330H

hi,

from the source code of http://www.ti.com/tool/tidm-batterylessnfckeyboard?keyMatch=nfc keyboard&tisearch=Search-EN-Everything

i found there're some initiatial code that i can't understand what it means

in the function of void Init_CL330(void), i can't find the register 0x0202 and 0x2814 in datasheet, what does it mean?

 

 Write_Register(TEST_MODE_REG, TEST_MODE_KEY);   //unlock test mode
 Write_Register(CONTROL_REG, TEST430_ENABLE); //enable test mode, now have to use actual addresses
 Write_Register(0x0202, 0x0000);                 //clear POUT to set CS low
 Write_Register(0x2814, 0); //exit test mode (CONTROL_REG is at real address 0x2814)
 Write_Register(TEST_MODE_REG, 0);               //lock test reg

 

 

  • This block of code is actually directly accessing the internal memory of the RF430CL330H. This is not accessible over the standard I2C/SPI protocol (it is even not documented).
    Address 0x0202 is the GPIO peripheral and in this case it is setting the POUT register to 0.
    The control register in the datasheet is given the address 0xFFFE. However, internally, this register is located at address 0x2814 in RAM. The RF430CL330H translates this address internally.
    To access directly the internal memory this whole block (that you have supplied is needed). The area in red is where only internal addresses have to be used since translation is not longer being done.

    What this block is doing is correcting an issue that we had with the earlier versions of RF430CL330H. These corrections:

    Write_Register(TEST_MODE_REG, TEST_MODE_KEY); //unlock test mode
    Write_Register(CONTROL_REG, TEST430_ENABLE); //enable test mode, now have to use actual addresses
    Write_Register(0x0202, 0x0000); //clear POUT to set CS low
    Write_Register(0x2814, 0); //exit test mode (CONTROL_REG is at real address 0x2814)
    Write_Register(TEST_MODE_REG, 0); //lock test reg

    /****************************************************************************/
    /* Load Oscillator re-trim code into RAM and activate it */
    /****************************************************************************/
    Write_Continuous(0x800, func_retrim_osc, 14);
    Write_Register(TEST_FUNCTION_REG, 0x800); // Set pointer to function just loaded into RAM
    Write_Register(TEST_MODE_REG, TEST_MODE_KEY + BIT8); // Call test function
    Write_Register(TEST_MODE_REG, 0);

    are not needed in the current chips that we are producing (and have for some time). This firmware should work however.