Skip to main content
Visitor II
October 15, 2020
Solved

I2C Sequence to get tag detection working using amplitude measurement

  • October 15, 2020
  • 5 replies
  • 1357 views

Hi,

We are using the ST25R3916 on a custom board.

I'm trying to get the wake up mode working using amplitude measurement.

AN5320 shows the sequence to get this working.

I can measure the amplitude and everything seems to work, but when I enable the wake up mode no interrupt gets fired every 800ms.

Let me explain how I do it:

First perform C1 direct command to stop everything.

Then I write to registers 00 and 01 my hardware configuration (3V3 etc)

Next enable oscillator by writing 0x80 to register 02

Wait for interrupt and read register 16

Then direct command D3 for amplitude measurement

Wait for interrupt and read register 16

Read the ADC output register 25 (in my case 0x8A)

Write this value (0x8A) to register 34 (reference amplitude)

Next register 33 with the value 0x10 -> delta AM = 1

Next i setup register 32 with the value 0x7C (800ms and IRQ everytime + enable wam)

Last step set register 02 to value 0x04 -> osc of and Wakup on

After this I never get an interrupt (which should happen every 800ms?)

What am I missing? Will be something obvious probably...

Marvin

    This topic has been closed for replies.
    Best answer by Ulysses HERNIOSUS

    Hi Marvin,

    sorry, was mixing up the mask and interrupt status. I was rather referring to enabling the interrupts in 18h register by clearing bits M_wam and M_wt.

    Setting a mask bit to 1 means disabling the interrupt source - it will not generate a reaction on INT line. However status bit will have the information until read.

    Regards, Ulysses

    5 replies

    Technical Moderator
    October 15, 2020

    Hi Marvin,

    from first glimpse I would suspect that you maybe didn't enable I_wt and I_wam in register 1C thus not producing a signal on INT pin.

    Regards, Ulysses

    MDinnAuthor
    Visitor II
    October 16, 2020

    Hi Ulysses,

    Great idea! From the datasheet it seems that 1C is a read only register probably to check which interrupt got fired?

    Something I don't really get it that the application note speaks of enabling the M_wam mask in reg 18h. Does that not mean it will disable the interrupt?

    Does masking mean that the interrupt will not get fired?

    Thanks!

    Marvin

    Technical Moderator
    October 16, 2020

    Hi Marvin,

    sorry, was mixing up the mask and interrupt status. I was rather referring to enabling the interrupts in 18h register by clearing bits M_wam and M_wt.

    Setting a mask bit to 1 means disabling the interrupt source - it will not generate a reaction on INT line. However status bit will have the information until read.

    Regards, Ulysses

    MDinnAuthor
    Visitor II
    October 16, 2020

    Hi Ulysses,

    Thanks that clears it up! Both mask registers (16 and 18) are of value 00 so all interrupt should work.

    Still not getting any interrupts when doing the last step:

    set register 02 to value 0x04 -> osc of and Wakup on.

    Marvin

    MDinnAuthor
    Visitor II
    October 16, 2020

    Got it working, for some reason the D3 interrupt needs to be read twice to clear the interrupt line. First time it's oscillator value in main interrupt (1A) register, second time direct command interrupt in Timer and NFC interrupt register (1B).

    When read twice then the wake up routine with amplitude works.