i2c can't generate "NACK"

Discussion around products based on ARM Cortex-A5 core.

Moderator: nferre

leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

i2c can't generate "NACK"

Wed Jun 14, 2017 9:07 am

Hi,all.i run ucosii on my custom board based SAMA5D3.i faced a program:i used twi0 as i2s master,and read data from slave. i invoke function "TWID_Read" in offical lib "libchip_sama5d3x" ,it can't generate "NACK" in twi status register(8th bit) when the twi0 connect nothing.Please give me some advice,Thank you !
tsvoipio
Posts: 53
Joined: Wed Aug 19, 2015 9:44 pm

Re: i2c can't generate "NACK"

Wed Jun 14, 2017 6:55 pm

leo.ni wrote:Hi,all.i run ucosii on my custom board based SAMA5D3.i faced a program:i used twi0 as i2s master,and read data from slave. i invoke function "TWID_Read" in offical lib "libchip_sama5d3x" ,it can't generate "NACK" in twi status register(8th bit) when the twi0 connect nothing.Please give me some advice,Thank you !
The I2C specification assumes that there are pull-up resistors on both SCK and SDA lines, so that an empty bus shows logical ones. A NACK is SDA up at the ACK time slot. Check your SDA pull-up.
leo.ni
Posts: 52
Joined: Mon Jun 06, 2016 4:20 am

Re: i2c can't generate "NACK"

Thu Jun 15, 2017 3:06 am

Thanks a lot ! i invoke the "TWID_Read" function as polling method(the 3th parameter of this function) and mcu can't set the nack bit in i2c status register.but when i invoke this function as IRQ method,the register NACK bit is set.So,i think that maybe this is a bug,but i'm not sure.Thank you for your reply again!
By the way, i pull-up SDA with a 3.3K registor,and supply is 3.3v.

Return to “SAMA5D Cortex-A5 MPU”

Who is online

Users browsing this forum: No registered users and 1 guest