2018-07-03 03:16 AM
Dear ST team,
I am working with the ST25DV chip (I use ST25DV_Discovery_Ant_C5 hardware conected to my processor with wires). VDCG is connected to VCC. LPD is High while the device is not active. I set LPD Low when a GPO nterrupt is triggered before communicating with the ST25DV. I want to get an interrupt when a message is posted into the mailbox.
If I only configure the GPO_CTRL_DYN register with RF_PUT_MSG_EN and GPO_EN bits to 1, I never get an interrupt if post a message into the mailbox while LPD is High. (of course, If I set LPD Low beforehand and never reset it, I get a GPO interrupt and I receive the message).
If I set all bits of GPO_CTRL_DYN to 1 with LPD High, then I get an RF_ACTIVITY interrupt at the time when the NFC Reader is near to the ST25DV, but I never get an interrupt when I post a message in the mailbox.
Many thanks
Thierry
#st25dv #gpo-interruptsSolved! Go to Solution.
2018-07-04 01:39 AM
Dear Thierry,
First of all, thank you for choosing the ST25DV.
There is two thing to consider in order to achieve your goal: GPO configuration and mailbox behavior..
First, about the GPO configuration.
ST25DV has a static configuration register for GPO called 'GPO' (see table 18 of the datasheet) and a dynamic register 'GPO_CTRL_Dyn' (see table 20 of the datasheet).
The static register GPO is the one that must be used to configure which interrupt you want to see on the GPO pin, and to enable/disable the output on the GPO pin at boot time (and after).
The dynamic register GPO_CTRL_Dyn allows ONLY to dynamically enable or disable the output on the GPO pin. Furthermore, only bit 7 of the GPO_CTRL_Dyn regsiter can be written, and only from I2C (there is mistake in table 20 of the datasheet, there is no write access from RF to this register, as stated in table 9). Bits 0-6 are read only from both I2C and RF, and are just a copy of the GPO register bits 0 to 6 values.
The GPO_CTRL_Dyn register is also a volatile register, on contrary to the GPO register. It means that its value is reset at each power off of the tag (means no VCC (or LPD high) and no RF field).
To summarize, if you want to configure GPO interrupts, you must used the GPO register. If during the time VCC is on and LPD is low (tag powered from VCC) the I2C host wants to temporary disable interrupts, the GPO_CTRL_Dyn regsiter can be used (set bit7 to 0).
Second, about the mailbox:
There is one important thing to understand about the mailbox: VCC power supply must be present for the mailbox to be accessible (this is shown in figure 11 of the datasheet).
If LPD is set high, then it means no power supply for the ST25DV, and thus mailbox disabled. In such case, the RF reader cannot read or write data inside the mailbox.
So the proper way of doing would be:
- Allowing the Fast Transfert Mode by setting MB_MODE=1 in the MB register.
- enable FIELD_CHANGE_EN and RF_PUT_MSG_EN interrupts in the GPO register (plus GPO_EN=1) => GPO=0x98
- set ST25DV in power down mode by setting LPD pin high and power VDCG pin..
- when the RF reader will provide RF field to the tag, the FIELD_CHANGE interrupt will be triggered and wake up the I2C host.
- I2C host should then tie LPD pin to low in order to power the ST25DV with VCC.
- RF reader can check if ST25DV is powered with VCC by polling the EH_CTRL_Dyn register before starting the write into the mailbox. Bit 3 VCC_ON will indicate if the ST25DV is powered with VCC.
- RF reader can then enable the mailbox with MB_CTRL_Dyn register bit 0 and start to write into the mailbox.
- The RF_PUT_MSG interrupt will be automatically triggered when the RF reader is done writing the message into the mailbox.
Hope this answers to your questions.
Best regards.
2018-07-04 01:39 AM
Dear Thierry,
First of all, thank you for choosing the ST25DV.
There is two thing to consider in order to achieve your goal: GPO configuration and mailbox behavior..
First, about the GPO configuration.
ST25DV has a static configuration register for GPO called 'GPO' (see table 18 of the datasheet) and a dynamic register 'GPO_CTRL_Dyn' (see table 20 of the datasheet).
The static register GPO is the one that must be used to configure which interrupt you want to see on the GPO pin, and to enable/disable the output on the GPO pin at boot time (and after).
The dynamic register GPO_CTRL_Dyn allows ONLY to dynamically enable or disable the output on the GPO pin. Furthermore, only bit 7 of the GPO_CTRL_Dyn regsiter can be written, and only from I2C (there is mistake in table 20 of the datasheet, there is no write access from RF to this register, as stated in table 9). Bits 0-6 are read only from both I2C and RF, and are just a copy of the GPO register bits 0 to 6 values.
The GPO_CTRL_Dyn register is also a volatile register, on contrary to the GPO register. It means that its value is reset at each power off of the tag (means no VCC (or LPD high) and no RF field).
To summarize, if you want to configure GPO interrupts, you must used the GPO register. If during the time VCC is on and LPD is low (tag powered from VCC) the I2C host wants to temporary disable interrupts, the GPO_CTRL_Dyn regsiter can be used (set bit7 to 0).
Second, about the mailbox:
There is one important thing to understand about the mailbox: VCC power supply must be present for the mailbox to be accessible (this is shown in figure 11 of the datasheet).
If LPD is set high, then it means no power supply for the ST25DV, and thus mailbox disabled. In such case, the RF reader cannot read or write data inside the mailbox.
So the proper way of doing would be:
- Allowing the Fast Transfert Mode by setting MB_MODE=1 in the MB register.
- enable FIELD_CHANGE_EN and RF_PUT_MSG_EN interrupts in the GPO register (plus GPO_EN=1) => GPO=0x98
- set ST25DV in power down mode by setting LPD pin high and power VDCG pin..
- when the RF reader will provide RF field to the tag, the FIELD_CHANGE interrupt will be triggered and wake up the I2C host.
- I2C host should then tie LPD pin to low in order to power the ST25DV with VCC.
- RF reader can check if ST25DV is powered with VCC by polling the EH_CTRL_Dyn register before starting the write into the mailbox. Bit 3 VCC_ON will indicate if the ST25DV is powered with VCC.
- RF reader can then enable the mailbox with MB_CTRL_Dyn register bit 0 and start to write into the mailbox.
- The RF_PUT_MSG interrupt will be automatically triggered when the RF reader is done writing the message into the mailbox.
Hope this answers to your questions.
Best regards.
2018-07-04 06:42 AM
Dear JL,
Many thanks. It's very clear.
Best Regards
Thierry