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
Solved! Go to Solution.
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
- OS, TCP/IP stack, USB, device drivers and simulator for M521X, M521XX, M5221X, M5222X, M5223X, M5225X. One package does them all - "Embedding it better..."
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
- OS, TCP/IP stack, USB, device drivers and simulator for M521X, M521XX, M5221X, M5222X, M5223X, M5225X. One package does them all - "Embedding it better..."