SPI vs 1-wire EEPROM

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 
已解决

SPI vs 1-wire EEPROM

跳至解决方案
4,814 次查看
MMG135
Contributor I

Hi everyone,

 

I am looking for some suggestions regarding which is the easier EEPROM to use with an 8-bit Freescale MCU (MC9S08GT60). I have so far looked at two types of EEPROM. One of them uses an SPI interface and the other uses a 1-wire interface. Is it true that 1-wire interfaces for EEPROM are generally easier to implement than SPI interfaces? Does anyone have experience with writing code for 1-wire EEPROM or SPI EEPROM or could direct me to a link with some sample code for an 8-bit MCU (MC9S08GB60 or GT60 or other similar MCU's)? All comments/suggestions are welcome. Thanks.

 

Here are various types of EEPROM I have looked at so far. Please feel free to suggest any other EEPROM chips that you have found easy to use and that worked really well.

 

http://www.maxim-ic.com/datasheet/index.mvp/id/2915/t/do

 

http://www.maxim-ic.com/datasheet/index.mvp/id/5453/t/al

 

http://www.onsemi.com/PowerSolutions/product.do?id=CAT25320

标签 (1)
0 项奖励
回复
1 解答
3,136 次查看
bigmac
Specialist III

Hello,

 

I totally agree with Rocco's comparison of the three interface methods.

 

Furthermore, the one-wire devices would appear to be available only from a very limited number of sources, whereas the SPI and IIC devices are available from many sources, mostly with "common" part numbers and interface requirements.

 

The one-wire devices have critical timing intervals, and are very slow because of these fixed duration intervals.  This means that interrupts will likely need to be globally disabled for the duration of each critical interval.  Conversely, the SPI and IIC methods do not have critical timing because both data and clock signals are present within the interface, and hardware modules are mostly used.  Typical clock speeds are 100kHz for IIC, and 1 - 10 MHz for SPI.

 

The attached code for a SPI EEPROM has previously appeared within this forum.  It should be suitable for EEPROM devices that utilize 16-bits for their address, (rather than 8-bits for old devices with very small capacity).  The code could be easily adapted for very large devices with more than 16 bit address.

 

Regards,

Mac

 

在原帖中查看解决方案

0 项奖励
回复
3 回复数
3,136 次查看
rocco
Senior Contributor II

Hi MMG135,

 

I have used 1-wire, SPI and IIC, and I would avoid 1-wire for a serial EEProm. For temp-sensors and other things that go off-board, 1-wire is great. Look to Midon Designs for 1-wire devices and info.

 

The big advantage of 1-wire is that it takes . . . 1-wire. Outside of that, there is not much advantage. The Freescale MCUs have no direct hardware support for 1-wire, so you would need to bit-bang it. It will be slow and processor intensive. Whether or not it is easier to code depends on how much code you can scrape from other sources. I found SPI to be the easiest to code.

 

For a serial EEProm, I would look at either SPI or IIC (also called I2C), as the GT60 has hardware support for both. But I found the IIC interface on the GT60 to be poorly documented and "temperamental".

 

What size EEProm are you considering? I have used IIC EEproms as small as 1k-bit, and SPI EEProms as large as 32 megabit. As the size increases, the selection starts to favor SPI, as SPI can transfer faster than IIC.

0 项奖励
回复
3,137 次查看
bigmac
Specialist III

Hello,

 

I totally agree with Rocco's comparison of the three interface methods.

 

Furthermore, the one-wire devices would appear to be available only from a very limited number of sources, whereas the SPI and IIC devices are available from many sources, mostly with "common" part numbers and interface requirements.

 

The one-wire devices have critical timing intervals, and are very slow because of these fixed duration intervals.  This means that interrupts will likely need to be globally disabled for the duration of each critical interval.  Conversely, the SPI and IIC methods do not have critical timing because both data and clock signals are present within the interface, and hardware modules are mostly used.  Typical clock speeds are 100kHz for IIC, and 1 - 10 MHz for SPI.

 

The attached code for a SPI EEPROM has previously appeared within this forum.  It should be suitable for EEPROM devices that utilize 16-bits for their address, (rather than 8-bits for old devices with very small capacity).  The code could be easily adapted for very large devices with more than 16 bit address.

 

Regards,

Mac

 

0 项奖励
回复
3,136 次查看
MMG135
Contributor I

Thanks to both Mac and Rocco for your very informative postings. That was exactly what I needed to know!

0 项奖励
回复