Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Hi,
The purpose of a Pull Up resistor, or a pull down, is basically to prevent that i/p pin being left floating / open circuit by an input device.
If that happens then the micro will sense all sorts of random voltages.
Its therefor generally good practice to pull up or down all Digital inputs, however the resistor values should not be that low that they could affect the input device.
Typically 10k is a good value for either, which one depends on your softwares logic, ie pull up means the default state of the pin will be 1.
On PortB you have an option to select and turn on an internal pull up resistor.
Post your code.
void interrupt()
{
// RB0/INT External Interrupt
if(INTCON.INTF == 1) // if the RB0/INT External Interrupt flag is set...
{
INTCON.INTF = 0;
PIR1.TMR1IF = 0;
//PIE1.TMR1IE = 1;
PORTB.F1 = 0;
}
// Timer1 Interrupt - Freq = 43.62 Hz - Period = 0.022927 seconds
if (PIR1.TMR1IF == 1 && INTCON.INTF == 0) // timer 1 interrupt flag
{
PORTB.F1 = 1; // Toggle PORTB bit1 LED
COUNT1 = COUNT1 + 1;
PIR1.TMR1IF = 0; // interrupt must be cleared by software
PIE1.TMR1IE = 1; // reenable the interrupt
TMR1H = 91; // preset for timer1 MSB register
TMR1L = 252; // preset for timer1 LSB register
}
}
hello,
pull up or pull down RB0 is not the real problem.
answer first to this question :
what is the source of the signal you apply
on RB0 pin ?
a passive component, as,a,relay reed contact ?
or the ouput of a active component
ie output of a 7406 ttl driver
or other..
you have to considere booth part..to decide if pul up (down) is necessary .