Can BS2 debug on a parallax Serial LCD?
Tronic (Greece)
Posts: 130
Hello, I would like to know if its possible·to connect·the parallax serial LCD on the serial port of BS2 board of education and just send a message to it·by using the Debug command...
I know I can connect it to any of the 15 ports of BS2 but I'd like to use p16 as I run out of free ports on my bot and I don't use the serial programming interface except to upload new program...
Here is the link of the LCD I'm referring to:
Parallax Serial LCD
Thanos
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
Post Edited (Tronic (Greece)) : 7/10/2006 11:00:11 AM GMT
I know I can connect it to any of the 15 ports of BS2 but I'd like to use p16 as I run out of free ports on my bot and I don't use the serial programming interface except to upload new program...
Here is the link of the LCD I'm referring to:
Parallax Serial LCD
Thanos
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
Post Edited (Tronic (Greece)) : 7/10/2006 11:00:11 AM GMT
Comments
I guess·I could·set the speed of LCD in 9600bps, which is the speed that BS2 communicates with terminal, and send a debug message from BS2. If I connected the·Rx (and the Gnd) thru a max232 on the Sout of serial programming port·the message will then·appear on the parallax serial LCD display, right?
Anyone has done this before?
Thanos
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
Post Edited (Tronic (Greece)) : 7/10/2006 1:11:16 PM GMT
1. The DEBUG message via the Pins 1,2,3,and 4. If you connect Pins 1,2, and 4 directly to a Serial LCD at the proper Baud, parity, etc, no inversion and no adapter is needed. Read the section on DEBUG in the manual.
2. The SERIN and SEROUT mode via any pair of I/O pins plus ground. Inversion depends on whether you use a MAX232 to do the inversion and provide 'true RS-232' levels or you just use a 22k resistor in the RX pin. Again the manual explains all this and has programing examples and schematics.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
serial settings on memory and must use SEROUT to send the message on the LCD like
the example code below:
SO········· PIN···· 4··············· ' serial LCD output
T9600······ CON···· 84··············· 'baud rate 9600bps
T19K2······ CON···· 32··············· 'baud rate 19200bps
Inverted··· CON···· $4000
Open······· CON···· $8000
Baud······· CON···· T9600 + Open·· ' replace the baud rate to match the LCD baud
rate
SEROUT SO, Baud, [noparse][[/noparse]"cls", CR]·
Instead I want to use the more simple command:
DEBUG "cls", CR
With no other settings. Like a portable terminal display...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
·
Maybe I'd better butt out.·
You can use the DB9 programming port to connect your LCD to and use SEROUT 16, but the DEBUG thing is an IDE-related function (DEBUG & IDE, they go together.)· Maybe there's a way to fake that (??).
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
Answering my own question (R-T-F-M!!): It Is -- 9600 8N1 Inverted
Post Edited (PJ Allen) : 7/10/2006 5:17:03 PM GMT
·· Bear in mind that no matter what baud mode you use it will always be inverted on the SIN/SOUT pins.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
But I succeded to connect my AVR based serial LCD directly on the programming port of "BS2 board of education"!!!!
...and just print messages using the debug command but this was only·after I modified my original design by adding an extra resistor as shown on the PDF (optional part).
AVR_serial_LCD_controller_v1.1_sch.pdf
Any suggestions to fix the Parallax serial LCD work the same way?
And some video of its operation...
vid_BS2_debugs_on_LCD.zip
Here is the demo program I used to send messages to my own avr based serial LCD:
' {$STAMP BS2}
' {$PBASIC 2.5}
i·········· VAR···· Byte
DO
PAUSE 20
DEBUG "cls", CR
PAUSE 20
DEBUG "· Greekbotics·· ", CR
PAUSE 20
DEBUG " AVR ROCKS!!··· ", CR
PAUSE 20
DEBUG "ln2",CR
PAUSE 20
DEBUG " Robotic Forum· ", CR
PAUSE 20
DEBUG "Now thru debug! ", CR
PAUSE 1000
FOR i = 1 TO 15
···· PAUSE 100
···· DEBUG "shl", CR··················· ' command the LCD to shift message to left
NEXT
PAUSE 20
DEBUG "bloff",CR
PAUSE 20
DEBUG "beep",CR
PAUSE 500
DEBUG "blon",CR
PAUSE 500
DEBUG "bloff",CR
PAUSE 500
DEBUG "blon",CR
PAUSE 1000
LOOP
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
Post Edited (Tronic (Greece)) : 7/11/2006 11:13:22 AM GMT
Forgive me, but below is a review of what I was trying to say about two 'conduits' for the RS-232.
1. The DEBUG already has hardware inversion and so does the SERIN/SEROUT on PIN16.
2. Only the generic SERIN/SEROUT on pins 0-15 need either a MAX232 to provide inversion of the TTL or 'Software Inversion' when using somewhat sloppy 22k resistor approach.
3. DEBUG probably takes the same space in EEPROM, but certainly is easier to write code for. It is limited to one and only one configuration [noparse][[/noparse]the one the used by the IDE].
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
I do not know what the LCD requires in the way of inverted or·non-inverted, but a MAX232 is not needed (or appropriate, afterall.)·
If the LCD needs non-inverted data, then one can easily rig up an inverting amplifier to make the change [noparse][[/noparse] //A = A ], at the LCD's input.
Post Edited (PJ Allen) : 7/11/2006 1:04:48 PM GMT
The issues about garbage I got maybe is because the parallax serial LCD does not return back to the BS2 the characters it receives (echo), as debug requires from IDE to function properly (basic stamp editor terminal).
In the AVR based serial LCD, that I designed, I added such "return" as you can see in the schematic (PDF) I gave above.
Too bad there is no workaround to have my parallax serial LCD function such easy... ·· ...or there is?
PS. I can give·the AVR firmware for free, to anyone that is interested·making such project
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
·
The problem must be of another nature. Not about inverted or non-inverted connection...
Its must be IDE related as I explained already. You see, the parallax LCD has only input, no output to redirect back to the BS2 the character it receives. Or at least I think that's the problem is that it doesn't work directly with the debug command.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
·
Post Edited (PJ Allen) : 7/11/2006 3:01:48 PM GMT
Some how you got into double inverting.
BasicStamp Pins 1 and Pins 2 have transistors that Invert for you.
The Standard Asychronous Serial Communications signals are:
TTL low [noparse][[/noparse]0] is RS-232 high [noparse][[/noparse]+5 to +12 ;
TTL high [noparse][[/noparse]+5] is RS-232 [noparse][[/noparse]-5 to -12 prefered, but sometimes 0]
Software inversion is available via the 'Baudmode' portion of the SERIN and SEROUT commands, but the manual's discussion is quite involved AS A PERSON HAS TO LEARN TO USE THE 'PBasic notation' to properly select.
DEBUG is really the easiest way [noparse][[/noparse]if your LCD happens to take the same Baud rate and Format].
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
The odd part was that even my design failed to properly receive debug messages, at start, and worked when I accidentaly powered the TXD port of attiny2313 with +5v while trying to get it work. So I added the +5v to the line thru a 10ohm res·to protect it from overcurrent and thats it. You can see the strange connection I did on the schematic.
As it figures I dont think I can do such think on my parallax serial LCD without void of warranty
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
Post Edited (Tronic (Greece)) : 7/11/2006 3:23:08 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
Post Edited (Tronic (Greece)) : 7/11/2006 3:28:06 PM GMT
Still no way to·make my Parallax serial LCD work with the simple debug command...
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
Post Edited (Tronic (Greece)) : 7/13/2006 7:45:47 AM GMT
If you use a simple Transistor inverter you can use the Parallax Serial LCD for DEBUG purposes.· Remember, not all of the serial constants will work, such as CLS or HOME, but you can always use the literal values, such as 12 ($0C) to clear the screen.· I hope this helps out those following this thread.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I was just asking for help, figuring out how this can be done, and tried my avr serial lcd just to test the connection, as I have made it for entirely other reason (computer application)... No need to advertise anything, as its a non commercial application.
Anyway I finaly found the problem. It was about a noisy powering from a wall transformer that caused garbled data thru the transmision lines of the OEM Bs2. The difference in my desing was that I amplified somehow the signal. Really don't know, it happend by accident
Powering it from batteries got it working. Thanks for all help!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
·
·· No offense was taken...I just wanted to clarify a few things so Forum Members didn't get misinformation.· For example, the problems you were having were not related to an echo issue.· That only affects the Stamp IDE communication with the BASIC Stamp.· Anything you send to the BASIC Stamp Dedicated Serial Port will be echoed back.· However, in this case we're not doing that, we're sending from the Serial Port and the target device is not required to echo.· I think some confusion is caused by not knowing which DB-9 pin to connect to.· Pin 2, which is RX on the PC side.· But for some they might think it is the Stamp RX pin from the diagram.· For those interested here is the exact schematic used to do this, and these parts are all available from us or are included in various kits we offer.· Enjoy.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
I'm using the circuit that·Chris Savage suggested.
I receive messages (thru debug) from Pin 2, which is TX on the·BS2 DB-9, but I also receive messages when I connect it on Pin 3, which is RX on the·BS2 DB-9... Is this normal?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greekbotics: Greek Robotics Forum
(Translate it using Babelfish)
·
Chris,
Sorry for repeating you, but sometimes just seeing different verbage helps [noparse]:)[/noparse]
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com
Asynchronous serial communications is an important part of the microcontoller's popularity. It really reduces the connections to other devices and can be effortless.
Problems of understanding occur because people either don't understand what is involved in a minimal configuration or they have difficulty reading the PBasic Manual's complete discussion. I have wanted to jump in and say, 'NO! no! you aren't looking at it correctly.' But, I have tried to let go and sit back as I fear that I'd just add more confusion.
A few simple things are need-to-know.
1. Parallax eliminates the hardware handshaking {unless you really need it.· It is possible with SERIN and SEROUT}·which can add another layer of complexity to the whole thing. Just stick with thinking abut Rx and Tx. The only exception to this is the ATTN line which is a 'special and not RS-232 standard accomodation' to allow the IDE to program the Stamp. After the Stamp is programed, don't include it.
2. Inversion from TTL to RS-232 tradionally occurs in a transistor that drives or receives the RS-232 signal. In that case, no inversion is needed in software.·· The MAX 232 is the preferred hardware inverter, but takes a bit of building.
3. When confused, even though you have the Baud Rate, the Parity, and the Stop Bits correct; you may be 'double inverting by using·the software with hardware [noparse][[/noparse]like the MAX232].
4. Above all, check the BAUD rate REQUIRED BY YOUR OTHER DEVICE and the signal levels [noparse][[/noparse]TTL or RS232]. The above problems seem to be related to two LCDs of differnet Baud Rates - it appears one is 9600 and the other is 19200.· They are two separate problems.· One solution will never work.
5. READ and reread the PBasic sections until this information soaks in completely. There is an indexed entry for 'Serial Troubleshooting' and the two entries are merely copied so that one is in the SERIN section and one is in the SEROUT section.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"If you want more fiber, eat the package.· Not enough?· Eat the manual."········
Post Edited (Kramer) : 7/15/2006 10:50:19 AM GMT