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.

Using the TRF7970ABP Demo Code on a different microcontroller

Other Parts Discussed in Thread: MSP430G2553, MSP430F2416, TRF7970A

I am currently having trouble porting working example code from the msp430g2553 to the new micro msp430f2416.

I thought it would be as easy as switching the GPIO pins and the SPI pins, but for some reason after switching all the pins. The code doesn't work the same. Instead what happens is the trf7970 is not detecting any tags and the trf7970 interrupt is always giving the no response message.

I was wondering what could be other possible changes needed for the example code to work on the new micro.

  • Hey Kim,

    Sounds like you may have already, but can you confirm that the SPI is working correctly?  Can you read a register that you just wrote, and get the correct value back?  

    Kim Liu said:

     the trf7970 interrupt is always giving the no response message.

    You mean the TRF7970 IRQ Status register is always returning a 0x01?  Are you ever getting the 0x80 (EOTX) IRQ after you transmit?  

    Thanks,

    JD

  • I'm not sure if I checked correctly, but here was the code I used to check:

    u08_t testbuff[10];
    int i;
    testbuff[0] = 0x03;                //register 3
    testbuff[1] = 0x03;               

    testbuff[2] = 0x41;               //write asci = A

    for(i=3;i<11;i++)
    {
    testbuff[i] = 0x46;                //asci = F
    }

    SpiWriteSingle(&testbuff[1],2);
    SpiReadSingle(&testbuff[0],1); //hopefully get an A back in testbuff[0]


    testbuff[1] is returning an A like planned so to my knowledge the spi is working correctly.

    Yea the irq_status is always returning an 0x01. In the function Trf7970ISR it never goes into the other options except for

    1) no response interrupt

    2) unsupported IRQ

    The only thing I changed besides the pins is that I defined TRF7970A to be 1 since I realized it wasn't executing some of the initialization code and therefore was getting stuck in an infinite loop waiting for the USCI_B0 TX buffer to get ready.

  • Hey Kim Liu,

    You check of the SPI look fine, so I think that's okay, but you definitely have something funky going on.  

    Kim Liu said:

    Yea the irq_status is always returning an 0x01. In the function Trf7970ISR it never goes into the other options except for

    1) no response interrupt

    2) unsupported IRQ

    Ideally, you should never get into the "Unsupported IRQ" case since this is just a catch all for unexpected functionality.  

    Do you have access to a Logic State Analyzer (LSA)?  It would help narrow down the issue much quicker if so.  

    Do you know what kind of tag are you testing with?  in main.c we can comment out all the other technologies for now, to help simplify the code somewhat.  

    Thanks,

    JD

     

  • I only have access to o-scopes. Logic State Analyzers might take longer to get access too. 

    I am testing with the Tag-i HF-1 Plus Transpoders Inlays Large Rectangle (RI-I02-112A-03). These tags worked perfectly when I move it back to the g2553 launchpad. I don't define ENABLE 14443A or ENABLE 14443B so the other technologies shouldn't being called.

    The only pins that I actually changed from the g2553 to the msp430f2416 are the pins for the SPI and the UART. The rest I kept at the original pin assignments.

    Pins Changed:

    • SPI DataCLK
    • SPI MISO
    • SPI MOSI
    • UART RX
    • UART TX

    Pins Unaltered:

    • IRQ from the TRF7970A
    • Slave Select
    • TRF7970A Enable
    • ISO15693 LED (the only type of tag I am trying to locate)
    • XIN
    • XOUT
    • RST

    I don't actually connect TEST because I'm no exactly sure where to connect that to the micro. And I leave the rest unconnected.

    Also I keep the IRQ SEL jumper in the same position as the working g2553, I was wondering if this could be an issue.

    Thanks for the help so far!

  • Hey Kim,

    If you only changed the SPI pins and ported the code, then it should obviously work.  We know the Booster Pack works, so the problem has to be on the F2416 side (probably software).  

    Can you check if the RF field is coming on?  You can probe the caps leading to the antenna and look for a sine wave.  If the field is coming on, then the SPI communication is probably okay, and the issue is the connection/timing elsewhere.  

    If you want to throw your code up, I can take a quick look at it.  I don't have anyway to test it exactly though.  

    Thanks,

    JD