Hello, I am working on LPC2148 implemented on Embedded Artists board. I am trying to write to the connected EEPROM and then read my data back. the hardware connection is fine and the slave address is 0xA0, I already read most of the online related information and the usermanual, but still I have problem with it. the problem is I can't get ACK from slave. since this is my first time working with I2C I do have some basic questions: 1. when simulating my code with keil(uvision4) do I have to get the ACK during simulation from Slave? in my case, when I simulate my code in debugger it shows the Master transmit Slave address, but then it goes to the status condition which shows no ACK from Slave. 2. does keil simulate the external hardware? 3. when I use Logic Analyzer in Keil debugger, it shows that SDA, SCL are high, do they have to change?
thanks for your help
No.
Here are a couple of application notes from this web site that might help you. Neither app note is specified for the LPC2148 but they will give you an idea about simulating I2C in the debugger. Look carefully at the uVision debugger Vitual Registers in the debugger manuals. Search this web site for additional examples.
http://www.keil.com/support/man/docs/uv4/uv4_sm_i2c_simulation.htm
The following app note is for C51 and C166 type devices but I2C is the same concept for most MCU. You must read the LPC data sheets carefully to set up the I2C.
Also, go to the Infineon web site for more examples for I2C for the LPC series.
http://www.keil.com/appnotes/docs/apnt_153.asp
Bradford
Thanks for the information, I already read the information for the I2C debug and simulation in Keil, and I found the VTREG and change it, but still when I run the signal function I2CMEMORY, nothing happen, and I don't know how to set up to get the I2C communicate, I mean send data and read it. would you please help me in this part, and give me some idea. I would like to know, if I run the signal function I2CMEMORY in debug, do I have to get the result in the I2C window? how should I write to EEPROM? after I run the signal, I send the slave address and then 0x00 address for EEPROM, then my data. is it correct?
regarding the other app, I got some idea from that one, and I wrote my code, but still I have problem with ACK from slave.
Thanks again Neda
Hello again, I am still working on I2C, and try to figure out how I can use the debug window for I2C in Keil. I use the other peripheral debug window, such as SPI,UART,A/D. but I can't use this one. I use the signal function in the ARM web site, but when I run it nothing happen. can any one please help me in this case. thanks Neda
Hi, I am trying to use the command window and read I2C_IN for ACK. would you please some one help me in this: what I am doing is, trying to simulate I2C, so I am using the function signal i2cmemory(). I add this code to be initial code, and when I start debuger it goes to simulation. in the command window, I type -I2CMEMORY() -then I2C0_OUT=0X0100 for start -the I give the slave address -read I2C0_IN, but here instead of getting 0xffoo, I am getting 0xffff are these steps right.
thanks for your help Neda
I figured out how to simulate I2C by signal function