SERIN/SEROUT how low can you go?


+ Reply to Thread
Results 1 to 10 of 10

Thread: SERIN/SEROUT how low can you go?244 days old

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

    0 Not allowed!

    Default SERIN/SEROUT how low can you go?

    (PIC is 16F18344 on 32 MHz internal clk).

    I want to use SERIN/SEROUT (hardware UART already in use) at lower than 300 bd - preferably as close to 100 Bd as possible. Actual speed not important as long as SERIN and SEROUT work together - which is my problem. Lower than 300 Bd, somewhere the formula fails. I can send down to around 140 Bd but receive fails using SERIN. Not knowing the internals of the code, and where the wrap rounds occur I'm not sure of the limits or what's reliable. I don't want to get into writing my own software uart, though my own choice of bit length could be useful as I need more than 8 but less than 16.
    If anyone could offer baudrate guidance it would be appreciated. (to re-iterate, everything works fine at 300 Bd so the set up is good, it's just speeds below that I'm struggling with). Thanks.

  2. 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. #2
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,373
    Thumbs Up
    Received: 87
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    Is it an option to degrees the 32MHz clock?
    George.

  4. 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. #3
    Junior Member davroski's Avatar
    Join Date
    Mar 2019
    Posts
    36
    Thumbs Up
    Received: 1
    Given: 2
    Total Downloaded
    423.52 MB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    possibly if that's a limit to the lowest speed - 32 keeps clock noise mostly out of HF range

  6. 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. #4
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,373
    Thumbs Up
    Received: 87
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    Oops just reread your first post. Sorry can't help except that manual seems to say that any baud 0-65535 will work. Maybe try Rsin/Rsout?
    Last edited by towlerg; 13th December 2019 at 14:40.
    George.

  8. 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. #5
    Senior Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    535
    Thumbs Up
    Received: 61
    Given: 0
    Total Downloaded
    446.24 MB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    George has a good suggestion.

    From what I can tell, SEROUT bottoms out at about 130, and it doesn't seem to really matter if it's running at 32MHz or slower.
    RSOUT works at 100 baud (no idea about RSIN).

    though my own choice of bit length could be useful as I need more than 8 but less than 16
    That's going to be a problem. What in the world are you interfacing to?

  10. 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. #6
    Junior Member davroski's Avatar
    Join Date
    Mar 2019
    Posts
    36
    Thumbs Up
    Received: 1
    Given: 2
    Total Downloaded
    423.52 MB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    Hi, thanks for the comments. I'd not thought of exploring any differences with RSOUT (8N1 is fine). Wood for the trees - I tend to use SERIN/OUT for software serial but RSOUT seems easier to tweak values.
    Noted re clock speed.
    I'm passing control data over a power line (12V not mains) and trying to balance simplicity with reliability but keeping the data frame duration short as possible while limiting data harmonics hence lower speed. PIC at each end.
    Thanks

  12. 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.

  13. #7
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    2,373
    Thumbs Up
    Received: 87
    Given: 183
    Total Downloaded
    5.30 GB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    though my own choice of bit length could be useful as I need more than 8 but less than 16
    If that's the case, roll your own bit bang then you can go as slow as you want any combination of stop, start, data and parity. You could even add a few bits and get a checksum. I'm sure you'll find similar code somewhere on the board.

    Sounds like a hairy project.
    George.

  14. 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.

  15. #8
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,687
    Thumbs Up
    Received: 357
    Given: 173
    Total Downloaded
    2.00 GB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    The calculation for the Baud value for Serin and Serout is on page 240 of the compiler's manual.

    The calculation can be made into a pre-processor $define for easy access:

    Code:
    '
    ' Calculate the standard Baud value for Serin and Serout
    ' 
        Device = 16F1939                                    ' Use an enhanced 14-bit core deive that can operate at 32MHz
        Declare Xtal = 32
       
        $define cBaud 125                                   ' The Baud Rate required
        $define cBaudVal $eval ((1000000 / cBaud) - 20)     ' The Baud value for Serin and Serout
    
    '-------------------------------------------------------
    ' Then main program starts here
    '     
    Main:
        Do                                                  ' Create a loop
            SerOut PORTC.6, cBaudVal, ["Hello", 13]         ' Transmit text to a serial terminal
            DelayMS 200                                     ' A small delay between texts
        Loop
    With tests, the lowest Baud Rate is 125 Baud, otherwise the calculation overflows the library routine's 16-bit value calculation codes.

  16. 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.

  17. #9
    Junior Member davroski's Avatar
    Join Date
    Mar 2019
    Posts
    36
    Thumbs Up
    Received: 1
    Given: 2
    Total Downloaded
    423.52 MB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    Many thanks for for that programming tip and for confirming the 125 limit

  18. 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.

  19. #10
    Junior Member JonW's Avatar
    Join Date
    Dec 2019
    Posts
    13
    Thumbs Up
    Received: 1
    Given: 0
    Total Downloaded
    232.03 MB

    0 Not allowed!

    Default Re: SERIN/SEROUT how low can you go?

    Hi Davroski

    Rather than sending serial data with a UART, a well known robust comms method of data transfer over powerline (9 - 30V) is Diseqc. Its was/still is used in most STB/LNB applications. Check out Eutlesat website for the encoding but in basic terms its a 1/3 bit timing protocol based around 22kHz carrier. Harmonics are low as you use a fairly narrow band hi impedance circuit for the slave and master power supply, naturally filtering the harmonics via the tank circuit and low ESR caps (both master and slave have specific high impedance at the frequency of comms, they are a parallel Hi Z @ modulation frequency, so outside this the ESR of the caps dominate as the impedance falls to zero :-) ). To modulate you sink current at 22khz for the master and you can easily control the slew and harmonics via a simple RC to produce a Psuedo Sinewave to reduce harmonics. It sounds complex but it really isn't, it uses a few inductors and around 4 bipolar transistors to work. Its very cheap and easy to code and i have routines that use the PWM for Master and one I/O for the slave plus a simple amp and envelope detector circuit for receive, you can easily bit bash the TX or use a logic gate with RC feedback and gate it for the 22k carrier. The code rate to the carrier is low and hence the comms robust. It works on 200 - 600mV riding on the PSU.

    The simplest method is to envelope detect the burst as this makes the decoding much simpler and other tasks can be serviced but if cost is imperative, you can detect the 22k direct via comparators on the mcu but this usually requires very tight coding and timing. Its not limited to 22k either, it can be scaled much higher/Lower frequencies but you need to pay attention to both master and slave power supply impedance's as these will shunt the signal and can cause ringing if not snubbed in very long cable runs.

    Another method if speed is needed is FSK, similar in terms of PSU impedance concerns but data transfer in tens of kilobits is easily done. Both can be simplex or semi duplex with FSK fully duplex if needed, speed will obviously depend on your cable medium (Coax, twisted pair etc)

    Serial can work but depending on the data rate you will find it more difficult to get the data on the cable (modulate). If you are hell bent on serial then Manchester code the comms as this will be much more robust but will reduce your effective bitrate by 2.

    Jon
    Last edited by JonW; 27th December 2019 at 23:18.

  20. 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. SERIN-SEROUT Problem
    By craig in forum Proton Plus Compiler v3
    Replies: 4
    Last Post: 26th November 2011, 07:14
  2. How to use at the best FPIN in SEROUT/SERIN.
    By wirecut in forum Proton Plus Compiler v3
    Replies: 0
    Last Post: 8th February 2010, 12:43
  3. [SOLVED !] Serout Serin
    By Yoepieyoep in forum Proton Plus Compiler v3
    Replies: 3
    Last Post: 20th February 2009, 08:24
  4. Serin / Serout
    By joesaliba in forum Proton Plus Compiler v3
    Replies: 20
    Last Post: 19th August 2008, 16:38
  5. Serin Serout
    By geraintwalesuk in forum Proton Plus Compiler v3
    Replies: 23
    Last Post: 19th February 2006, 07:50

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts