Today 12:13
Forum: The Lounge
Starter: Tim
Views: 0
Replies: 2
Yesterday 22:00
Forum: The Lounge
Starter: Henk57
Views: 0
Replies: 105
+ Reply to Thread
Results 1 to 4 of 4

Thread: serial comms interrupts and timers342 days old

  1. #1
    Junior Member davroski's Avatar
    Join Date
    Sep 2004
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    225.14 MB

    0 Not allowed!

    Default serial comms interrupts and timers

    Does anyone know which if any timers are used on an 18F device (18F1320 actually) when using rsin or hrsin? I need to use two of its four timers both of which need to generate interrupts but I also need to use one form of serial input - hardware or software doesn't matter, and receive only. My interrupt routine works fine until I include comms in the main loop. The manual is not very clear on what internal resources such functions as comms uses.

  2. #2
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Thumbs Up
    Received: 55
    Given: 86
    Total Downloaded
    884.13 MB

    0 Not allowed!

    Default Re: serial comms interrupts and timers

    Some basics

    Do do not use any commands that take time in an interrupt routine. eg delayxx, rsin, rsout, busout etc

    When you have interrupts you basically should not use any software based coms or time dependant critical commands.

    Hrsin is ideal for an interrupt driven coms system. If you do not want interrupt driven coms then use hrsin as its should cope with interrupts as long as they do not take long to service.

    IMHO use interrupts for timers, coms etc then do basic stuff in the main routine. In essence just waiting for the interrupt routine to say to do something.

  3. #3
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Thumbs Up
    Received: 150
    Given: 151
    Total Downloaded
    2.83 GB

    0 Not allowed!

    Default Re: serial comms interrupts and timers

    Just to expand on Tim's post, good practice is to set/clear flags in the ISR and service those flags in the main loop.

  4. #4
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Thumbs Up
    Received: 98
    Given: 21
    Total Downloaded
    1.35 GB

    0 Not allowed!

    Default Re: serial comms interrupts and timers

    To find out which resources are used look at the .lst file.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)


Similar Threads

  1. trying to measure rpm (time) using interrupts and timers
    By lemans in forum Projects discussion
    Replies: 31
    Last Post: 1st July 2012, 21:08
  2. Serial Comms
    By Cruster in forum The Lounge
    Replies: 0
    Last Post: 20th March 2008, 11:32
  3. help with serial comms problem
    By richardy in forum Proton Plus Compiler v3
    Replies: 11
    Last Post: 4th April 2007, 09:41
  4. Serial Comms?
    By Cruster in forum The Lounge
    Replies: 11
    Last Post: 16th November 2006, 15:45
  5. Serial Comms for Delphi
    By C_Moore in forum The Lounge
    Replies: 10
    Last Post: 28th June 2006, 23:12

Members who have read this thread since 15th July 2018, 13:19 : 0

Actions :  (Set Date)  (Clear Date)

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