I am using Ardunio Due board (atmel SAM3x8e microcontroller) in Atmel Studio 7.
I am getting start and stop condition by code, i tried all options but still both SDA and SCL pins remains high
My code is
calling function as i2c_start(Twi1); etc
void i2c_start(Twi *p_twi)
//p_twi->TWI_CR &= 0xFFFFFFF1;
//TWI1->TWI_CR = TWI_CR_START | TWI_CR_STOP;
//TWI1->TWI_CR = TWI_CR_START;
//p_twi->TWI_CR = TWI_CR_START;
p_twi->TWI_CR = TWI_CR_START;
void i2c_stop(Twi *p_twi)
//p_twi->TWI_CR &= 0xFFFFFFF2;
//TWI1.TWI_CR = TWI_CR_START | TWI_CR_STOP;
//TWI1->TWI_CR &= 0xFFFFFFF2;
p_twi->TWI_CR = TWI_CR_STOP;
Please let me know if anybody knows how to get it by code.
Discussion around product based on ARM Cortex M3 core.
1 post • Page 1 of 1
Who is online
Users browsing this forum: No registered users and 1 guest