16F767 Exteranl Interrupt with DT_INTS


Closed Thread
Results 1 to 8 of 8

Hybrid View

  1. #1
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    i've edited my previous post. Also, let's say you want to use INT0 (RB0), you want to disable the multiplexed ADC on it (see ADCON1 register pdf page 155).

    INT_INT will work only with RB0, while RBC_INT will work with PORTB<7:4> pins (see INTCON page 25, and section 5.2 page 58).
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  2. #2
    Join Date
    Feb 2006
    Location
    Australia, Gold Coast
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    Wow that was quick reply Mister_E!

    Quote Originally Posted by mister_e View Post
    i've edited my previous post. Also, let's say you want to use INT0 (RB0), you want to disable the multiplexed ADC on it (see ADCON1 register pdf page 155).

    INT_INT will work only with RB0, while RBC_INT will work with PORTB<7:4> pins (see INTCON page 25, and section 5.2 page 58).
    Yes, checked the PDF pg 155, but isn't ADCON1 = 15 doing that?
    That should make all ports digital?

    I agree the port change 7:4 would be better, but I plan to use RB5 for CCP3...so that is not really possible. I think I should use the RB0 external interrupt.
    "Never under estimate the powers of an idiot"

  3. #3
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Nah... you can use whatever spare I/O you have, and poll them with a Timer Interrupt, let's say 10 times/seconds. Your main loop just check if you have a new keypress.

    1 Timer interrupt will do everything,
    1. scan the Key
    2. say if there's a new key available,
    3. and... why not using it also for the debouncing as well?

    Think about it... 10 times a second is usually just fine.

    <hr>
    Yes ADCON1=15 will do.
    Last edited by mister_e; - 29th May 2008 at 22:19.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  4. #4
    Join Date
    Feb 2006
    Location
    Australia, Gold Coast
    Posts
    31


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    Nah... you can use whatever spare I/O you have, and poll them with a Timer Interrupt, let's say 10 times/seconds. Your main loop just check if you have a new keypress.

    1 Timer interrupt will do everything,
    1. scan the Key
    2. say if there's a new key available,
    3. and... why not using it also for the debouncing as well?

    Think about it... 10 times a second is usually just fine.

    <hr>
    Yes ADCON1=15 will do.
    Many thanks Mister_E...after much hair tearing I successfully managed to use the external RB0 interrupt with the above code. My stupid mistake, bad home made connector wiring on the EasyPIC board.
    I ended up using your suggestion with the 10Hz timer -your multi-calculator works great! - as you said at least i can also debounce easily.

    Many thanks for your time.
    "Never under estimate the powers of an idiot"

  5. #5
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    The advantage of the timer interrupt is that you have a Global key scan... all the time, you just need to poll few variables it here and there. Another great thing.. you can use the pin you want. For user Key, it's just perfect and really fast enough.

    Timer interrupt are sooo handy.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

Similar Threads

  1. Won't go back to SLEEP after 1st Interrupt
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 32
    Last Post: - 29th June 2009, 09:00
  2. Can't ID interrupt source with this IntHandler??
    By jellis00 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 3rd June 2009, 02:35
  3. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  4. NEWBIE: Some basic questions using interrupts
    By JackPollack in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 8th March 2006, 02:59
  5. USART interrupt not interrupting right
    By Morpheus in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 6th March 2005, 01:07

Members who have read this thread : 0

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts