Hi,
I try to run
the MQX-3.8 i2c example (Master) on a MK60DN512VLL10 (100 Pin version).
A EEPROM
24LC16BT-I is correct connected to PortB2/B3.
All MQX
Settings/Files are default for TWRK60D100m.
In SW I
changed:
/*
PORTB_PCR2=PORT_PCR_MUX(2)|PORT_PCR_ODE_MASK; // I2C0_SCL
PORTB_PCR3=PORT_PCR_MUX(2)|PORT_PCR_ODE_MASK; // I2C0_SDA
SIM_BASE_PTR->SCGC4
|= SIM_SCGC4_I2C0_MASK;
*/
PORTB_PCR0=PORT_PCR_MUX(0); // I2C0_SCL
PORTB_PCR1=PORT_PCR_MUX(0); // I2C0_SDA
PORTB_PCR2=PORT_PCR_MUX(2); // I2C0_SCL
PORTB_PCR3=PORT_PCR_MUX(2); // I2C0_SDA
Nothing
happen on port pins and it never leave :
_ki2c_polled_rx_tx()
do
{
i2csr = i2c_ptr->S;
if (0 == (i2c_ptr->C1 &
I2C_C1_MST_MASK))
{
if (i == length)
{
return i;
}
if ((io_info_ptr->OPERATION &
I2C_OPERATION_STARTED) && (0 == (i2csr & I2C_S_BUSY_MASK)))
{
io_info_ptr->OPERATION = 0;
io_info_ptr->RX_REQUEST = 0;
io_info_ptr->STATE = I2C_STATE_FINISHED;
return i;
}
}
} while (0 == (i2csr
& I2C_S_IICIF_MASK));
What I have
to change in SW?
BR Uwe
Solved! Go to Solution.
Hello Uwe,
If you want to use the MQX I2C driver and you need to change the default i2c pins, it is necessary to modify the init_gpio.c file, this file is located at the path:
C:\Freescale\Freescale MQX 3.8\mqx\source\bsp\twrk60n512
After that you need to rebuild the BSP and PSP.
At the path C:\Freescale\Freescale MQX 3.8\mqx\examples you can find an example for i2c, this example shows how to read/write data from/to external SPI EEPROM.
Please let me know if this helps!!
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Uwe,
If you want to use the MQX I2C driver and you need to change the default i2c pins, it is necessary to modify the init_gpio.c file, this file is located at the path:
C:\Freescale\Freescale MQX 3.8\mqx\source\bsp\twrk60n512
After that you need to rebuild the BSP and PSP.
At the path C:\Freescale\Freescale MQX 3.8\mqx\examples you can find an example for i2c, this example shows how to read/write data from/to external SPI EEPROM.
Please let me know if this helps!!
Have a great day,
Sol
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------
Hello Sol,
my i2c Driver is OK now.
Thanks!
BR Uwe