Interrupt driven Buffered Serial Input


Closed Thread
Results 1 to 16 of 16

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by johnmiller View Post
    I don't think pasting 80 pages will do any good
    I really don't understand what's wrong with my code
    And I guess neither will we...

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


    Did you find this post helpful? Yes | No

    Default

    here's the plan... shrink the whole thing and test with a simple program... simple main loop (led blinking or else) + USART INT. Then post the whole new thing.
    Steve

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

  3. #3
    Join Date
    May 2007
    Posts
    17


    Did you find this post helpful? Yes | No

    Thumbs up

    Ok. I managed to do my work with this (after a lot of struggle) but it works. Hope this code will help somebody in the future

    PS: Thanks guys for the help

    Code:
    ReadSerial:
       DataRec var byte[6]
       for counterB=0 to 5
           DataRec(counterB)=0
           next counterB
       
       While CounterA <= 254
            HSERIN [serdata2]
            DataRec(0)=DataRec(1)
            DataRec(1)=DataRec(2)
            DataRec(2)=DataRec(3)
            DataRec(3)=DataRec(4)
            DataRec(4)=DataRec(5)
            DataRec(5)=serdata2
            
            IF DataRec(0)=$20 AND DataRec(2)="K" AND DataRec(3) = "E" AND DataRec(4) = "Y" THEN
               ' Parse serial data (command entered)
               SerData(CounterA) = serdata2
               CounterA = CounterA + 1
            endif
       wend
    
       FOR COUNTERB=0 to COUNTERA
            SEROUT2 SerWRT,16416,[SerDATA(COUNTERB), 10, 13]
            NEXT COUNTERB
       Goto MainLoop

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


    Did you find this post helpful? Yes | No

    Default

    While / Wend was in the bug list right?

    Seems good to me.
    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. 18F2480 asm interrupt
    By Richard Storie in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th March 2009, 19:40
  4. Serial Question + General Review
    By Freman in forum General
    Replies: 2
    Last Post: - 20th June 2008, 22:27
  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