i2c communication issues with mpc83xx

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

i2c communication issues with mpc83xx

1,097 Views
garimella
Contributor I

I have a custom board using mpc83xx processor with i2c interface working very well from uboot. But I fail to access the i2c device when I tried to write small program. Following is by psuedo code.

/*Accessing i2c1 bus a master to transmit data*/

volatile unsigned char  *freq= (volatile unsigned char*)0xe0003004

volatile unsigned char  *ctrl= (volatile unsigned char*)0xe0003008

volatile unsigned char  *status= (volatile unsigned char*)0xe000300c

volatile unsigned char  *data= (volatile unsigned char*)0xe0003010

main()

{

*freq =0x01; 

*ctrl= 0xf8; //start

*data =0x50; // transmit slave address

printf("status is %x\n",*status);

*data = 0x00;// transmit reg address

*data= 0x01;

*data = 0x55;// transmit data

*ctrl = 0x00;//stop

}

result: no data update in the memory and status reg displays 0x81. 

Please advice.

Tags (1)
0 Kudos
Reply
2 Replies

984 Views
Pavel
NXP Employee
NXP Employee

Look at attached file. It is a I2C program example.


Have a great day,
Pavel Chubakov

-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos
Reply

984 Views
garimella
Contributor I

Hi Pavel

That solved the problem for I2C. But I have another question. MPC83xx custom board has two ethernet ports. How do I access the 2nd lan port from Linux? I am able to transmit and receive from port 1.

0 Kudos
Reply