Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

RB0/INT External Interrupt requires Pull up Resistor ?

Status
Not open for further replies.

asking

Full Member level 5
Joined
Sep 21, 2010
Messages
279
Helped
6
Reputation
12
Reaction score
6
Trophy points
1,298
Activity points
3,377
Hello,

I want to use RB0/INT of PIC16F628A do i need to use pull-up resistors ? which one i should use ? Pull - up or pull -down ? Please help...
 

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.
 
  • Like
Reactions: asking

    asking

    Points: 2
    Helpful Answer Positive Rating
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.

I think when i defined Port B INT Interrupt, internal weak-pull resistor are on by default. Because when i tried putting external 10K interrupt was not working...but when i removed it everything is fine :)
 

Post your code.

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 .
 

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 .

i am getting output from TSOP1838. Actually i was making Beam Break detector.
 

hello,

a real example of using pull up resitor ...

but what is your problem ?

Image1.jpg
 

how source supply affects the switch??
 

Status
Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top