hello, i am new in the pic bussines and i have a problem. i use the 16f628a with an internal clock, a switch with an 10kohm resistant(pull down) on the RB0 - EXT_INT and a transistor to switch on a led.
the problem is that the systems works perfect when i pull my finger on the chip and it doesn't work when i give my hand away.
void main() {
ext_int_edge(H_TO_L); // init interrupt triggering for button press
enable_interrupts(INT_EXT);// turn on interrupts
enable_interrupts(GLOBAL);
set_tris_a(0);
set_tris_b(0b00000001); // RB0 wird als Eingang definiert
while (1)
{
delay_ms(500);
output_low(PIN_B3); //LED wird auf LOW gesetzt
delay_ms(500);
output_high(PIN_B3);
}
}
simple, but it doesn't work.
thanks for help!
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
Posted: Thu Dec 16, 2004 2:00 pm
Quote:
The problem is that the systems works perfect when i pull my finger on the chip and it doesn't work when i give my hand away.
Two possible solutions:
1. Add NOLVP to the end of the #fuses statement.
2. Make sure that the MCLR pin is connected to your Vdd voltage
(probably +5v in your case) through a resistor. The resistor
value could be 10K, but if you are using the CCS ICD, then it
should be 47K.
Guest
Posted: Thu Dec 16, 2004 6:58 pm
make sure your switch is held high and grounds when button pressed. i had a similar problem with a pic because i was letting the pins float and they would go high when a hand was waved near the circuit.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum