Instant Interrupts - Revisited


Closed Thread
Results 1 to 40 of 773

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    I don't understand your language, so it's hard to tell what's going on.
    But here's a couple problems I can see...

    LCDOUT STR cadena,20 'no aparece nada (nothing appears in lcd

    should be...

    LCDOUT STR cadena\20

    And the reason you're missing characters, is probably because the data is received by the interrupt handler, but it's being put into the "buffer" array in the main loop. That should be done in the handler too.
    <br>
    DT

  2. #2
    Join Date
    Jun 2007
    Posts
    3


    Did you find this post helpful? Yes | No

    Default

    Thanx for your answer.

    I understand you about the understanding the code.... me too sometimes....

    OK lcdout cadena\20

    >And the reason you're missing characters, is probably because the data is >received by the interrupt handler, but it's being put into the "buffer" array in >the main loop. That should be done in the handler too.
    ¿? Something like this?:

    '---[RX - inmterrupt handler]----------------------------------------------
    Int_RX:
    PORTA.1 = 1 'to check RX int has come
    hserin [char]
    cadena[i] )= char
    i = i +1
    @ INT_RETURN

    but lcd displays rare....

    Don´t worry i´ll figth with it.

    Thanx for all.

  3. #3
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Better, but it still needs a way to limit it to the "bounds" of the array. Or, it will overwrite all your other variables. Maybe like this.
    Code:
    '---[RX - inmterrupt handler]----------------------------------------------
    Int_RX:
        PORTA.1 = 1 'to check RX int has come 
        hserin [cadena(i)] 
        i = i +1
        if i >= 20 then i = 0
    @ INT_RETURN
    Of course this still has the problems of not knowing how many bytes were received, if the buffer overflows, if USART errored etc.

    You might want to take a look at this program from Joe S.

    LCD serial backpacks
    http://www.picbasic.co.uk/forum/showthread.php?p=28336

    It has a complete "Circular Buffer" using DT_INTS.
    <br>
    DT

Similar Threads

  1. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 22:43
  2. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 21:02
  3. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 21:48
  4. Keypad and DT's Instant Interrupts
    By Homerclese in forum General
    Replies: 11
    Last Post: - 27th April 2007, 07:32
  5. Replies: 1
    Last Post: - 1st November 2006, 04:11

Members who have read this thread : 4

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

Tags for this Thread

Posting Permissions

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