Discussion in "8051 Discussion Forum" started by    haihodanang    Nov 29, 2008.
Sat Nov 29 2008, 06:03 am
#1
I am trying to simulating i2c interface between 89c51 and 24c04.But i am not sucessful.This is my program .I don't know what mistake can be in my program.in this program, I intend to write data restored in address 1Ah of 89c51 to 24c51.R7 register restore word address to write. then I read the data from 24c04 .To check process,I use 7segs to perform the result i read.


[ Edited Sat Nov 29 2008, 06:14 am ]
Sat Nov 29 2008, 09:16 am
#2
Only certain file types are allowed for uploading.Make sure you comply and attach the code again.Or else just copy-paste the code here.

Allowed file types: | .zip | .gz | .jpg | .png | .gif | .rar | .pdf |
Any other file types uploaded will be instantly deleted.



[ Edited Sat Nov 29 2008, 09:18 am ]
Sun Nov 30 2008, 03:25 pm
#3
help me as soon as possible!thank you very much
Attachment
Mon Dec 01 2008, 01:26 am
#4
are you checking on simulator or on hardware?

and your delay seems little less than the required one. your delay must be more than 5ms, try with 10ms delay and see if it works.

I am considering that your I2C routines are working fine. To check your routines are fine or not, use software called PINNACLE. its good for checking software I2C.
you can download trial version here:
http://www.vaultbbs.com/pinnacle/
Tue Dec 02 2008, 07:31 am
#5
can you show me the way to simulate in this software.
Tue Dec 02 2008, 02:27 pm
#6
hmm its hard to explain like this..
i will try to take screenshots in evening to explain u..
Wed Dec 03 2008, 02:29 pm
#7
Sorry for the complaint yesterday.I wasnot calm. dealine is coming, so I am so worried:blush!Now,can I ask you a question .After eeprom get 1 byte from 89c51 ,it will pull down sda.what does this process happen ?In your code, after send 1 byte, you set sda and then master leave 1 clock cycle.you can instruct me in this pinacle, where i can set my hardware and where i write my program.
Wed Dec 03 2008, 02:41 pm
#8
Sorry for the complaint yesterday.I wasnot calm. dealine is coming, so I am so worried:blush!Now,can I ask you a question .After eeprom get 1 byte from 89c51 ,it will pull down sda.what does this process happen ?In your code, after send 1 byte, you set sda and then master leave 1 clock cycle.you can instruct me in this pinacle, where i can set my hardware and where i write my program.
Wed Dec 03 2008, 03:04 pm
#9
Here is small screenshot tutorial explains u everything..
Click on image to enlarge if they are small

Your Pinnacle interface is like this..


go to Project -> Project Options select any I2c EEPROM you want, and then select the bus where u want to connect your eeprom on which bus. The address is kept 0. so that your 7-bit I2C address becomes 0xD0 (0xA0 for write, and 0xA1 for read). read datahseet for more information.
here is small screenshot explains that


in the same Project Option window, there is I2C Bus Configuration, click on that..
there you find option to setup pins you are using for I2C bus1 and 2.
so whatever pins you are using in your code for SCL and SDA, select them here..
here is screenshot that explains all.


Now you can open asm file or load the hex file, after that open the I2C bus window where your EEPROM is connected, in our case its I2C Bus 1.
got to View -> I2C Devices -> I2C Bus 1
and if you want to see I2C EEPROM content, then open
View -> I2C Devices -> Serial EEPROM


Hope this small tutorial was helpful
Tags I2C bus simulationPinnacle SimulationI2C simulation on Pinnacle 52I2C EEPROM simulationSPI simulationI2C SPI simulator

Get Social

Information

Powered by e107 Forum System

Downloads

Comments

Bobbyerilar
Thu Mar 28 2024, 08:08 am
pb58
Thu Mar 28 2024, 05:54 am
Clarazkafup
Thu Mar 28 2024, 02:24 am
Walterkic
Thu Mar 28 2024, 01:19 am
Davidusawn
Wed Mar 27 2024, 08:30 pm
Richardsop
Tue Mar 26 2024, 10:33 pm
Stevencog
Tue Mar 26 2024, 04:26 pm
Bernardwarge
Tue Mar 26 2024, 11:15 am