Best way to use USART/HSERIN


Results 1 to 18 of 18

Threaded View

  1. #1

    Default Best way to use USART/HSERIN

    I'm working on a project where there will be one PIC as a master controller to adjust LED brightness & motor control. I want to link this master PIC to the motor/LED chips via USART in a chain (all by wire on a PCB - no other components involved) and send the mode/speed changes down using a hard-coded ID; each chip down the line will check the ID and if it matches it's own then it acts on it, else it just passes it down the line.

    My question is this - how best to set up HSERIN in a situation like this? Should I use something like this in a Main loop:

    Code:
    Main:
        HserIN [WAIT("OK"),ID]
        IF ID="3" THEN 
            gosub updateLEDs
        ELSE
            HserOUT [data]
        ENDIF
    
        goto Main
    Or would it be better to use Darrel's Instant Interrupts with the Rx interrupt?

    This will be my first time using HSERIN/HSEROUT apart from using it for LCD debugging.
    Last edited by RossWaddell; - 11th February 2013 at 22:00.

Similar Threads

  1. USART to PC
    By tonyfelloni in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 15th October 2008, 00:09
  2. Usart
    By lew247 in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 2nd June 2008, 23:41
  3. Sharing a USART
    By Ron Marcus in forum Serial
    Replies: 1
    Last Post: - 7th September 2005, 14:48
  4. 9 bit addressable USART
    By barkerben in forum General
    Replies: 9
    Last Post: - 4th January 2005, 22:57

Members who have read this thread : 3

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