Hserin with Instant Interrupts.


Closed Thread
Results 1 to 18 of 18

Hybrid View

  1. #1
    skimask's Avatar
    skimask Guest

    Default

    Quote Originally Posted by ronjodu View Post
    I'm going to try your method of toggling the LED's Skimask, never seen it done like that, Thanks.
    I like that method of using the heartbeat because it allows for an easy change of blink frequency. The LED 'attached' to a timer works also, but it only tells you that the timer is running and an interrupt is working. Generally, I use 2 heartbeats, one for a mainloop, and one for a timer. Mainloop says the program is looping, timer says the PIC is actually running.

  2. #2

    Default

    From what I see it's mostly a matter of setting up the defines and running getbytes?

    Is this the barebones of what I need to get data in/out of serialdata?

    As long as data is at portc.7 it continuously runs in the background as an input, loading serialdata while any other code is executing?

    I can then sample serialdata when I need to in my code?


    DEFINE LOADER_USED 1
    DEFINE OSC 4
    DEFINE HSER_RCSTA 90h ' enable serial port,
    define HSER_TXSTA 24h ' enable transmit,
    define HSER_SPBRG 25 ' set baudrate to 9600
    DEFINE HSER_CLOERR 1 ' automatic clear overrun error

    TRISC = %10000000 ' PORTC.7 is the RX input, PORTC.6 is the TX output


    ' Serial communication definition


    Getbytes:

    While RCIF = 1 ' clear the buffer
    HSERIN 100,error,[Serialdata] ' take it
    hserout [serialdata] ' send it
    Wend

Similar Threads

  1. Instant Interrupts - Revisited
    By Darrel Taylor in forum Code Examples
    Replies: 772
    Last Post: - 17th February 2016, 22:14
  2. Clock using Instant Interrupts
    By PICpocket in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 16th February 2009, 21:43
  3. Instant Interrupts and HSERIN
    By Rob in forum mel PIC BASIC Pro
    Replies: 26
    Last Post: - 31st January 2009, 05:13
  4. DT instant interrupts with mister_e keypad
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 26th November 2008, 20:02
  5. DT's Instant Interrupts trouble
    By Tomexx in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 24th November 2008, 20:48

Members who have read this thread : 1

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