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.




Bookmarks