How can I realize I²C on MC56F8036?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How can I realize I²C on MC56F8036?

2,453 Views
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
Tags (1)
0 Kudos
3 Replies

754 Views
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 Kudos

754 Views
cimbom
Contributor I

here is a picture from oscillator

 

i2c.jpg

Message Edited by t.dowe on 2009-10-29 09:33 AM
0 Kudos

754 Views
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 Kudos