Page 1 of 1

I2C Read termination on a FRAM (FM24V02)

Posted: Thu Oct 02, 2014 5:47 am
by Rick Burnett
I am trying to use I2C to talk with a FRAM and I am trying to understand how I terminate a read operation with the I2C driver. In the datasheet for the FRAM it lists 4 ways to stop the FRAM from continuing to send data to the bus.

1. bus master issues NOACK on 9th clock cycle and STOP in the 10th clock cycle.
2. bus master issues NOACK on 9th clock cycle and start in the 10th clock cycle.
3. bus master issues STOP in the 9th clock cycle.
4. bus master issues START in the 9th clock cycle.

How exactly would I do this with the driver?

Re: I2C Read termination on a FRAM (FM24V02)

Posted: Thu Oct 02, 2014 8:17 am
by Giovanni
The driver should automatically give a NACK at the end of the transfer I think.

giovanni

Re: I2C Read termination on a FRAM (FM24V02)

Posted: Thu Oct 02, 2014 8:40 am
by Rick Burnett
Time to break out the probes. :) Okay, I kind of figured that was happening.

Re: I2C Read termination on a FRAM (FM24V02)

Posted: Thu Oct 02, 2014 8:53 am
by steved
I've successfully been accessing FRAM on both 32F0 and 32F4 using just the normal I2C commands. Main 'gotcha' for me has been a failure to set up the I/O pins properly in the first place.
I've attached one of the drivers I'm using - bit overcomplicated as an example, since it writes buffers including a checksum.

Re: I2C Read termination on a FRAM (FM24V02)

Posted: Thu Oct 02, 2014 10:28 am
by Rick Burnett
Discovered my code problem, it wasn't clear to me originally that the address of the I2C shouldn't contain the read/write bit. So, I was making it 8 bits and having 2 different addresses. Now that I fixed that, works perfect.

Re: I2C Read termination on a FRAM (FM24V02)

Posted: Thu Oct 02, 2014 10:31 am
by Rick Burnett
Yeah, the board.h file got me awhile ago when doing USART stuff since I started with the 429 discovery board. I should have just created my own version in my code tree, but for now since I am just doing a bringup of subsystems, I'm fixing that file for each system. I had to change it for the USART, USB and I2C stuff.

Slowly experiencing all the systems of the STM32F4 :)

Re: I2C Read termination on a FRAM (FM24V02)

Posted: Thu Oct 02, 2014 5:23 pm
by steved
Rick Burnett wrote:Discovered my code problem, it wasn't clear to me originally that the address of the I2C shouldn't contain the read/write bit. So, I was making it 8 bits and having 2 different addresses. Now that I fixed that, works perfect.

That's a favourite. Personally I prefer to quote the address as an 8-bit value including the R/W bit (set to zero) - gives a logical correspondence with the hardware level. Some software does it that way; other software does it the Chibi way, with a 7-bit value.

Re: I2C Read termination on a FRAM (FM24V02)

Posted: Wed Oct 08, 2014 9:08 am
by Rick Burnett
Yeah, I would probably have preferred using an 8-bit value since that is what made the most sense to me when trying to use it. I guess I just think in terms of general memory mapping hardware and such, I'd rather have complete control over the address name. But, now I know what it is so I can live with that. Haha.