Serin baud rate / clock dependency?


+ Reply to Thread
Results 1 to 11 of 11

Thread: Serin baud rate / clock dependency?37 days old

  1. #1
    Junior Member davroski's Avatar
    Join Date
    Mar 2019
    Posts
    18
    Thumbs Up
    Received: 0
    Given: 2
    Total Downloaded
    345.98 MB

    0 Not allowed!

    Default Serin baud rate / clock dependency?

    Can anyone help regarding the range of baud rates I should expect to be able to set with a 32MHz clock?

    I am aware of the baudmode calculation steps in the Proton manual. It cryptically says "depending on the crystal frequency used" but I can't see any text expanding on this implied limitation.

    I want to run 300 Bd Serin with a 32 MHz clock. If this isn't possible what's the highest clock speed that will support 300 Bd?

    Thanks

Attention

This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

The advertisements we display are relevant to this web site and your browsing history

Please consider supporting us by disabling your ad blocker.


Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

If you can, please report issues in the forum area WebSite / Forum Issues


Thank you for your attention.

  • #2
    Prolific Poster RGV250's Avatar
    Join Date
    Aug 2005
    Posts
    2,326
    Thumbs Up
    Received: 29
    Given: 7
    Total Downloaded
    802.58 MB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    Hi,
    Just realised, I think this is only for hardware serial.

    You did not say what device you are using so it may not have 16 bit BRG.
    The calculator I have came up with this.
    ;Calculated Baudrate = 300 @ Xtal 32MHz, Error = 0.00%
    Declare Hserial_RCSTA = 144 ; Enable continuous receive
    Declare Hserial_TXSTA = 32 ; Enable transmit, BRGH = 0
    Declare Hserial_Clear = On ; Clear overflow automatically
    Declare Hserial_SPBRG = 10 ; Baud Rate Generator Low Byte Value
    SPBRGH = 26 ; Baud Rate Generator High Byte Value
    BAUDCON.3 = 1 ; Enable the 16 bit Baud Rate Generator
    Bob

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #3
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,213
    Thumbs Up
    Received: 74
    Given: 180
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    I suspect with a 32Mhz clock the limiting factor would be the accuracy of the clock. How fast do you want to go?
    George.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #4
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,402
    Thumbs Up
    Received: 290
    Given: 141
    Total Downloaded
    1.68 GB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    The compiler now calculates the Baud rate for you wth the USART commands if you just add the Declare Hserialx_Baud. If you open the Asm window, you can also see the Baud used and the percentage of error associated with it.

    If the Declare TXSTA or Declare RCSTA declares are used in the program, the compiler will not calculate the Baud for you because these overide it.

    With software serial commands, the maximum is about 38400 Baud. That is because higher Baud rates require very small delays in between the bits, so slower devices cannot do this with accuracy.
    Last edited by top204; 12th October 2019 at 20:56.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #5
    Junior Member davroski's Avatar
    Join Date
    Mar 2019
    Posts
    18
    Thumbs Up
    Received: 0
    Given: 2
    Total Downloaded
    345.98 MB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    Thanks for the replies so far.

    Just to re-iterate, I'm talking SOFTWARE serial, with Serin.
    The chip is 16F18344 using (hopefully) internal RC clock @ 32 Mhz.

    I am assuming the clock is accurate enough for error free operation of single bytes.
    The clock could be slower but the baud rate must be 300 Bd.
    Internal clock not negotiable as all external pins are already used.

    I don't know what the clock limits are for Serin as the manual appears lacking in this regard. Accurate higher baudrates would probably be more difficult with slower clocks, and maybe slower baudrates are a problem with faster clocks? (does the mechanism run out of dividing capability at some point?)

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #6
    Junior Member davroski's Avatar
    Join Date
    Mar 2019
    Posts
    18
    Thumbs Up
    Received: 0
    Given: 2
    Total Downloaded
    345.98 MB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    I need a data speed of 300 Bd

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #7
    Prolific Poster John Drew's Avatar
    Join Date
    Feb 2002
    Posts
    2,779
    Thumbs Up
    Received: 83
    Given: 34
    Total Downloaded
    4.30 GB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    Responding to post 5 and the last comment, you won't have any trouble achieving 300 baud. The limits come in at high speeds, not low speeds.
    John

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #8
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,213
    Thumbs Up
    Received: 74
    Given: 180
    Total Downloaded
    5.15 GB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    the maximum is about 38400 Baud
    Wow that's fast. Is that both rx and tx?
    George.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #9
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    485
    Thumbs Up
    Received: 59
    Given: 0
    Total Downloaded
    330.54 MB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    It wouldn't be too difficult to bit-bang a uart faster than 115K. Probably the most important thing with using a software uart is to remember it's a software uart.

    That means anything that can disturb the timing (like interrupts) will screw you up, and reception can be especially tricky...
    if you're not sitting waiting for a byte to come in you likely won't get it.

    They tend to be ok for sending stuff but next to useless trying to receive.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #10
    Junior Member davroski's Avatar
    Join Date
    Mar 2019
    Posts
    18
    Thumbs Up
    Received: 0
    Given: 2
    Total Downloaded
    345.98 MB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    Indeed. I now have 300 Bd working fine using 32 MHz internal clock (which appears plenty accurate enough).
    Fuse cfg settings were : Config1 FEXTOSC_OFF, RSTOSC_HFINT32, CLKOUTEN_OFF
    I now have a SLEEP issue which I'll post separately

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  • #11
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,402
    Thumbs Up
    Received: 290
    Given: 141
    Total Downloaded
    1.68 GB

    0 Not allowed!

    Default Re: Serin baud rate / clock dependency?

    With such a low Baud rate, the internal oscillator is fine.

    The internal oscillator on the newer devices are excellent, and as long as the microcontroller is not going into weather or temperature extremes they are very useful and can cut down on the final cost of a unit. When using an internal oscillator, always have it running at its maximum speed because then any oscillation variencies are small overall. When I use a PIC24 or dsPIC device, I don't bother with an external resonator or crystal because they can run at approx 140MHz with the internal oscillator, so a slight drift in the oscillation has very little, if any, impact on timings. The same with the newer 18F K devices.... The internal oscillator is excellent and when run at 64MHz, the oscillation variencies have very little effect on timings, unless the timings are tiny themselves.

  • Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

    Thread Information

    Users Browsing this Thread

    There are currently 1 users browsing this thread. (0 members and 1 guests)

       

    Similar Threads

    1. Baud rate problem
      By charliecoultas in forum Proton 24
      Replies: 13
      Last Post: 26th January 2019, 09:48
    2. [SOLVED !] Baud rate
      By pepito in forum quickBlue Bluetooth Development
      Replies: 4
      Last Post: 19th July 2007, 23:41
    3. [SOLVED !] baud rate
      By ADLIN SYSTEMS in forum USBWiz
      Replies: 7
      Last Post: 13th August 2006, 09:41
    4. Rs 232 baud rate
      By jackjay2 in forum Wish List / Product Feedback
      Replies: 4
      Last Post: 19th September 2004, 10:14

    Members who have read this thread : 28

    Actions :  (Set Date)

    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