AMcTools Forum 
  HomeHelpSearchLogin  
 
Pages: 1
Send Topic Print
Virtual I2C slave device component (Read 6231 times)
hardrock
YaBB Newbies
*
Offline

I love VMLAB !

Posts: 3

Gender: male
Virtual I2C slave device component
11/19/09 at 03:49:35
 
Hi, everybody,

I think the VMLAB is great tool to learn uC newly.
I've an new idea about user-defined component.
The two-wire serial EEPROM(ex. AT24C02) component will be very useful to simulate I2C and understand it.
As I know, the VMLAB is possible to simulate I2C pulse by scope.
But it's not real operation, just check the I2C pulse only by scope.
I'd like to simulate I2C operation by controlling the virtual I2C slave device like as I2C EEPROM.
It's wonderful to simulate whether I2C operation works good or not between master uC and virtual I2C slave device.
I hope the virtual I2C slave device will be supported in VMLAB.

Thanks in advance and best regards
Back to top
 
 
  IP Logged
DreamCat
Junior Member
**
Offline

I love electronic!

Posts: 63

Re: Virtual I2C slave device component
Reply #1 - 11/19/09 at 05:20:32
 
I also hope someone can develope this component..

maybe I will write some simple component for VMLAB after a few month. (:D, I'm learning AVR + GCC)。
Back to top
 
 
  IP Logged
moderator
YaBB Administrator
*****
Offline

I love forums, don't
you?

Posts: 308
AMcTools (Spain)
Gender: male
Re: Virtual I2C slave device component
Reply #2 - 11/19/09 at 08:13:16
 
Hi,

VMLAB includes a I2C monitor, in which you can send/receive/analyze data, etc in master/slave modes. See the demo "twi.prj"

If anyone wishes to develop a I2C-based EEPROM 24xx, of course it would be welcome.

Likewise, it would be very useful a SPI monitor, in the same style as the I2C one.

Back to top
 
 
WWW   IP Logged
ThVortex
Global Moderator
*****
Offline



Posts: 160
Austin, TX, USA
Gender: male
Re: Virtual I2C slave device component
Reply #3 - 01/02/10 at 03:44:44
 
Several people have been asking about an I2C EEPROM, so I decided to create a user component for it. I'm still working on it, but here is the usage statement to give everyone an idea of what it will look like.
[tt]
X _eeprom24x <MemorySize> <PageSize> [<Delay> <SlaveAddress> <SlaveMask>] <SDA> <SCL>

The <SDA> and <SCL> pins are respectively the serial data and serial clock
used by the I2C bus. The <MemorySize> parameter specifies the total EEPROM
size in bytes, and the <PageSize> parameter specifies the maximum number of
bytes that can be written to the EEPROM with a single I2C write command.
Both <MemorySize> and <PageSize> must both be given as "log base 2" of the
actual byte size. For example a <MemorySize> of "12" would actually specfy
4096 bytes since 2 to the power of 12 equals 4096.

After data is written to memory, the EEPROM will go into a busy state for
the duration of time given by the optional <Delay> parameter. During this
busy time, the EEPROM does not respond to any commands on the I2C bus.
If <Delay> is omitted, then it defaults to 0s which results in no busy
time; in other words, after a memory write operation, the EEPROM will be
immediately ready to accept another command.

The optional <SlaveAddress> parameter specifies the 7-bit I2C slave address
to which the EEPROM responds. The <SlaveMask> parameter is a bitmask
indicating which bits in <SlaveAddress> are actually significant when
performing the address comparison; a 0 bit in <SlaveMask> means that the
corresponding bit in <SlaveAddress> is a "don't care". If present, both
parameters must be used together and both are specified as decimal numbers.
If these paremeters are omitted, the default I2C address is "1010xxx".
[/tt]
Back to top
 
 
WWW   IP Logged
Pages: 1
Send Topic Print