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.

TRF7970A: How to disable the NFC and then re-enable it, and still cooperate with the existing state machine?

Part Number: TRF7970A
Other Parts Discussed in Thread: MSP-EXP430F5529LP,

I'm using the TRF7970A DLP (v4.7) with a MSP-EXP430F5529LP DevKit, and I'm running the "F5529LP_TRF7970A_ALL_NFC_MODES" example.  I would like to disable the NFC operation for short stints to reduce power consumption until an event occurs, and then start the NFC back up.  I've been looking at the example code for a while, so I'm pretty familiar with the state machines, but I cannot for the life of me figure out how to get an "NFC_DISABLED" state return from the "NFC_run()" function in nfc_controller.c.  Any idea on what the sequence would be to re-enable the NFC after calling "NFC_disable()"?  Also, where would I need to put all of this so it plays nicely with the existing state machines?  I'm presently calling "NFC_disable()" from t5t_app.c.

  • Our specialists for the TRF7970A will come back to you on this question next week .

    Best regards,

    Uli 

  • I got it working, but probably not in the ideal manner.  Still, it does everything I need it to.  If somebody needed to use the USB interface to interact with the PC app then this solution would not work as it disables the printf calls and ignores USB traffic.

    t5t_app.c->T5T_stateMachine():

    Added T5T_DISABLED state, which calls "NFC_disable()", then "__disabled_interrupt()", waits in a while loop for a button press, then calls "__enable_interrupt()"

    nfc_controller.c:

    Added boolean variable called "NFC_is_disabled", and assigns it to false in NFC_init().

    nfc_controller.c->NFC_disable():

    Assign "NFC_is_disabled" to true.

    nfc_controller.c->NFC_run():

    When assigning the "sReturnNfcState", added an else if(NFC_is_disabled), assigned sReturnNfcState=NFC_DISABLED, and called NFC_init().

    main.c->main():

    Commented out "Serial_init()" to disable USB traffic, and if the returned state from NFC_run() is NFC_DISABLED I call "NFC_configuration()".

    mcu.c:
    Return immediately from any printf function calls to eliminate the possible USB traffic which was causing the state machine to lock up, probably because I disable interrupts and it's expecting returned data which is missed during that disabled period.  I didn't feel like tracking down why after I figured out how to get around it.

  • A week is a long time to wait for a solution, but it is what it is I guess.

    Goal:

    Start out with all NFC RF activity disabled, with minimum power consumption.  Upon pressing a button begin RF activity.  Once RF transactions are completed I would then like to disable the NFC RF activity again and wait for another button press.  I feel like this would best be done in the nfc_initiator.c file, but I was really hoping I wouldn't need to understand that state machine.  I'll probably have this all done within the next couple of days.  However, even if I get it working on my end for my needs, the specialist will hopefully have a more elegant solution for the long run.

  • Hi Barnesy,

    sorry for the late answer but due to vacation time....

    I have checked the code and the subroutine NFC_disable(void) was never used in the code. Instead the disable subroutines for the different modes (R/W , P2P, CE) are used . For example the NFC_RW_disable(void) is used in main.c line 990. The line above for the RW_START_CMD command will call 

    NFC_RW_configure(g_sRWSupportedModes,g_sRWSupportedBitrates);

    to reconfigure the RW mode.

    Is this what you are looking for?

    Best Regards,

    Helfried