AnsweredAssumed Answered

i2c communication issues with mpc83xx

Question asked by vishnu prasad on Jul 25, 2018
Latest reply on Jul 28, 2018 by vishnu prasad

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.

Outcomes