MCF 52259  Demokit - I2C problem

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

MCF 52259  Demokit - I2C problem

跳至解决方案
1,663 次查看
nms
Contributor I

I am using MCF 52259 Demokit. I have configured I2C channel 1. I have used J4 connector of DEMOCom  PCB. I have attached I2C_init here.I am checking the frequency of SCL

void init_i2c(void){ unsigned char temp; print("  initializing I2C channel\n");// MCF_GPIO_DDRQS = 1;//0; /* I2C pins configuration channel 1  -> Channel 1 I2c pins are available on connector J4*/ MCF_GPIO_PQSPAR = MCF_GPIO_PQSPAR_PQSPAR1(2)| MCF_GPIO_PQSPAR_PQSPAR0(2);//SDA1(Pin 10) and SCK1(Pin 12)  /*I2C Channel Frequency configuration*/ //MCF_I2C_I2FDR = 0x38;  //For 125 KHz     MCF_I2C_I2FDR = 0x34;  //For 250 KHz /* start the I2C communication */ MCF_I2C_I2CR = 0 | MCF_I2C_I2CR_IEN; /* set Master address */ MCF_I2C_I2AR = MASTER_ADDR; /* if bit busy set, send a stop condition to slave module */ if( MCF_I2C_I2SR & MCF_I2C_I2SR_IBB) {   MCF_I2C_I2CR = 0;      /* clear control register */  MCF_I2C_I2CR = MCF_I2C_I2CR_IEN |  /* enable module */        MCF_I2C_I2CR_MSTA;  /* send a START conditionn */  temp = MCF_I2C_I2DR;     /* dummy read */    MCF_I2C_I2SR = 0;      /* clear status register */  MCF_I2C_I2CR = 0;      /* clear control register */  MCF_I2C_I2CR = 0 | MCF_I2C_I2CR_IEN; /* enable the module again */ }  return; }

 

 on storage oscilloscope. But not geting any Signal Waveform.Please suggest any corrections.

 

thanks 

标签 (1)
0 项奖励
回复
1 解答
579 次查看
mjbcswitzerland
Specialist V

Hi

 

The Kirin3 has two I2C interfaces (0 and 1) and these can also be positioned on various different port pins. (Make sure that you have pull up resistors attached since the pins are open drain when in I2C mode).

 

It looks as though you are using I2C1 and configuring them on port QS [PQ0 and PS1] (pins 24 and 25 on the processor - connected to the QSPI bus on the demo board). These are however not connected to the pins that you are measuring.

 

You need to configure for UC port use [PUC2 and PUC3] (pins 97 and 98 on the processor) - these are connected to the pins that you are measuring (J4-10 and J4-12).

 

You therefore need I2C1 to use port UC: First alternative functions on PUC 2 and 3:

 

Regards

 

Mark

 

www.uTasker.com

- OS, TCP/IP stack, USB, device drivers and simulator for M521X, M521XX, M5221X, M5222X, M5223X, M5225X. One package does them all - "Embedding it better..."

 

 

在原帖中查看解决方案

0 项奖励
回复
1 回复
580 次查看
mjbcswitzerland
Specialist V

Hi

 

The Kirin3 has two I2C interfaces (0 and 1) and these can also be positioned on various different port pins. (Make sure that you have pull up resistors attached since the pins are open drain when in I2C mode).

 

It looks as though you are using I2C1 and configuring them on port QS [PQ0 and PS1] (pins 24 and 25 on the processor - connected to the QSPI bus on the demo board). These are however not connected to the pins that you are measuring.

 

You need to configure for UC port use [PUC2 and PUC3] (pins 97 and 98 on the processor) - these are connected to the pins that you are measuring (J4-10 and J4-12).

 

You therefore need I2C1 to use port UC: First alternative functions on PUC 2 and 3:

 

Regards

 

Mark

 

www.uTasker.com

- OS, TCP/IP stack, USB, device drivers and simulator for M521X, M521XX, M5221X, M5222X, M5223X, M5225X. One package does them all - "Embedding it better..."

 

 

0 项奖励
回复