I have a problem trying to write to Port1 bit 6 P1.6
The pins are defined at a .H file
sbit Pin_E2P_SDA = P1^5; sbit Pin_E2P_SCL = P1^6; sbit Pin_E2P_WP = P1^7;
and the function :
I initialized the registers according to the datasheet an according to this link. http://www.keil.com/dd/vtr/3685/5729.htm
Can anyone give me any idea about what is happennig? Please.
Thank you in advanced David
void E2pEnableWrite( void ) { IDA0CN = 0x00; // DISABLE IDAC0 IDA1CN = 0x00; // DISABLE IDAC1 P1MDIN = 0xBF; //input is digital P1MDOUT = 0x00; //P0MDOUT.x=1,Push-pull. When P0MDOUT.x=0, open drain P1SKIP = 0x00; // SALTO LAS 3 SALIDAS XBR0 = 0x00; XBR1 = 0x40; P1 = 0x40; P1 |= 0x40; Pin_E2P_WP = 1; // Writes OK Pin_E2P_WP = 0; // Writes OK Pin_E2P_SCL = 1; // DoesnÂ't Write Pin_E2P_SCL = 0; // DoesnÂ't Write Pin_E2P_SDA = 1; // Writes OK Pin_E2P_SDA = 0; // Writes OK }
p.d. I am debugging the code with a SILICON LABS USB Debug adapater 1.9.0.0 ( EC300019BBE).