Today 18:51
Forum: Proton Plus Compiler v3
Starter: AlbertoFS
Views: 0
Replies: 29
Go to last post By: charliecoultas
Today 14:42
Forum: Proton 24
Starter: charliecoultas
Views: 0
Replies: 5
Today 12:28
Forum: GPS
Starter: AlbertoFS
Views: 0
Replies: 8
Today 00:00
Forum: Proton Plus Compiler v3
Starter: analogdevice
Views: 0
Replies: 1
+ Reply to Thread
Results 1 to 4 of 4

Thread: serial comms interrupts and timers7 days old

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

    0 Not allowed!

    Default serial comms interrupts and timers

    Hi
    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.
    Thanks

  2. #2
    Fanatical Contributor Tim's Avatar
    Join Date
    Jan 2003
    Posts
    7,843
    Thumbs Up
    Received: 47
    Given: 85
    Total Downloaded
    806.72 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.
    Tim

  3. #3
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,209
    Thumbs Up
    Received: 47
    Given: 100
    Total Downloaded
    2.20 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.
    George

  4. #4
    Prolific Poster hadv215's Avatar
    Join Date
    Sep 2009
    Posts
    1,022
    Thumbs Up
    Received: 84
    Given: 16
    Total Downloaded
    831.56 MB

    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. [SOLVED !] 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 : 30

Actions :  (Set 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