PDA

View Full Version : for the serout command, i need max 232 ???



Demoncleaner
05-25-2006, 05:25 AM
Hi all,


I use a BASIC Stamp board (2001) with PIC 16C57C, and i am trying to send "hello" on my hyper terminal. To programm my board i need to connect it with the serial port (COM).
So, to send "hello" to hyper terminal i used an example from the BASIC Stamp editor database, "SERIN_SEROUT1.BS2". The default pin of this example is PIN 1. Should i make a board with max 232 or should i use another pin for the serout command???

Chris Savage
05-25-2006, 05:38 AM
Since you're already connected to the computer through the serial cable why not use the programming port? Set your PIN number to 16, which refers to the Programming Port. You only needa MAX232 or other RS-232 driver if you're using one of the main 16 I/O pins.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Demoncleaner
05-25-2006, 05:46 AM
I am trying to use the PIN 16 but i get the error "Pin number must be 0 to 15".
Is there another pin that could i use for this command??

Chris Savage
05-25-2006, 06:55 AM
Please post your code...At least the line that is giving you the error.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Demoncleaner
05-25-2006, 07:05 AM
SO PIN 16 ' serial output
FC PIN 0 ' flow control pin
Main:
DO
SEROUT SO\FC, Baud, ["Hello!", CR] ' send the greeting
PAUSE 2500 ' wait 2.5 seconds
LOOP ' repeat forever
END

But the error said that i couldn't use the pin 16...as you told me before :(
The baud rate is set at 38k4.

Chris Savage
05-25-2006, 07:35 AM
That's because you're trying to define a Flow Control pin and you cannot do that on the programming port. If you require that you will need to use general I/O pins and a level shifter/driver such as the MAX232. Just to communicate back and forth between Hyperterminal you don't need flow control.


▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Demoncleaner
05-25-2006, 07:53 AM
SO PIN 16 ' serial output
Main:
DO
SEROUT SO, Baud, ["Hello!", CR] ' send the greeting
PAUSE 2500 ' wait 2.5 seconds
LOOP ' repeat forever
END

i tried this and i get the same error....are you sure that i could use the programming port to send ascii to my hyper terminal, WITHOUT max 232??
I only need to send "hello" on my hyperterminal...nothing else. I should use shifter/driver such as the MAX232, or should i do it from the programming port???
And if i could use the programming port please just send me an example because i 'm trying 3 hours now with no results

SSteve
05-25-2006, 08:06 AM
"SO PIN 16" is an invalid statement. The BS2 only has 16 I/O pins numbered 0 to 15.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
OS-X: because making Unix user-friendly was easier than debugging Windows

Demoncleaner
05-25-2006, 08:11 AM
i know...but witch is the programming port then?

allanlane5
05-25-2006, 08:29 AM
SEROUT 16, 16384, ["Hi!", CR] ' Is a valid statement

SerPin CON 16

SEROUT SerPin, 16384, ["Hi!", CR] ' Is Also a valid statement

So, using '16' in a SEROUT statement, is a kind of 'pseudo-pin'. True, it's in the place where you'd normally put a 'pin' number indicator. However, since the BS2 doesn't actually have a pin '16', this 'pseudo-pin' in this location of a SEROUT tells the BS2 to use the 'programming port'. But it MUST be a 'number' (aka CON), not a 'PIN'.

But, since it doesn't actually have a pin 16, declaring
MyPin PIN 16

Doesn't make sense to the BS2.

Chris Savage
05-25-2006, 08:36 AM
Allan is correct...I focused on the fact that you had the flow control in there and not that you were trying to use a constant for it. I originally thought you were getting the error on the SEROUT statement, not in the pin declarations.

▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com (mailto:csavage@parallax.com)

Demoncleaner
05-25-2006, 08:44 AM
Man thank you very mach it works correct.....thanks thanks...
i didn't know how to do it....