I am using an NXP S32K312 EVB with Simulink NXP MBDT Example - s32k3xx_i2c_async_s32ct.slx
I made sure to follow instructions - these pins are connected
Looking at the last instruction, I checked the schematics of the EVB and it seems they have pullup resistors already, I was able to locate them on board as well. All jumpers are connected as mentioned in S32K312EVB-Q172 - Hardware User Manual.
Build and flash - no issues observed.
When I run FreeMASTER, I see no change on "slave_send" variable being changed at all. Does it something have to do with interrupt in this case, please confirm. I suspect this because, this is what increments the "slave_send" variable. Please let me know the steps to enable it. Attached is the .mex
#s32k3 #s32k312 #i2c #mbdt
解決済! 解決策の投稿を見る。
Hi @beginner100
Can you provide a picture of your setup with the S32K312EVB-Q172 and the connections?
Just to be sure, have you connected the Pull-up resistors for pins PTD14 and PTD13 as in the picture below?
Just in case I have attached the s32k311_i2c_async_s32ct.zip that I have tested and it works on my S32K312EVB-Q172.
Please test it and send me all details and pictures,
Stefan V.
Hello @stefanvlad
One more question on the same example and it's this event "I2C_SLAVE_EVENT_TX_REQ" within Hardware Interrupt Callback (MBDT_I2C_Callback)
Why is the Event output being compared to 5 ? Is I2C_EVENT_TX_REQ_SLAVE defined as 5? Where can I find this configuration in the S32CT tool? What other events are available and can you please explain and help me understand this better, thank you!
Hi @beginner100 ,
There is a structure defined in the Lpi2c_Ip_Callbacks.h:
/**
* @brief Define the enum of the events which can trigger I2C slave callback
*
* This enum should include the events for all platforms
* implements Lpi2c_Ip_SlaveEventType_enum
*/
typedef enum
{
I2C_SLAVE_EVENT_ERROR_BIT = 0x00U,
I2C_SLAVE_EVENT_UNDERRUN = 0x01U,
I2C_SLAVE_EVENT_OVERRUN = 0x02U,
I2C_SLAVE_EVENT_RX_FULL = 0x03U,
I2C_SLAVE_EVENT_TX_EMPTY = 0x04U,
I2C_SLAVE_EVENT_TX_REQ = 0x05U,
I2C_SLAVE_EVENT_RX_REQ = 0x06U,
I2C_SLAVE_EVENT_STOP = 0x07U,
I2C_SLAVE_EVENT_DMA_TRANSFER_ERROR = 0x0EU
}Lpi2c_Ip_SlaveEventType;
To open the S32 Configuration Tools, you need to select an NXP block, and press Configure:
Then when S32CT is opened, you can go to Platform in the Interrupt Controller, to locate the LPI2C0_Master_Slave_IRQHandler:
Best regards,
Stefan V.
I have used the model from the .zip shared, and now it seems to be working fine. Yes, I have also connected the resistors as you mentioned.
Hi @beginner100
Can you provide a picture of your setup with the S32K312EVB-Q172 and the connections?
Just to be sure, have you connected the Pull-up resistors for pins PTD14 and PTD13 as in the picture below?
Just in case I have attached the s32k311_i2c_async_s32ct.zip that I have tested and it works on my S32K312EVB-Q172.
Please test it and send me all details and pictures,
Stefan V.
Hi @beginner100 ,
Thank you for using MBDT for S32K3 with the S32K312EVB-Q172 evaluation board,
In the case of the s32k3xx_i2c_async_s32ct example, the table below describes the connections between the I2C instances on S32K312-Q172:
But in that help file, there is also a Note below that reads:
Because the other I2C Instance has pins PTD13, PTD14 with no pull-up resistors, you need to add those, and connect them, one example is in the picture below:
I have created a simplified version of the schematic showing only the I2C connections needed with pull-up resistors:
After you make all the connections , then you can open FreeMASTER and take a look at variables:
Both of them will increment accordingly and go up to 256 then roll back to 0.
Hope this helps you with the setup,
Best regards,
Stefan V.