Index: webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c =================================================================== --- webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c (revision 50) +++ webserver/example/EnergyMeters/Source/EnergyMeters/Meters.c (revision 52) @@ -101,4 +101,7 @@ /* Enable Pins. */ + PINSEL4 = 0; + PINMODE4 = 0; + PINSEL4 &= 0xfffff3ff; /* reset bit 20 and 21, P2.10 = GPIO Port 2.10 */ PINMODE4 &= 0xfffff3ff; /* reset bit 20 and 21, enable on-chip pull-up resistor on Port 2.10 */ @@ -106,10 +109,21 @@ IO2_INT_EN_F &= ~(1<<10); /* disable falling edge interrupt for P2:10 */ + + + PINSEL4 &= ~((portLONG)0x3ff); /* reset bit 0 to 9, GPIO Port P2:0 to P2:4 */ + PINSEL4 &= ~((portLONG)(0x3 << 20)); /* reset bit 20 and 21, P2.10 = GPIO Port 2.10 */ + + /* bits are 0 here */ + /* disable pull-up/down resistors on 2.0, 2.1, 2.3, 2.4 (put binary 10 for all), don't change 2.2! */ + PINMODE4 |= 0x28A; + + IO2_INT_EN_R |= (1<<0); /* enable rising edge interrupt for P2:0 */ IO2_INT_EN_F &= ~(1<<0); /* disable falling edge interrupt for P2:0 */ IO2_INT_EN_R |= (1<<1); /* enable rising edge interrupt for P2:1 */ IO2_INT_EN_F &= ~(1<<1); /* disable falling edge interrupt for P2:1 */ - IO2_INT_EN_R |= (1<<2); /* enable rising edge interrupt for P2:2 */ - IO2_INT_EN_F &= ~(1<<2); /* disable falling edge interrupt for P2:2 */ + // P2.2 is not connected! + //IO2_INT_EN_R |= (1<<2); /* enable rising edge interrupt for P2:2 */ + //IO2_INT_EN_F &= ~(1<<2); /* disable falling edge interrupt for P2:2 */ IO2_INT_EN_R |= (1<<3); /* enable rising edge interrupt for P2:3 */ IO2_INT_EN_F &= ~(1<<3); /* disable falling edge interrupt for P2:3 */ Index: webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c =================================================================== --- webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c (revision 51) +++ webserver/example/EnergyMeters/Source/EnergyMeters/Meters_ISRs.c (revision 52) @@ -46,9 +46,10 @@ IO2_INT_CLR |= (1<<1); } - if ((IO2_INT_STAT_R & (1 << 2)) != 0) /* P0.2 interrupt triggered - connector J4, Pin 2*/ - { - handleMeterTick(METER_INDEX_EL2); - IO2_INT_CLR |= (1<<2); - } + // P0.2 is not connected! + //if ((IO2_INT_STAT_R & (1 << 2)) != 0) /* P0.2 interrupt triggered - connector J4, Pin 2*/ + //{ + // handleMeterTick(METER_INDEX_EL2); + // IO2_INT_CLR |= (1<<2); + //} if ((IO2_INT_STAT_R & (1 << 3)) != 0) /* P0.3 interrupt triggered - connector J4, Pin 3*/ {