View Single Post
  #3   Spotlight this post!  
Unread 19-02-2008, 01:44
Ian G Ian G is offline
BUILD SUCCEEDED
FRC #2415 (WiredCats)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2004
Location: Atlanta
Posts: 23
Ian G is an unknown quantity at this point
Send a message via AIM to Ian G
Re: Basic Stamp serial communication

There is a separate RX and TX, but no handshaking line. Here is a crude diagram:



Since the communication is asynchronous, the stamp waits for a signal from the RC before sending the sonar data. I can't get the actual program until I can get to the school, but it was essentially this:
'Code that makes variables
'Code that gets data from sonar
'Code that converts it to centimeters

SERIN 13, 240, [ack]
IF ack THEN
SEROUT 12, 240, [sonarData]
ack = 0
ENDIF

A question, if the BS2 is TTL, can I skip the serial/TTL converter completely and connect it directly to the TTL port on the RC? If so, can you point me to some TTL examples?

I don't have a manual... we got the BS2 second hand.