if i wanted to connect the bs2p40 to a video overlay device using a serial cable which pins would i need to use?· Sout and Sin only work connecting to the computer?
If you use SERIN and SEROUT, you can use SIN and SOUT on any pin(s) 0 through 15.· If you want to use SIN and SOUT, you can specify 16 as the pin.· Then you can use the same serial port on the stamp that you would normally use for programming - keep in mind that doing this can make debugging difficult, since it will conflict with DEBUG statements.
One other caveat about using SERIN/SEROUT to pin port 16. I stand to be corrected, but as I remember, the BAUDMODE is LOCKED IN to that of DEBUG (9600, 8, N, 1). Said differently BAUDMODE will be ignored if pin port 16 is used. This is a somewhat hidden aspect of using it, and thus why I mention it. It may not be a problem however, depending on the application.
You can use the programming port (pin 16) at any baud the BASIC Stamp is capable of; DEBUG and DEBUGIN work at 9600 (19.2k on the BS2px), but SERIN and SEROUT can use any supported rate.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Jon Williams Applications Engineer, Parallax
allanlane5 said...(trimmed)
Umm, I don't think so.
If you SEROUT 16, <somebaudmode>, [noparse][[/noparse]"Hi",13]
Then "Hi" will come out at the baud rate selected by the baud mode value.
However, you DO have to have a 'real' RS-232 driver connected to the RX line, so the TX line can use that to modulate itself.
Allan,
·· I'm not sure if we're all on the same page, but just to be sure, yes you can set the baud rate to any baud rate that can be used on any other pin, but as for Baud Modes, please note the following text from the PBASIC Help file:
"If the dedicated serial port (Tpin = 16) is used the data is inverted and driven regardless of the baudmode setting."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
Yes, but the point the other guy was making was that SEROUT on pin 16 ONLY ran at 9600 baud -- which is incorrect.
And my understanding matches yours, that no matter what the "inverted/not inverted" bit is set to, or the "open/not open" baud mode bit, on pin 16 the result is Inverted, Not Open (in other words, matching what a PC expects to see).
·· Since you used the Homework Board (BS2-based) before, and the BOE with a BS2, I am going to assume you're using the same code on the BS2p40.· In this case you probably are using the same baud rate parameters, which between the BS2 and BS2p40 are different.· It would help if you posted your code.· It would also generate more replies to post a new thread in the future.· This one was already taken care of and many people probably wouldn't notice your post.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔ Chris Savage Parallax Tech Support csavage@parallax.com
Comments
One other caveat about using SERIN/SEROUT to pin port 16. I stand to be corrected, but as I remember, the BAUDMODE is LOCKED IN to that of DEBUG (9600, 8, N, 1). Said differently BAUDMODE will be ignored if pin port 16 is used. This is a somewhat hidden aspect of using it, and thus why I mention it. It may not be a problem however, depending on the application.
Regards,
Bruce Bates
If you SEROUT 16, <somebaudmode>, [noparse][[/noparse]"Hi",13]
Then "Hi" will come out at the baud rate selected by the baud mode value.
However, you DO have to have a 'real' RS-232 driver connected to the RX line, so the TX line can use that to modulate itself.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
·· I'm not sure if we're all on the same page, but just to be sure, yes you can set the baud rate to any baud rate that can be used on any other pin, but as for Baud Modes, please note the following text from the PBASIC Help file:
"If the dedicated serial port (Tpin = 16) is used the data is inverted and driven regardless of the baudmode setting."
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
And my understanding matches yours, that no matter what the "inverted/not inverted" bit is set to, or the "open/not open" baud mode bit, on pin 16 the result is Inverted, Not Open (in other words, matching what a PC expects to see).
·· Okay, we are on the same page...Sometimes I get lost in the different views on something, and am not sure who's thinking what.· LOL·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
it worked fine using both
1) a BOE, USB, BS2
and
2) standard serial (COM1) connection to a Homework board.
Then I tried running it on a BS2p40 connected via USB to the Professional Development Board, and I can't get it to work.
Any suggestions for debugging, or arcane secrets I should know?
TIA.
·· Since you used the Homework Board (BS2-based) before, and the BOE with a BS2, I am going to assume you're using the same code on the BS2p40.· In this case you probably are using the same baud rate parameters, which between the BS2 and BS2p40 are different.· It would help if you posted your code.· It would also generate more replies to post a new thread in the future.· This one was already taken care of and many people probably wouldn't notice your post.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com