How can I realize I²C on MC56F8036?

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

How can I realize I²C on MC56F8036?

2,570 次查看
cimbom
Contributor I
Hi,

I try to realize I²C on 2 MC56F8036 microcontrollers. Pin 1 for SDA and Pin 42 for SCL.
1 uC ist selected as master an the other as slave. I want to see whether communication takes place.
Did I get "ACK" when I select the slave address?
How can I see the "ACK" and where can I question on it?

does anybody of yours have examples for master slave communication?


I use CodeWarrior version 8.1.

Thank you
标记 (1)
0 项奖励
回复
3 回复数

871 次查看
AkellaANand
Contributor I
I think write a ACK() fuction and  put the following code in it.
void ACK(void)
  {
 /*configure the  SDA as output port */
   
   /* SDA is Low */
   SDA=LOW; 
     
   delay_i2c(20);
   /* SCL is kept High */
   SCL=HIGH;
  
   delay_i2c(20);
   /* SCL is kept Low */
   SCL=LOW;
   /* delay */
   delay_i2c(20);
  }
 and the NACK() is just opposite logic of ACK();

And write the EEPROM_read() or EEPROM_write pass the device id ,address location and the data
in the last check for the ACK ().
0 项奖励
回复

871 次查看
cimbom
Contributor I

here is a picture from oscillator

 

i2c.jpg

Message Edited by t.dowe on 2009-10-29 09:33 AM
0 项奖励
回复

871 次查看
mjbcswitzerland
Specialist V
Hi

It looks as though the ACK is missing - the 9th clock period should be pulled low by the slave if it is correctly addressed. In the photo the data line during the 9th clock is high.

Regards

Mark

www.uTasker.com

0 项奖励
回复