Avoid HSEROUT command?


Closed Thread
Results 1 to 9 of 9

Hybrid View

  1. #1


    Did you find this post helpful? Yes | No

    Default Re: Avoid HSEROUT command?

    Quote Originally Posted by HenrikOlsson View Post
    Hi,
    As long as the HSEROUT statement itself isn't IN an interrupt routine I don't see HOW it can disturb any interrups (as long as you're not using ON INTERRUPT of course but I suspect you're NOT).

    But to answer your question, if you can put all your variables after each other, ie in an array, then a simple FOR-LOOP will do but really, I don't see it being any better than HSEROUT but man have I been wrong before :-)

    /Henrik.
    Hi Henrik,

    I use the DT instant interrupts, i've one main loop, one high-speed high priority interrupt (running at 13kHz and doing some calculations) and one low-priority interrupt (running at 100Hz).

    The HSEROUT command is in the main loop.

    But still, when it sends data at a high rate, the low-priority interrupt is disturbed. I'm running at 2400bps.

  2. #2
    Join Date
    Aug 2003
    Posts
    985


    Did you find this post helpful? Yes | No

    Default Re: Avoid HSEROUT command?

    You’re not taking advantage of hardware serial at all unless you send a byte at a time.
    Otherwise it’s blocking just like software serial. A for next loop sending hardware serial will also block just the same.

    Code:
    atoj var byte[8]
    index var byte
    serbuff var byte
    to send continuously:
    
    mainloop:
    
    ‘ your program
    
    if index > 7 then
    index = 0’
    endif
    
    if index < 8 then
    serbuff = atoj[index]
    hserout[serbuff]
    index = index + 1
    endif
    
    goto mainloop
    Don’t write into the buffer while index is less than 8.

Similar Threads

  1. ADCIN & 16F870 - how to avoid non linear conversion?
    By CuriousOne in forum mel PIC BASIC Pro
    Replies: 12
    Last Post: - 21st March 2014, 09:02
  2. How can I avoid stack corruption
    By BrianT in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 30th August 2013, 03:45
  3. How to avoid DIV32 command?
    By pxidr84 in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 16th May 2011, 07:11
  4. How to avoid corrupting an EEPROM Write
    By jessey in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 6th July 2005, 09:34
  5. 16F877 and Hserout command
    By fbestepe in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 29th May 2004, 11:30

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