We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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).
I forgot to write down that this two sentences did not work either.
P1 = 0x40; // Does not write P1 |= 0x40; // Does not write