Today 00:53
Forum: Projects discussion
Starter: towlerg
Views: 0
Replies: 0
Today 00:36
Forum: Projects discussion
Starter: steyn
Views: 0
Replies: 6
Yesterday 23:27
Forum: The Lounge
Starter: basparky
Views: 0
Replies: 12
Yesterday 22:34
Forum: Proton Plus Compiler v3
Starter: charliecoultas
Views: 0
Replies: 1
Yesterday 19:18
Forum: Proton Plus Compiler v3
Starter: evoortman
Views: 0
Replies: 2
Yesterday 18:21
Forum: Proton Plus Compiler v3
Starter: xldaedalus
Views: 0
Replies: 36
Go to last post By: yvesmazzon
Yesterday 16:43
Forum: The Lounge
Starter: rverm
Views: 5528
Replies: 12
Yesterday 16:34
Forum: Proton Plus Compiler v3
Starter: gtv_pic
Views: 0
Replies: 10
Yesterday 15:31
Forum: Absolute Beginners Section
Starter: amod
Views: 0
Replies: 13
Yesterday 13:05
Forum: Proton Plus Compiler v3
Starter: evoortman
Views: 0
Replies: 20
+ Reply to Thread
Results 1 to 9 of 9

Thread: Serout pace time and stopbit setings143 days old

  1. #1
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    401
    Thumbs Up
    Received: 40
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Serout pace time and stopbit setings

    In Serout I want to set 'pace' time.

    (Declare Rsout_Pace 0 to 65535 microseconds (us) page 148 but this is for Rsout.)

    But if I choose pace (time) is 1, it is in milisecond (ms) instead of microseconds (us).
    I need pace is 52 us and not ms,

    Otherwise how can I select 2 stopbits, because I need 2 stopbits instead of one, or is pace (time) in ms and not in us.
    I can't use Hserout because of the use of I2C.

    Serout itself works but stopbit eq. pace time is not in range.

    Henk.

  2. #2
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,826
    Thumbs Up
    Received: 161
    Given: 158
    Total Downloaded
    3.20 GB

    1 Not allowed!

    Default Re: Serout pace time and stopbit setings

    From the manual -

    Serout PORTA.0, 16468, 1000, ["Send this message Slowly"]
    Here, the PICmicro™ transmits the message "Send this message Slowly" with a 1 second delay
    between each character.
    So its either ms. or a typo.


    Also -

    A good reason to use the Pace feature is to support devices that require more than one stop
    bit. Normally, the PICmicro™ sends data as fast as it can (with a minimum of 1 stop bit between
    bytes). Since a stop bit is really just a resting state in the line (no data transmitted), using the
    Pace option will effectively add multiple stop bits. Since the requirement for 2 or more stop bits
    (on some devices) is really just a minimum requirement, the receiving side should receive this
    data correctly.

    At 9600, 52us. is half a bit.

    Is it possible to use RSout? You're still stuck with 1 stop bit but Pace should be in us.

    Alternately if you're only outputing, a bit bang routine with 2 stops realy isn't that hard to write, it's input that's the pain in the arse.
    George

  3. #3
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    401
    Thumbs Up
    Received: 40
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Serout pace time and stopbit setings

    Thanks George.

    Nope pace is ms, because if I fill in 52, my scope and LA (Logic Analyzer) says both 52ms instead of 52us,
    so we can send a mesage "Hello" and "World" more than 65 seconds in between.

    The Baudrate I use is 19200 so I have 52us bits.

    The serial input is even more difficult, because it is the same serial dataline!
    So I must detect $10 LF (line Feed, this is always the last command) in it's two-way comm. form.

    So I must rely on soft serial comm. and not on hardware (EUSART).

    I dig in RSout and RSin.

    Henk

  4. #4
    Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    379
    Thumbs Up
    Received: 68
    Given: 0
    Total Downloaded
    118.16 MB

    1 Not allowed!

    Default Re: Serout pace time and stopbit setings

    The serial input is even more difficult, because it is the same serial dataline!
    For serial input it really doesn't matter if the sender is using 2 stop bits or not... you'll receive the data just fine with the RX set to 1 stop bit.

  5. #5
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,826
    Thumbs Up
    Received: 161
    Given: 158
    Total Downloaded
    3.20 GB

    0 Not allowed!

    Default Re: Serout pace time and stopbit setings

    For serial input it really doesn't matter if the sender is using 2 stop bits or not... you'll receive the data just fine with the RX set to 1 stop bit.
    My point was that writing a bit bang output async routine in any format is trivial compared with a bit bang async input routine.
    George

  6. #6
    Member tumbleweed's Avatar
    Join Date
    May 2011
    Posts
    379
    Thumbs Up
    Received: 68
    Given: 0
    Total Downloaded
    118.16 MB

    0 Not allowed!

    Default Re: Serout pace time and stopbit setings

    You sure got that right, George.

    Bit-banged async input is almost always a recipe for disaster.

  7. #7
    Prolific Poster towlerg's Avatar
    Join Date
    Mar 2012
    Posts
    1,826
    Thumbs Up
    Received: 161
    Given: 158
    Total Downloaded
    3.20 GB

    0 Not allowed!

    Default Re: Serout pace time and stopbit setings

    Nope pace is ms
    The example I posted showed it was ms.

    Maybe you should describe what you're trying to do, maybe the brains trust can help.
    George

  8. #8
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    401
    Thumbs Up
    Received: 40
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Serout pace time and stopbit setings

    Maybe you should describe what you're trying to do, maybe the brains trust can help.
    Oh dear, I have a few grey brain cels, and I have confused RsOut with Serout, pace, it seems those two are totaly different.
    I think, I have ms and us for both, pace, but the truth is if you using RsOut or Serout.

    But the RsOut part is working now (due to the 2 Stopbit problem), and is solved.
    The AXA-Remote is now finally working directly with the 26K22, with this try-out.
    It will be implemented when everything is bug free, but in this setup I use a Wall-switch comm. and the push-button are going to the PIC™
    that was the easy part. (readon further in my other topic)

    But the RsIn must now been investigated on the same port.
    I hope that port in/out can be inplemented RsIn/RsOut on the same pin (likewise PulseIn/PulseOut).

    I use one I2C level-converter with BSS138 Fet, it works also fine for serial applications (one channel now)
    7.5Volt is being translated to 5Volt for the 26K22.

    Henk.
    Last edited by Henk57; 23rd June 2018 at 18:41.

  9. #9
    Senior Member Henk57's Avatar
    Join Date
    Jan 2014
    Posts
    401
    Thumbs Up
    Received: 40
    Given: 35
    Total Downloaded
    192.60 MB

    0 Not allowed!

    Default Re: Serout pace time and stopbit setings

    Well RsIn was the easy part, next to RsOut.

    Only I must still playing with masking bits and timing in uSec, but thats for next week.
    Then tweak and implement in the existing code.

    So it works on one PORT RsIn/RsOut, with the cheap and easy of I2C level converter board,
    with one BSS138 and 2 10K resistors.

    I'm happy again.

    Henk.

Thread Information

Users Browsing this Thread

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

     

Similar Threads

  1. Serout
    By jaygoldie in forum The Lounge
    Replies: 1
    Last Post: 18th July 2007, 15:41
  2. serout
    By ADLIN SYSTEMS in forum Wish List / Product Feedback
    Replies: 0
    Last Post: 28th August 2004, 02:20

Members who have read this thread : 26

Actions :  (Set Date)

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

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