Serial and interrupt


Closed Thread
Results 1 to 21 of 21

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    You just don't want to use a Software bit banged solution with interrupt. Move on a PIC with Real Hardware USART and use USART inetrrupt.

    It might be doable with your PIC, but on slower baudrate, using ASM interrupt (maybe instant interrupt), and an home made serial routine. No way this might work 100% properly with ON INTERRUPT even more with internal OSC.

    You could still try something and reduce your delay, using short PAUSEUS loop might work better.

    Using DEBUGIN would also help.

    If you build yourself the Master you could send few garbarge data, then a Synch character, then your data. Says
    SEROUT2 ....[REP 0\32, "~", YourData]

    on the receiver side you just use WAIT("~") ... might work.....
    Last edited by mister_e; - 4th February 2009 at 22:19.
    Steve

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

  2. #2
    Join Date
    Feb 2009
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    The thing is that it's kinda to late to change the pic for my current project

    Well it seems that I will be coding my own serial routine after all...

    In what way is the debugIN function different except the syntax?

    Do you have some more info about instant interrupt? Something to get me started.

    Anyway thanks for the help

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


    Did you find this post helpful? Yes | No

    Default

    DEBUGIN works better on higher baudrate on Slower Speed OSC. Check your manual about that. Syntax is a bit different as well.

    Instant-Interrupt
    http://darreltaylor.com/DT_INTS-14/intro.html
    Steve

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

  4. #4
    Join Date
    Feb 2009
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    Before posting posting to this forum I tried "DT_INTS-14" but I got some compailing errors, any idea how to fix them?

    Code:
    wsave3 position request 416 beyond RAM_END 95
    wsave2 position request 288 beyond RAM_END 95
    wsave1 position request 160 beyond RAM_END 95
    Unable to fit variable RS2_Save

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


    Did you find this post helpful? Yes | No

    Default

    open DT_INTS-14.bas file, there you'll find
    Code:
    ' --- IF any of these three lines cause an error ?? ---------------------------- 
    '       Comment them out to fix the problem ----
    ' -- It depends on which Chip you are using, as to which variables are needed --
    wsave1      var byte    $A0     SYSTEM      ' location for W if in bank1
    wsave2      var byte    $120    SYSTEM      ' location for W if in bank2
    wsave3      var byte    $1A0    SYSTEM      ' location for W if in bank3
    So, just modify it as requested
    Code:
    ' --- IF any of these three lines cause an error ?? ---------------------------- 
    '       Comment them out to fix the problem ----
    ' -- It depends on which Chip you are using, as to which variables are needed --
    ;wsave1      var byte    $A0     SYSTEM      ' location for W if in bank1
    ;wsave2      var byte    $120    SYSTEM      ' location for W if in bank2
    ;wsave3      var byte    $1A0    SYSTEM      ' location for W if in bank3
    Steve

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

  6. #6
    Join Date
    Feb 2009
    Posts
    12


    Did you find this post helpful? Yes | No

    Default

    So I did and now there's only one error left...
    Code:
    Unable to fit variable RS2_Save

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


    Did you find this post helpful? Yes | No

    Default

    well, seems we hit one of the limitation of the low-end PIC. In this case, asm INT and home made serial routine would work. 12F683 would provide better range.


    Let's see what Darrel would suggest...
    Last edited by mister_e; - 4th February 2009 at 22:52.
    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. 18F2480 asm interrupt
    By Richard Storie in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 5th March 2009, 19:40
  3. Serial and Port B interrupt
    By Pic2008 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 6th November 2008, 16:22
  4. timer and serial interrupt
    By yourmomOS in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 14th July 2006, 18:02
  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