Interrupt driven Buffered Serial Input


Results 1 to 16 of 16

Threaded View

  1. #10
    Join Date
    May 2007
    Posts
    17


    Did you find this post helpful? Yes | No

    Default

    I tried your code, and now I tried the one above and still does not work
    Code:
    ReadSerial:
       DataRec var byte[5] : DataRec = 0
       
       While CounterA <= 55
            HSERIN [serdata2]        'save serial port data right away
            if serdata2 = $13 THEN
               i = 0
               KP = 1
            ENDIF
            if KP = 1 then
               IF i=5 THEN
                  SerData(CounterA) = serdata2
                  CounterA = CounterA + 1
                  KP = 0
               endif
               i = i + 1
            endif
       wend
    
       FOR COUNTERB=42 to COUNTERA
            SEROUT2 SerWRT,16416,[hex2 SerDATA(COUNTERB), 10, 13]
            NEXT COUNTERB
       Goto ReadReadyLoop
    I tried this one as well and it doesn't work either:
    Code:
        SERIN2 [WAIT($20), SKIP 4, serdata2]
    PS: it doesn't work it's like the pic is not reading the data fast enough. It is supposed to read the data from a keyboard that than sends data over a serial link at 19200 (not inverted).

    All the above codes work if I press a key once per second or so, but they don't work any faster. Anybody can tell me why
    Last edited by johnmiller; - 12th May 2007 at 08:23.

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