Comparative advantages?


Closed Thread
Results 1 to 5 of 5

Hybrid View

  1. #1
    Payatronico's Avatar
    Payatronico Guest

    Question I don't know... I doubt

    First.- I don't think that the real factor of importance is the speed, with a 20MHz crystal you can make links in 12000 bauds with serin/out, that's because all the times are calculated for a crystal of 4MHz, for me the real deference between them are the space in the memory, serin/out take more memory than hserin/out.

    The other thing is that with Hserin/out you can receive parity bits and multiple stop bits, with serin/out you only can receive one stop bit and no parity.

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

    Default

    I should probably clear something up here. When I refer to SERIN/OUT, it really means SERIN2 and SEROUT2. I don't even consider the Basic Stamp compatible SERIN and SEROUT to be part of PicBasic Pro. There's absolutely no reason to ever use them, unless you just can't get past the thought of using mode names like N2400 or T9600 like you would with a Basic Stamp.

    And if you are referring to that form of SERIN/OUT then you are correct. You can't use parity's. However, you also can't go above 9600 baud, no matter what crystal you are using.

    But with SERIN2 and SEROUT2, you can get up to 50Kbaud, assuming you have at least a 20mhz crystal, and you can also have either even or odd parity's.

    2 Stop bit's are really meaningless, since those stop bit's will be at the "IDLE" polarity. It simply puts one more "bit period" in-between each byte. Kind of like Char Pacing, without the Pacing. If the data is coming in at 8N2, anything setup for 8N1, will receive it just fine.

    It is true that HSERIN/OUT uses considerably less program space than SERIN2/SEROUT2, simply because most of the work is being done in hardware. But if program space is the main concern, then you might also consider DEBUGIN/OUT, since it has the smallest code size for "software based" serial routines. It is consequently much faster than SERIN2/SEROUT2, I think you can get up to 115200 baud with debug.

    But most important here, is that either SERIN/SEROUT or SERIN2/SEROUT2 is not dependant on the oscillator frequency. The mode numbers are the same for any baud rate. You just have to make sure the oscillator is fast enough to support the desired speed.

    A "complete list of the possible mode settings for PICBASIC PRO's Serin2 and Serout2 commands" can be found here
    http://www.melabs.com/resources/ser2modes.htm
    It also shows the required OSC freq's for each baud rate.

    Although I wouldn't really call it a "Complete" list, since there are many other baud rates that can be achieved with mode numbers that are not listed.

    To find those other baud rates, you can use the formula that's shown in the PBP manual under SERIN2.
    DT

Similar Threads

  1. Advantages of DSPIC over normal PICs?
    By toalan in forum Off Topic
    Replies: 0
    Last Post: - 11th January 2005, 21:05
  2. Advantages of HSerout over Serout2 and a problem
    By rpstroj in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 11th August 2004, 23:19

Members who have read this thread : 0

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