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.

Trouble sending data to TRF7960 using SPI Bus

Other Parts Discussed in Thread: TRF7960, TRF7960A, TRF7962A, TRF7961, TRF7963A, MSP430G2513, TRF7970A

Hi there,

I'm having an issue concerning write operation from a Microchip PIC18f microcontroller to the TI TRF7960 RFID reader over SPI. The problem is that writing to the TRF7960 only works when I put a small capacity like 10...15pf on the MOSi line (probe of my scope works as well, this way I stumbled over it in the first place...). On the scope the signals (chip select, clock, MOSI) always look the same, no matter whether the extra capacity is connencted or not connected. Without the capacity the RFID reader seems to be deaf to what ever I'm throwing at him. With the extra capacity connected to MOSI everthing works fine. You could think there a flaw in my hard or softwaredesign but my signals look exactly as described in the datasheet.  I discussed the issue on microcontroller.net and I got an answer from another engineer who had the same problem a couple of years ago. He told me he forwarded this to TI support. The reason for this behaviour was most likely a soldering problem (according to the TI support guys) and somehow they fixed it by playing around with the soldering profile. Anyway, does anybody know this and is there an applicable solution?


Thanks Guys

Regards, Kristian

  • Hey Kristian,

    I have never heard of this being an issue.  

    Maybe you have setup the wrong clock polarity?  If you're changing the data on the latching edge, the cap could delay it enough for the TRF79xx to be interrupted differently.  Data should transition on the falling edge during writing (and switch polarity, for reading).  

        


     If this doesn't seem to be the issue, then can you provide a capture of the SPI communication?  Using an LSA is preferable.

    Thanks,

    JD 

  • Hi,
    My problem is similar to yours. The TRF7960 is working with a MSP430 on SPI bus for my application. The SPI works well only if connect a 10 pF capacity on SCLK. I haven't found the solution yet.
    Regards, Bruno
  • what speed are you running the SPI clock at? how long is your trace? is it near something noisy (i.e. power supply line or any of the RF?) i have seen some customers who had layout issues like this in the past or using noisy MCUs (non-TI ones)
  • The MSP works at 8 Mhz, ans the SPI also and my trace is 35 mm long.
    No, there is nothing noisy near.
    But i think the software provided by TI does not work properly in serial interface (SPI mode) : sloc136
    Indeed, the software uses the SPI communication during interruptions !
    So If not using the SPI to the maximum frequency (8 Mhz), interrupts are too long, and the product don't work correctly.
    Is anybody using the SPI mode with the TI software (sloc136) ?
    Best regards
  • Hi John,

    I know it sounds suspiciously like a polarity issue but it isn't. I attach some pictures. The first picture shows the communication with 17pf capacitor between MOSI and GND, the second without the capacitor. Both pictures look the same. In the first pic the communication works, in the second picture it fails. The command I'm sendig simply tunrs on the transmitter.

    First byte 0x00 --> single write to the Chip Status Control Register (0x00)

    second byte 0x20 --> Transmitter on, receivers on

    By the way: if I connect a cap on both lines (MOSI AND CLK) then it stops working. I tried this with my scope probes:

    1 probe on MOSI, 0 on CLK --> fine

    1 probe on MOSI, 1 on CLK --> fails

    2 probes on MOSI, 1 on CLK --> fine

    I didn't try more cause I'm running out of probes...

  • @Bruno - for the TRF7960, there are two newer code projects on the product page (sloc149 and sloc203), and on the TRF7960A product page there is sloc251
  • oops, I just saw that I'm using the TRF7962A, not the 7960 as claimed in the title of this thread. Hope it doesn't make much of a difference as far as SPI is concerned....

    My MCU is running at 16mHz, SPI clock should be something around 250khz (CPU_CLK / 64). My design is a little bit sloppy since it's only a prototype but lines are short (10cm). By the way, if I run the SPI Clock higher than 1Mhz than it doesnt work either

  • the TRF7962A SPI is same as TRF7960, TRF7960A, TRF7961, and the TRF7963A.
    TRF7962A is just supporting the one HF RFID / NFC Type 5 protocol (ISO15693)
  • also, 10cm (~4in) is pretty long...that SPI frequency should be OK, but if you are running MCU @ 16MHz, then you don't care so much about low power, so the example can run @ 2MHz. should be OK, just stay away from 424kHz or 484kHz since that is the subcarrier freq of the tag response.
  • Hey Kristian,

    This may just be a noise problem. The cap is clearly helping to reduce the noise seen on the signals.

    What is your VDD_I/O connection tied to? Is there any noise on that?

    Thanks,
    JD
  • Hi,

    I thought the two components TRF760 and TRF7960A were hardware and software compatible : 

    Rather, t thought we  could replace a TRF7960 by TRF7960A: who can do more can do less.

    Is it true ?

    Best regards

  • Hi John, it looks noisy 'cause the ground connection of my probes was poorly done. I fixed this and it looks better now. And as I mentioned if I put a cap on both lines (MOSI and CLK) it doesn't work anymore. Do I remove the cap on clk it works again. It's always the same, as long as the capacitor on MOSI is 10...20pF bigger than on CLK it works 100% reliable, if they are equal or the cap on CLK is bigger than on MOSI it doesn't work anymore.

    We have to completely different designs using an TRF7962A and both show exactly the same behaviour.

    VDD_I/O looks good. I see a 30mVpp noise level on the scope but that shouldn't cause any trouble

  • Bruno - 

    yes - the TRF7960 and the TRF7960A are same, internal improvements are outlined here (link below) when going from -60 to -60A

  • I found out when put a series resistor (I tried 15 and 47 Ohm) instead of a parallel capacitor on the data line (MOSI) it works as well. That suggests that I may have some sort of ringing on my data line but if I do the same on the clock line communication fails again. Bottom line, whatever I do to the data line that makes it work(Cap, Resistor) I must not do on the CLK line because then it will fail again. Very confusing, I'm running out of explanations :(
  • Hi John,

    My product has a function to detect any badge 13.56 Mhz, to make it 4 successively scans the following protocols:

    - ISO15693

    - ISO14443A

    - ISO14443B

    - Tag-it

    I use a MSP430G2513 : 16 Kflash, 512 Octets RAM

    Page 11 of the datasheet TRF7960A indicates that a minimum of 1kB RAM is necessary , what is your opinion?

    Best Regards

    Bruno

  • Hi Bruno,

    It is possible to implement all of those modes with 512 bytes of RAM. It is only the specific firmware referenced in that datasheet which requires more.

    I have been developing a code example on the G2553 (also 16kB Flash/512 byte RAM) which handles reading ISO14443A, ISO14443B, ISO15693, and FeliCa tags. It also does anti-collision for ISO14443A/ISO15693 (working on the others still), so I can say with certainly that you can do so.

    Also TI Tag-It tags are ISO15693 tags, not sure why that would be a separate protocol?

  • Tag-It HF-I is ISO15693, Tag-It is TI proprietary (before we made ISO15693 standard) that is not produced anymore.
    You mean Tag-It HF-I, correct?
  • Ralph,

    Clarification on Tag-it vs. Tag-it HF-I.  Tag-it was a proprietary standard that we had before ISO 15693 was released.  Once ISO 15693 was developed, we created the Tag-it HF-I products, which are ISO 15693 compliant.  Tag-it(proprietary protocol) have been obsolete for many years now and would only be found in legacy systems.

  • Hi Ralph,
    I use the software sloc136 first, and sloc251 now.
    Do you think these software work with 512 Octets of RAM ?
    Is the software you develop on MSP430G2513 available ?

    Best regards
  • Hi Bruno,

    We have not released that software yet, it is still in development. But I can share what I have currently 'as is' so you have a good starting point. Just note that since we are still developing it, there could be bugs/issues that haven't been identified yet. :)

    TRF7970ABP_RFID_Reader_Demo.zip

    Also, this software is for the G2553, but porting it to the G2513 should be simple.

  • Hi Ralph,

    Could you tell me what electronic card (which schematic) this software is associated ?

    Best regards

    Bruno

  • Hi Ralph,
    Are the TRF7960 and TRF 7970 software compatible ?
    Rather, it is the software TRF7970ABP RFID READER Demo compatible with the TRF7960?
    Best regards,
    Bruno
  • Hi Bruno,

    For the most part yes the TRF7960 and TRF7970A are compatible, but there are two very key differences you will need to address:

    1) The FIFO of the TRF7960 is only 12 bytes. In the firmware I provided, I am assuming a much larger FIFO. so I am not handling having the send and receive larger packets in clumps of 12 at a time. You will need to use the FIFO watermark indicator on the IRQ status, this is Bit 5 of Register 0x0C, to monitor when the FIFO is almost full or empty and begin to read or write data from it to ensure continuous sending and receiving. More details can be found in Section 5.6 of the TRF7960 datasheet.

    2) The clock polarity between sends and receives are different. This is described in detail on Page 42 of the TRF7960 datasheet. The functionality to handle this exists in the old 7960 software, but has been since removed for the 7970A version. You could look at the older firmware and try and implement it in the similar manner with the new code base.

    One other minor edit is in the TRF7970 driver file, trf7970.c, on line 167 there is a write single to register 0x18. This is done per TRF7970A errata and does not need to occur for the TRF7960 so I would advise removing that.

    Everything else should function the same between the parts.

  • Hello Ralph,

    Could you tell me whether it is mandatory to weld the PAD (Pin 33) of TRF7960A?
    Is the PAD used only for  heat dissipation ?

    Or is it important to weld the PAD for proper operation of the radio (RF) ?

    Best regards,

    Bruno

  • Hi Bruno,

    The part can function without the power pad soldered to ground.  In a production environment, it should be soldered to ground for heat dissipation.  You should be able to operate the chip withouot it soldered, but I do not recommend running with the RF field active for too long.  For testing, it should work though.

  • Bruno -
    just to add to Eddie's comment with some documentation - this is covered in section 7.3 (page 77) of the data sheet
    www.ti.com/.../trf7970a.pdf
  • Hello, just noticed your question and since others may benefit..

    The TRF796x series do not operate correctly if the data changes during the active half of the clock cycle.
    So if the data is clocked in by the positive edge; this data must be stable during the time that the clock is high.
    At regular SPI communication the data changes at the negative going edge of the clock; a few nsec delay in the clock line can cause that data to change while the TRF796x still sees a high clock... oeps...problems...

    The capacitor provides some delay in the change of the data, thus ensuring that a data change occurs AFTER the negative edge of the clock line has occurred. A better solution is to delay the MOSI data, in respect to the CLK, e.g. by putting an extra gate or two in series.

    It seems that the SPI interface does not actually latch the data on the clock edge but that the clock operates as a latch enable.
    But whatever the reason, delaying the MOSI data and thus ensuring that any data change is in the low period of the clock provides the solution.

    Enjoy...

    Brody