cancel
Showing results for 
Search instead for 
Did you mean: 

ST25DV64KC i2c returns NoAck always

Alex_B
Associate II

Hello

I'm trying to setup i2c communication from our microcontroller atxmega128a1u to the st25dv64kc.
I've been trying to set it up via a twi interface of the microcontroller and no matter what command I send to the s25dv I always get a NoAcK response.
There is no device in the RF field.
What could be the cause of this and how could it be fixed?
Thanks,
Alex

1 ACCEPTED SOLUTION

Accepted Solutions
Rene Lenerve
ST Employee

Hi Alex_B,

I see now what causes this behavior from the ST25DVKC, this is due to the timeout in I²C communication when the SCL clock pulse width Low or High exceeds 25 ms, I²C logic is reset. This is specified in the DataSheet (section 6.2.2 I²C timeout on clock period).

If you find what is causing these delays between frames and fix them you should be able to communicate correctly with the tag.

Hope this can help you.

Kind Regards.

View solution in original post

19 REPLIES 19
Rene Lenerve
ST Employee

Hi @Alex_B,

With no more information about your set-up it's hard to first determine what could be wrong.

The first things to be sure of are:

- VCC must be present on the ST25DV.

- Pull-up resistors correctly calculated (and soldered too).

What package of the ST25DV is it?

Is a device address command answered a NACK too?

Hope this can help you.

Kind Regards.

>>What could be the cause of this and how could it be fixed?

Got the address wrong.

Make sure you have the left/right alignment of the 7-bit address suitable for your platform. Say 0xA6 vs 0x53

Show some code, show the waveforms and failure on the bus via a logic analyzer.

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..

Hi Rene
Vcc is present and connected to the main Vcc of the board.
I'll look into if there are pull-up resistors on the i2c lines, but even if there are not I've set the GPIO port on the microcontroller for pull-up on input and they are init to high in the beggining.
The package is the SO8N package.
And yes even for the device address command (0xA6 for example) the return is a NoAck
Thanks.

Rene Lenerve
ST Employee

Hi @Alex_B ,

Generally the internal pull-up resistor value of MCU are too high for use on I²C bus, that is also specified in the User Manual : "The only external hardware needed to implement the bus is one pull-up resistor on each bus line." (for TWI).

if I'm not wrong, internal pull-up for your MCU are around 25kΩ which is not correct for the bus.

You need to compute the Pull-up resistors for your system and solder them to probably fix it (depends on IOs voltage, I²C bus speed, Maximum capacitive load for bus line).

Kind regards.

Yes, look to be 25K on the MCU pins, at Philips we suggested 2K7 as I recall, some of the more aggressive Arduinos have 1K5

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Rene Lenerve
ST Employee

Yes it depends on characteristics from his system.

Let assume with these values:

Vcc (bus) = 3.3V

Cb = 200pF

We can determine these Rp (pull-up resistor, per line).

Standard 100 kb/s => Rp max 5k

Fast Mode 400 kb/s => Rp max 3k

Fast mode plus 1 Mb/s (max for ST25DV) => Rp max 1k5

There is some online calculator available on the web if needed.

Hi Rene
As it turns out I was working with the wrong schematics of our board.
The package is actually the 12pins one and there are pull-up resistors as shown in the pic below.

 

 

Alex_B_0-1699449453296.png

Code for reading the UID of the st25dv

	status_code_t master_status = STATUS_OK;
	uint8_t reg[2] = {0x00,0x18};
	uint8_t uid[8] = {0};
	uint8_t bytesToRead = 8;
	uint8_t deviceAddress = 0x57;
		
	twi_package_t package = {
		.addr[0] = reg[0],  //MSB
		.addr[1] = reg[1],  //LSB
		.addr_length = 2,
		// issue to slave
		.chip        = deviceAddress,
		.buffer      = (void *)(uid),
		.length      = bytesToRead,
		// Wait if bus is busy
		.no_wait     = false
	};
	
	master_status = twi_master_read(&TWID, &package);

 

After sending the device address 0xAE (0x57 << 1) for writing the uid register address I get a NoAck and the connection is terminated
Thanks

 

 

Hi Alex_B,

Can you confirm that LPD pin (1, input) is forced low? Otherwise ST25DV will be set in Low power mode.

GPO (11) is an output and can be connected to an input on your MCU (used as interrupt), can you confirm it is the case?

For pull-up resistors if you set your I²C to Standard mode (100 kb/s), it should work. 

For higher speed, change your Pull-up resistors as indicated in the previous messages, but be sure to respect the MCU I2C timing configuration (as tHD;DAT, tSU;DAT, ...).

Kind Regards.

Hi Rene
Yes the LPD pin is forced low and the GPO is connected to an input (interrupt) and after configuring the GPO via the android app over RF I get interrupts from the ST25DV, and yet I can't get to established i2c connection.