Serial and Port B interrupt


Closed Thread
Results 1 to 2 of 2
  1. #1
    Join Date
    Aug 2008
    Posts
    66

    Post Serial and Port B interrupt

    I am using PIC16F877 and planning to have serial cable connect to PIC.
    PIC will detect the input RB0, which will trigger an asm int to increase a counter variable.

    I plan to use SERIN, but then if RB.0 always got interrupt, then SERIN will never get to execute when PC send a command to PIC. In this case, this serial command is lost.

    How do I use serial HW interrupt, so it has a higher priority than asm RB.0 INT?

    Note that RB.0 will have an interrupt every 10us, and a counter variable is incremented in this ISR. is this possible with a 20MHz crystal? Each asm instruction cycle is 0.2us right?

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


    Did you find this post helpful? Yes | No

    Default

    Interrupt priority will be the order you will check the interrupt trigger. The built-in USART have a 2 bytes buffer, so could be useful to avoid some data lost.

    Depending your baudrate, this could work or not.
    Steve

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

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. Serial and interrupt
    By test153 in forum mel PIC BASIC Pro
    Replies: 20
    Last Post: - 8th February 2009, 14:02
  3. interfacing to the pc serial port
    By kelangfei in forum General
    Replies: 4
    Last Post: - 7th October 2007, 22:35
  4. Replies: 2
    Last Post: - 28th April 2006, 12:10
  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