cancel
Showing results for 
Search instead for 
Did you mean: 

I2C witch PCF8574P (keypad 4x4)

esiqueira
Associate II
Posted on March 20, 2013 at 20:14

Hi,

I would like to control keypad through PCF8574, but some problems

are occurring like (reading only one time), and receiving 'ack' even disabled.

''http://www.nxp.com/documents/data_sheet/PCF8574.pdf''

(see de picture below)

0690X0000060Mm1QAE.gif

#stm32f103rb-i2c-pcf8574p-keypad
1 REPLY 1
esiqueira
Associate II
Posted on March 20, 2013 at 23:08

void Configuration_I2C (void)

/* Enables the specified I2C peripheral. */

I2C_Cmd(I2C1,ENABLE);

        I2C_DeInit(I2C1);

        I2C_StructInit(&I2C_InitStructure);

/* Init I2C */

I2C_InitStructure.I2C_Mode = I2C_Mode_I2C;

I2C_InitStructure.I2C_DutyCycle = I2C_DutyCycle_2;

I2C_InitStructure.I2C_OwnAddress1 = 0x40;

I2C_InitStructure.I2C_Ack = I2C_Ack_Disable;

I2C_InitStructure.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit;

I2C_InitStructure.I2C_ClockSpeed = 40000;

I2C_Init(I2C1, &I2C_InitStructure);

}