Serout2 and Interrupts 16F88


Closed Thread
Results 1 to 15 of 15

Hybrid View

  1. #1
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Serout2 and Interrupts 16F88

    I was thinking you were driving the LCD in 4 bit parallel mode. In your case, I would run my 16F88 at 20MHz and use DEBUGOUT at 57600 baud for one of the serial ports. DEBUGOUT has way lower overhead than SEROUT2. It takes less time to set up for the write and also allows you to run at
    higher baud rates than SEROUT2.
    Charles Linquist

  2. #2
    Join Date
    Sep 2005
    Location
    Campbell, CA
    Posts
    1,107


    Did you find this post helpful? Yes | No

    Default Re: Serout2 and Interrupts 16F88

    And before I shut up tonight, with a little ASM, you wouldn't have to turn off interrupts at all.

    Just download and include one of the (fairly) easy to find RS-232 ASM routines. Run it at 57600 baud. Set up a one-byte buffer. Have the PWM ISR check for a "buffer full" flag. If set, it jumps to the RS-232 routine and sends the byte, and when that routine is done sending the byte, it clears the "buffer full" flag. Since your PWM ISR is running at 2Khz, you have 500uSec between interrupts. But you can send a byte (at 57600) in 180uSec. Plenty of time.


    Your main program loop could then just check the buffer full flag. If it wasn't set, it would write a byte the the buffer.

    No stopping interrupts, and no corrupted data.
    Charles Linquist

  3. #3


    Did you find this post helpful? Yes | No

    Default Re: Serout2 and Interrupts 16F88

    Thanks for the ideas all. What is the max baud rate for debug? can it do 115200? It seems to compile ok i could not find a supported baud rate list.

  4. #4
    Join Date
    Nov 2003
    Location
    Wellton, U.S.A.
    Posts
    5,924


    Did you find this post helpful? Yes | No

    Default Re: Serout2 and Interrupts 16F88

    Dave
    Always wear safety glasses while programming.

  5. #5
    Join Date
    Jul 2003
    Posts
    2,405


    Did you find this post helpful? Yes | No

    Default Re: Serout2 and Interrupts 16F88

    Can't you use hardware PWM?
    Regards,

    -Bruce
    tech at rentron.com
    http://www.rentron.com

  6. #6


    Did you find this post helpful? Yes | No

    Default Re: Serout2 and Interrupts 16F88

    Quote Originally Posted by Bruce View Post
    Can't you use hardware PWM?
    Already in use doing a seperate 20khz signal.

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