realise second RX-interrupt input


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2005
    Posts
    72

    Default realise second RX-interrupt input

    hello all

    i have an existing controller based on a 16F876A where RC7 as serial input interrupt is allready used.

    now as an extension i need a second one... so i send a serial command, go back to do some work and when the answer is coming in on RX2 i should catch them. this command are about 8 chars. i don't know how long it takes until this will receive.

    how could i realise them, beside to use a second PIC as coprozessor... RB4 is allready free so i could include them in the RB4-7 INTCON interrupt? i don't need the string immeadetly so if possible i could buffer them for a moment anywhere...

    thanks for a hint, cheers

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


    Did you find this post helpful? Yes | No

    Default

    mmm, maybe it could work, maybe not. Depending what else the PIC do.

    Is the other Serial Pin use Interupt? If not, i'll suggest to swap them. Now you'll use the internal USART Buffer and avoid some missing character.
    Steve

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

  3. #3
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default

    It all depends on what you expect it to do. Without two UARTs it would be very difficult to receive from both ports at the same time. If it is basically one or the other, that makes the job a lot easier. In that case, you can watch for an interrupt on RB4 and jump to a SERIN2 routine (or its equivalent in assembly). You will have to turn off the UARTs interrupt while in that routine, since grabbing a character from the UART's receive buffer would screw up the timing of SERIN. If you checksum your data streams and allow for retries, this should work quite well.

    I suppose you COULD measure the RB4 interrupts against a timer and decode the data stream. Difficult, but doable.
    Charles Linquist

Similar Threads

  1. RX interrupt
    By Arciure in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 5th March 2010, 17:23
  2. 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
  3. 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
  4. Help with Analog Interrupt
    By brid0030 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 13th February 2008, 18:14
  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