For the SC18IS600, what SPI command is for a Random Read coomand, Is one wants to read data from EEPROM address, RBTYE command doesn't work becuase it is for reading the current address that is setup with WBYTE

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

For the SC18IS600, what SPI command is for a Random Read coomand, Is one wants to read data from EEPROM address, RBTYE command doesn't work becuase it is for reading the current address that is setup with WBYTE

2,971 Views
tomchin
Contributor II

I'm trying to read an EEPROM with the SC18IS600 device.

It was suggest by NXP support to append an additional byte that represent the EEPROM address to a regular BYTE command to perform this.

When I send the following SPI MOSI to the SC18IS600 for a RByte command

 

SPI-MOSI output

     RByteCMD - NByte - I2CAddr - EEPROM_addr

     0x01 -            0x01 -   0xA1 -       0x01

 

The SC18IS600, SDA output is as follow:

Start-bit  10100001  Ack  111111111  Stop-bit

 

The second SDA return byte from SC18IS600 is all High, which is not what I wrote into EEPROM Address 0x01.

The SDA stream never contains the EEPROM address 0x01.

 

What I noticed is that the SDA output the first Byte with a value = 0xA1 therefore this is the I2C protocol for a Current Address Read command and not a Random Address Read command. The SC18IS600 need to output a 0xA0 instead and I don't believe a command 0x01 would generate that.

 

The RByte command 0x01 doesn't work for this, please let us know what is the correct command sequence for a Random Address Read command.

 

The correct SDA sequence should be

Start-bit I2C_Addr R/W=0 ACK   Byte_Addr ACK  Start-bit I2C_Addr R/W=1 Data_out NACK

11 Replies

2,279 Views
tomchin
Contributor II

Reading is fine but a random read I believed NXP doesn't support.

Currently a write is required to setup the address for a read but going to a random read address first is not supported.

Please confirmed

0 Kudos

2,279 Views
yuchih_wang
Contributor I

Hi Tom,

Are you able to solve this issue?  We have the same problem trying to read a register from a I2C device.  What we would like to see on th SDA bus is Start command, I2C address, register address, read data, Stop command.  We are having problem putting the register address on the I2C bus.

Can anyone shed some lught on how the read is done?

Thanks,

0 Kudos

2,279 Views
sureshkurukundi
Contributor III

Hi,

I am trying to write and read the internal registers of the SPI_I2C bridge (SC18IS600) by referring the commands given in the datasheet. But when I send the commands for writing the data byte in a particular internal register and then read the same register, I am just getting the data which has been sent over the MOSI pin shifted by 1 byte on the MISO pin. I have attached the screenshots of both write and read commands tested using logic analyser.Can you please help me regarding this issue and let me know if any other ways are there for reading or writing the internal registers.(I have also verified all the connections according to the datasheet of the MPC uC and SPI_I2c bridge and also with the configurations). Let me know if any initial configurations are to be done for writing and reading to the registers.SPI_I2C_SC18IS600_write.PNGSPI_I2C_SC18IS600_read.PNG

0 Kudos

2,279 Views
mikailaltintas
Contributor III

İs this issue solved. I have same problem and it is not solved when I change Tspiclkw value. 

2,279 Views
tedfedora
Contributor I

I was having the exact same problem.  Thanks to Michael Thompson for leading me to the first issue which was the minimum of 8 uS (Tspiclkw) between each byte.  But things were still not working for me but again thanks to Michael Thompson I read some of the other specs.  Namely the CS high timing between each SPI transaction.  That seemed to be the missing piece for me as I am now able to read the Internal Register Values:

Here I am reading I2STAT and I2CTO which appear to give the correct values.

pastedImage_1.png

2,279 Views
mikailaltintas
Contributor III

Thank you Ted. I solve this problem. I see that data pin timings is important. It must be stay state of last send bit at least 2 clk time. Other ways IC can't dedect it. 

0 Kudos

2,279 Views
MikeThompson
Contributor II

I'm running into the exact same situation with reading/writing the SC18IS600 as described by Suresh Kurukandi above.  Whatever I write to the SC18IS600 over the SPI bus is echoed one byte later.  I presume there is something simple that is being missed with how to read/write this device, but I can't find any hints as to what is wrong in the datasheet.  Any help on this issue would be appreciated.

Thanks,

Mike

0 Kudos

2,279 Views
MikeThompson
Contributor II

For other people who may run into this issue, I opened a support case with NXP and they were able to resolve it.  The root cause was not honoring the unusual timing between SPI bytes required by the SC18IS600.  As indicated in table 15 on page 20 of the datasheet, the clock must be held high for at least a minimum of 8 uS (Tspiclkw) between each byte being transferred over the SPI bus.  In my case, I was using DMA transfer of data over the SPI bus and each byte was back-to-back with essentially zero timing between the bytes which led to the situation where the bytes were just being echoed back.  Honoring the timing as specified in the datasheet resolved the issue.

2,279 Views
darioarias
NXP Employee
NXP Employee

Hi Tom,

Have you tried the I2C-bus read after write? This is command 0x02 and this one allows you to write the slave address and the specific EEPROM address and then it will issue a repeated start condition to read the content from that address.

This is the format to perform this command

pastedImage_1.png

SPI-MOSI output should look like this

     RByteCMD - NWByte - NRByte- I2CAddr - EEPROM_addr - I2CAddr

     0x02 -             0x01 -         0x01       0xA0 -       0x01                  -  0xA1

The correct SDA sequence should be

Start-bit I2C_Addr R/W=0 ACK   Byte_Addr ACK  Repeated-Start-bit I2C_Addr R/W=1 Data_out NACK

  

Regards,

Darío

0 Kudos

2,279 Views
tomchin
Contributor II

Dario,

We do not want to confirm what is written with the command 0x02.

We want to random read the EEPROM.

The EEPROM is already fill from previous data at some early period.

In normal operation, the user need to read status data in the EEPROM and not write to it at the moment.

If we have to write to it first then we are over writing important data that we do not wish to perform.

Best Regard,

Tom

0 Kudos

2,279 Views
kate1
Contributor I

You can still use the read-after-write command for random reads. I have an SC18IS600 with an I/O expander attached and have read the registers by using it as Dario suggested, without writing to the register first. 

I realise this is a few years late but it may help others as it helped me :smileyhappy:

0 Kudos