max baudrate serout2 command


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251

    Default max baudrate serout2 command

    How far can I go with the serout2 (serin2) command ?
    I use the pic16f628 with 20mHz xtal

    My programm looks like

    DEFINE SER2_BITS 8

    serout2 pinout,32,[mydata]

    SerIn2 PININ,32,50,BEGIN,[WAIT("$"),B1]

    If I lower the 32, the baudrate becomes faster.
    How fast can I go ?
    is it possible to get 250 Kbaud ?

    Thanks in advance.

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Why not try it with Hyperterminal on your PC... it has configurable options at 115200, 230400, 460800 and 921600 baud (at least the win-XP-Pro version goes that high).

  3. #3
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Sure Melanie,
    But the problem is not windows.
    I want to get my PIC chip faster, I know that my hyperterminal can go faster, but my application on my picchip must go also faster.
    I do not know how I come faster than 38 K.
    Thanks in advance.

  4. #4
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    There are a number of things you can do...

    1. If you want to use the SOFTWARE Serial options then you pretty much run out of steam at 38k unless you trick PBP...

    If you DON'T tell PBP that your OSC is 20MHz (it assumes 4MHz), then the formula changes and everything runs exactly 5x faster... The setting you had for 38k will now be 38k x 5. 9600 baud will be 48000 etc etc. Of course all other timing critical commands will be 5x faster too... Pause 1000 will only time for 200mS etc etc.

    So... use available Hardware...

    2. Use the hardware USART (if your PIC has one). It can hit 1.25Mb with a 20MHz xtal.

    3. To minimise (zero is pretty minimal) communication errors at all standard baud rates, run your PIC with a 22.1184MHz (or 11.0592MHz) Crystal. These are known as BAUD RATE CRYSTALS and being a multiple of standard baud rates produce zero errors. Unfortunately, PBP doesn't provide an option for those baud rates, therefore there will be a timing error in other software commands (such as Pause etc) but choosing something close will minimise those and you can calculate the difference mathamatically and adjust accordingly.

  5. #5
    Join Date
    Oct 2003
    Location
    holland
    Posts
    251


    Did you find this post helpful? Yes | No

    Default

    Thank you Melanie.
    I will try the to use the usart directly who is inside my chip.

Similar Threads

  1. Active low input?
    By CosMecc in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 8th August 2010, 20:31
  2. About USB
    By dias11 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 3rd December 2009, 20:41
  3. Serout and 18F87J50
    By Glenn_Webber in forum Serial
    Replies: 8
    Last Post: - 20th November 2009, 14:26
  4. SLOW Serin2 and Serout2
    By dragons_fire in forum General
    Replies: 3
    Last Post: - 26th June 2009, 02:38
  5. Can I do this???
    By noobie in forum mel PIC BASIC
    Replies: 2
    Last Post: - 10th June 2006, 18:57

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