SERIN2 @ 38400 @ 40mhz


Closed Thread
Results 1 to 9 of 9
  1. #1
    skimask's Avatar
    skimask Guest

    Default SERIN2 @ 38400 @ 40mhz

    I'm away from the house for a couple of months, don't have access to any 'scopes, counters, and all the other gadgets...

    I'm trying to get SERIN2 to work at 38,400 baud and having a rough time getting it to be consistent. My PC talks to the unit at 38,400 just fine, but the PIC doesn't. I'm thinking the timing might be just far enough off to cause problems. I can go the hardware route no problem, but the character/string handling capabilities of SERIN2 make it a lot easier to work with for now.

    Anyways, here's what I'm trying to use right now:
    SERIN2 configs - 1,000,000 / 38,400 = 26; 26 - 20 = 6, that's the mode number if I define OSC 40.

    I'm thinking if I do this instead:
    1,000,000 / 3,840 = 260 - 20 = 240, there's the new mode number if I define OSC 4 and change the rest of the program accordingly to match the new OSC define (or at least use some other OSC define value that makes a nice multiple of 38,400 baud).

    I'm wondering if somebody could try these two options on a 'scope and see which one is closer to the actual 38,400 baud.

  2. #2
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    pssst... PicMultiCalc do this for you

    http://www.mister-e.org/pages/utilitiespag.html

    But frankly, i would use DEBUG instead if you don't need multiple serial ports.

    If you use the internal OSC... you better forget it...
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  3. #3
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    pssst... PicMultiCalc do this for you
    http://www.mister-e.org/pages/utilitiespag.html
    But frankly, i would use DEBUG instead if you don't need multiple serial ports.
    If you use the internal OSC... you better forget it...
    Right, I know about the PicMultiCalc, works like a champ.

    If I use the hardware UART on the PIC, a modified version the software works great, but I lose the ability to use SERIN2's character handling capability, which is really handy.
    This tells me that possibly the SERIN2 runs just a bit off spec at 38,400 baud.

    When I get the software finished up, I'll permanently switch over to the hardware port and write my own routines to handle strings and such as needed.

    Internal OSC? Obviously the only time I trust that is at 2400 and below, without calibrating anyways. After calibration, I've used it successfully up to 115,200.

  4. #4
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by skimask View Post
    ... but I lose the ability to use SERIN2's character handling capability, which is really handy.
    As far as I know, HSERIN does everything SERIN2 does. STR DEC HEX BIN etc.

    What's missing?
    <br>
    DT

  5. #5
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Darrel Taylor View Post
    As far as I know, HSERIN does everything SERIN2 does. STR DEC HEX BIN etc.

    What's missing?
    <br>
    DOH! Forgot about HSERIN.
    You're right, nothing missing, any software timing differences aren't a factor...

    The serial port pins are already used up by another serial interface running at the same speed, but much less critical. I'll just have to do some rewiring. I don't know why I wired it like that in the first place

  6. #6
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Default

    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  7. #7
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post
    SWEET! At least I have a manual

  8. #8
    Join Date
    Sep 2004
    Location
    montreal, canada
    Posts
    6,898


    Did you find this post helpful? Yes | No

    Wink

    ROFL, so you're one of the few having it here AND you missed ...
    Quote Originally Posted by TFM
    HSERIN supports the same data modifiers that SERIN2 does.
    ???

    Just kidding
    Last edited by mister_e; - 29th January 2007 at 04:16.
    Steve

    It's not a bug, it's a random feature.
    There's no problem, only learning opportunities.

  9. #9
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by mister_e View Post

    Eeeeese a good ONE !
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Similar Threads

  1. N-Bit_MATH
    By Darrel Taylor in forum Code Examples
    Replies: 38
    Last Post: - 16th December 2010, 14:48
  2. High Resolution Timer & Speed Calculator
    By WOZZY-2010 in forum Code Examples
    Replies: 4
    Last Post: - 7th February 2010, 16:45
  3. STATUS re-curtain W
    By zugvogel1 in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 13th February 2005, 15:21
  4. help
    By zugvogel1 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 9th February 2005, 20:42
  5. Need once your help one please
    By zugvogel1 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 9th February 2005, 20:33

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