confusion in my cereal; ha i made a pun
nick bernard
Posts: 329
HAIL BOARD!
i've been using 16624 as my baud for my serial communications... this baud origionated from my seetron display from scott edwards and i've always just used that single baud rate for everything else...
now if i'm not mistaken 16624 = 9600 8N1 inverted
now for the confusion...
i tried to send serial data from my application into hyperterminal or the debug window. i used a baud of 84 = 9600 8N1 to talk to the pc(debug terminal xor hyperterminal, that is one at a time) which was also set to 9600 8N1 ... but it did not work... i did notice, however, that the 16624 = 9600 8N1 inverted DID WORK... why is that... i thought that setting was for "open baud modes" or driving devices such as my lcd display...
the confustion lingers. enlighten me please! why is the pc is rx'ing up the inverted mode when i think it should be rx'ing the non-inverted mode?
ROX ON
nickB
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life
i've been using 16624 as my baud for my serial communications... this baud origionated from my seetron display from scott edwards and i've always just used that single baud rate for everything else...
now if i'm not mistaken 16624 = 9600 8N1 inverted
now for the confusion...
i tried to send serial data from my application into hyperterminal or the debug window. i used a baud of 84 = 9600 8N1 to talk to the pc(debug terminal xor hyperterminal, that is one at a time) which was also set to 9600 8N1 ... but it did not work... i did notice, however, that the 16624 = 9600 8N1 inverted DID WORK... why is that... i thought that setting was for "open baud modes" or driving devices such as my lcd display...
the confustion lingers. enlighten me please! why is the pc is rx'ing up the inverted mode when i think it should be rx'ing the non-inverted mode?
ROX ON
nickB
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Sid Weaver
New Combo LCD Backpack
http://hometown.aol.com/newzed/index.html
·
16624 is 8-bit, no parity, inverted, which is used for the BS2p,BS2sx.· 84 is 8-bit, no parity, true, which is for the BS2, BS2e, and BS2pe.· If you look on page 297 of the BASIC Stamp manual, it will give you the different rates for each stamp.· Here is a link for the downlopad of the manual:· http://www.parallax.com/html_pages/downloads/basicstamps/documentation_basic_stamp.asp·.
Dave
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Dave Andreae
Tech Support
dandreae@parallax.com
www.parallax.com
·
This takes the hassle out of serial parameters, especially if you want to move from Stamp-to-Stamp.
If you go into the Edit/Preferences.../Files & Directories... you can set this file as the template that gets loaded when you select File/New or click the New icon on the toolbar.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Jon Williams
Applications Engineer, Parallax
Dallas Office
RIGHTO! i did have 84 and 240 mixed up...
HAIL ALL!
but i'm still confused...
why do i have to invert the data going into the PC when the PC has no "invert | true" option...
(or) why doesnt it take the non-inverted data when there is no "invert | true"option...
whoa is me
nickB
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life
If you recieve data *from* the PC on another BS2 pin, through a 22 Kohm resistor, then you would use a non-inverted mode, because there would be no MAX232 inverter/driver on that line.
The 'Open' baud modes are so you can make a shared open-collector bus using SERIN/SEROUT. If you don't know what open-collector means, well there are other posts that explain this in more detail.
thx for the input...
are you referring to the Sout pin (PIN 16) when you say "You have to 'invert' data going to your PC because it goes through a pseudo-MAX232 circuit made out of a few transistors on the BS2 module?"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life
I think it is physically pin 3 on the BS2 module, by the way. I could be mistaken.
Note for this to work, you *must* have wired the SIN pin, since the BS2 modulates the voltage from the PC coming in the SIN pin to make the SOUT signal. They save an additional power supply by doing this.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
http://www.geocities.com/paulsopenstage
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
this is all begining to make a little more cents to me...
thx to all
but,
i'm using pin 15 for my serial tx'n. does pin 15 have a tx buffer as such?
also i have another application thar uses 9600 8N1 true (240 on the bs2sx) through a max232 to talk to a VB app (MScomm object set to 9600 8N1)... why is the serial data not inverted in that instance?
cornflakes are my favorite cereal.
rox on
nickB
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life
There's no buffer so far as that in the stamps....no CRC....· Not to say you couldn't do it in software.
So far as your True vs Inverted question.
Google some RS232 specs on the net.
For a quick breakdown....a 1 in TTL is +5volts (or above 2.5volts);· a 0 in TTL is 0volts (or below 2.5volts).
now in RS232, the voltage levels are + and - 12volts.· But, the relationships are reversed.
SO: a 0 in RS232 isn't 0volts....it's +12. and a 1 in RS232 is -12volts.
notice the 'INVERSION'·from TTL to RS232.· Nowadays, power management in laptops (and other devices) has shrunk the rs232 levels to near +/-5volts.· The Stamp puts out 0 and +5.· Believe it or not....this is enough for most devices to discern some data from.
BUT, in a stamp we must send out +5s and 0's right....and don't forget that our levels have to be inverted.· Hence the option of the 'INVERTED' baudmodes.
Now, when you use an IC like the MAX232...it takes TTL data and converts it to proper RS232 levels.· SO, it is expecting a +5V to represent a binary 1 and 0volts to represent a binary 0.· SO, we MUST be sure we send out data as 'TRUE' wrt baudmodes.
Remember too that the stamp can receive proper RS232 levels, but that a resistor is needed in series to prevent damage to pins.
You would have to 'SERIN' this data as INVERTED data since it's coming as RS232 and not TTL (remember RS232 differentials are opposite of TTL in regards to binary 1's and 0's).
I could go on....but I'm supposed to be working!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·
Steve
http://members.rogers.com/steve.brady
http://www.geocities.com/paulsopenstage
"Inside each and every one of us is our one, true authentic swing. Something we was born with. Something that's ours and ours alone. Something that can't be learned... something that's got to be remembered."
And no, there is no RS-232 bufferering on the BS2 -- it only recieves the data if the BS2 is waiting on the SERIN command when the data comes in. If the BS2 is doing something else, it ignores the data.
you guys are the ROX....
i knew everything you guys were saying with the exception of "a 0 in RS232 isn't 0volts....it's +12. and a 1 in RS232 is -12volts."
i kinda had to play dumb because i was fishing for an answer to a question that i didnt know how to put into words.
please forgive the ignorance & thx for your patience
ROX ON
nickB
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
League Bowling.... it's not a sport, it's a way of life
The RS232 line sits at an 'idle' state, when not sending data. I believe this is -12 volts. On the TTL side, this corresponds to a +5 voltage, or a '1' state (an inversion, see? + 5 to -12). When it wants to send a zero, it sends the voltage to +12 volts. On the TTL side, this corresponds to a zero voltage (also an inversion -- 0 volts goes to +12). Note +- 10 volts, and +- 5 volts also work.
The device that translates TTL to RS232 voltage levels is called a '232 driver'. Once upon a time, you had to use the 1488 and 1489 drivers (one to send, one to recieve). The sender had to have a dual power supply, +12 and -12, to do its work.
MAXIM came out with the MAX232 chip. This chip has an on-chip switching power supply that generates the +-10 volts, and has 2 recievers and 2 transmitters per chip. BUT, each driver is also an inverter.
So, when you put TTL 'high', aka +5, aka '1' into the driver gate, -10 volts comes out the TX pin. When you put TTL 'low', aka 0 volts, aka '0' into the driver gate, +10 volts comes out the TX pin.
However, you CAN tie two BS2 units together, without any drivers. And you can recieve from the PC without a driver by using a 22 Kohm resistor instead of the driver. In these instances, the RS232 signal will look 'INVERTED' from normal, since you don't have that MAX232 driver/inverter in the circuit.
Thus the need for the 'INVERT' flag on the baud-rate parameter.