1
NXPTM M522XX, KINETIS and i.MX RT / I2C and MPL115A2
« on: December 29, 2010, 02:31:14 PM »
Hi folks,
i have one little problem. I would like to communicate with MPL115A2 sensor over I2C, but it is impossible to get data from it for me... Now i have a scope attached on I2C and probably i found where is the problem, but i don't know how to solve it.
I need to send/receive somtething like this (according to AN3785 from Freescale):
[Start], 0x60+[W], 0x12, 0x01,[Stop]
[Restart], 0x60+[W], 0x00
[Start], 0x60+[R], 0xMSB Pressure, 0xLSB Pressure, [Stop]
I call something like this:
#define ADR_PRESSURE 0x60
unsigned char wbuff_1[] = {ADR_PRESSURE, 0x12, 0x01};
unsigned char wbuff_2[] = {ADR_PRESSURE, 0x00};
unsigned char IIC_IO_read[] = {16, ADR_PRESSURE|0x01, TASK_PRVY_START};
fnWrite(IICPort, wbuff_1, sizeof(wbuff_1));
fnWrite(IICPort, wbuff_2, sizeof(wbuff_2));
fnRead(IICPort, IIC_IO_read, 0);
The problem (i mean) is between the two writes. According to the application note, there is one stop bit between the two writes (bold red one). But how i can make this stop bit? I looked at the scope, i found the start bit of the second write command, but no stop bit on the end of the first one. Can you help me with this? Or if you have some experience with communication with this sensor i uTasker, can you share the code snippet?
Thanks a lot and Marry Christmas.
EDIT: Subject name
i have one little problem. I would like to communicate with MPL115A2 sensor over I2C, but it is impossible to get data from it for me... Now i have a scope attached on I2C and probably i found where is the problem, but i don't know how to solve it.
I need to send/receive somtething like this (according to AN3785 from Freescale):
[Start], 0x60+[W], 0x12, 0x01,[Stop]
[Restart], 0x60+[W], 0x00
[Start], 0x60+[R], 0xMSB Pressure, 0xLSB Pressure, [Stop]
I call something like this:
#define ADR_PRESSURE 0x60
unsigned char wbuff_1[] = {ADR_PRESSURE, 0x12, 0x01};
unsigned char wbuff_2[] = {ADR_PRESSURE, 0x00};
unsigned char IIC_IO_read[] = {16, ADR_PRESSURE|0x01, TASK_PRVY_START};
fnWrite(IICPort, wbuff_1, sizeof(wbuff_1));
fnWrite(IICPort, wbuff_2, sizeof(wbuff_2));
fnRead(IICPort, IIC_IO_read, 0);
The problem (i mean) is between the two writes. According to the application note, there is one stop bit between the two writes (bold red one). But how i can make this stop bit? I looked at the scope, i found the start bit of the second write command, but no stop bit on the end of the first one. Can you help me with this? Or if you have some experience with communication with this sensor i uTasker, can you share the code snippet?
Thanks a lot and Marry Christmas.
EDIT: Subject name