PicBasic Pro, PicBasic, BASIC Stamp, Microchip PIC, 8051, and Remote Control Projects


SI-Pro
Stamp IR Programming System


Click HERE For Hardware Installation & Accessories

Download The Latest Version SI-Pro Software HERE

bullet Setting The SI-Pro Software & Hardware Address
bullet Finding & Changing The SI-Pro Hardware Address
bullet Loading, Editing & Viewing Code Files
bullet ID The BASIC Stamp Connected to The SI-Pro
bullet Sample BOE Robot Control Program
bullet Debug Window & Macros
 
bullet Using The Address Feature
bullet Sending IR Data & SI-Pro Buffer Limitation
bullet The Editor & Tokenizer
bullet Tokenizing BASIC Stamp Program Code Files
bullet Infrared Remote Wireless Programming
bullet The Robot Control Keypad & Editing Macros

PC Serial Port Setup:

Start the SI-Pro software and use the "Settings" button to select the PC serial port the Air-Byte transceiver is connected to. This will be the default communications port each time you start the SI-Pro software.

Figure #1 [ Top ]

Setting The SI-Pro Software & Hardware Address:

Each SI-Pro firmware IC is pre-programmed with a default address of 99. When you first start the software select 99 as the address. The software will remember the last address selected, and use this as the SI-Pro hardware address to communicate with each time you start the software.

As shown below in Figure #2, select 99 as the address to communicate with. To communicate with an SI-Pro transceiver set to a different address, just select the different address using the drop-down menu.

Figure #2 [ Top ]

Finding & Changing The SI-Pro Hardware Address:

If you have more than one SI-Pro transceiver, you may at some time need to verify or change the SI-Pro transceivers address. The process is simple. Click the "Change Programmer Address" button as shown below in Figure #3.

Note: Communications with the SI-Pro transceiver hardware for address changes or verification requires the Air-Byte & SI-Pro transceivers to be connected and powered up.

Figure #3

As shown below in Figure #4, after clicking the change programmer address button, a window will open allowing you to set a new address, and ask for the old address to be changed. If you don't remember an SI-Pro hardware address, use the "Get Programmer Address" satellite button as shown below in Figure #4.

If you know the SI-Pro hardware address and want to change it, follow these steps.

  1. Have the Air-Byte transceiver connected to your PC and powered up.
  2. Have the SI-Pro transceiver powered up & pointed towards the Air-Byte transceiver.
  3. Be sure the "Old Address" window indicates the current SI-Pro hardware address to be changed.
  4. Select a new address in the "New Address" box.
  5. Click the OK button to send the new address to the SI-Pro.

Note: When changing or verifying an SI-Pro hardware address, only one SI-Pro should be powered up and present during the procedure. This will help you avoid setting a new address in other SI-Pro transceivers within range.

Figure #4

To find or verify an SI-Pro hardware address, click on the "Get Programmer Address" satellite button as shown above in Figure #4.

Point the SI-Pro transceiver towards the Air-Byte transceiver connected to your PC serial port, and connect or cycle the power to the SI-Pro transceiver. Address recognition takes approximately 1 second after the SI-Pro has been power-cycled.

Figure #5

As shown above in Figure #5, the software will wait to receive the current SI-Pro hardware address. When you apply power to the SI-Pro hardware, the SI-Pro will initialize, read, and then transmit its address stored in EEPROM to the Air-Byte transceiver. [ Top ]

Using The Address Feature:

As shown below in Figure #5A, the address feature allows selective communications with specific BASIC Stamp robots, and Stamp development boards. Wireless programming & communications with a specific address is transparent to other addresses, and will not interrupt code running on other SI-Pro/BASIC Stamp boards within range of the Air-Byte transceiver that are set to a different address.

A single Air-Byte PC transceiver can communicate with & program up to 256 [0 to 255] individually addressed SI-Pro & BASIC Stamp systems.  Simply change the software address window to select another SI-Pro address to communicate with.

Figure #5A

When the Stamp is using the SI-Pro transceiver for wireless IR communications, all serial data packets must start with the address of the SI-Pro transceiver connected to the Stamp.

Example:  To send wireless information from a BASIC Stamp connected to an SI-Pro set to address #3, insert the following BASIC Stamp code -

DEBUG 3,"Object Detected".

The message displayed on the DEBUG screen would read -- Object Detected. [ Top ]

Sending IR Data & SI-Pro Buffer Limitation:

The SI-Pro data buffer is limited to a maximum of 18 bytes. When the Stamp sends data to the SI-Pro for wireless transmission, the SI-Pro begins to store data in the buffer immediately after the address has been received. The contents of the data buffer will be transmitted once the buffer is full, or after a timeout period of 25mS has passed since the address was received.

The SI-Pro will transmit only the contents of the data buffer.

Example:

bulletStamp connected to SI-Pro address #3 sends: DEBUG 3,"12345" to the SI-Pro
bulletSI-Pro receives address #3, then immediately adds 12345 to the data buffer.
bulletSI-Pro waits 25mS, then sends 12345 via infrared at 2400 baud, modulated at 40KHz.

When the SI-Pro receives IR data from the Air-Byte or another BASIC Stamp using an SI-Pro, it will begin to buffer incoming data immediately after the address has been received. The contents of the data buffer will be transmitted to the Stamp once the buffer is full, or after 25mS has passed since the address was received.

Note: The address is separate from data, and is not stored in the buffer. The CR & LF commands are included in the 18 byte limitation, and treated as any other data.

This example shows how to print a menu from a remote Stamp or robot on the Parallax editors DEBUG screen. Data is sent from a BASIC Stamp connected to an SI-Pro with an address of 99.

This example shows how to print remote data on-screen in the debug window. It does not offer a complete solution for an interactive menu system, and is only an example.

'{$STAMP BS2}
address con 99

Main:
  DEBUG address,"Menu",CR,"(A) Set Time",CR
  PAUSE 90 ' Wait longer than 18 bytes x 10 bits x 416uS
  DEBUG address,"(B) More Stuff",CR
  PAUSE 90
  DEBUG address, "(C) Even More",CR
  PAUSE 3000
  DEBUG address,CLS
  PAUSE 90
  GOTO Main

The Stamp sends serial data to the SI-Pro using the DEBUG command. The SI-Pro sends the data via infrared at 2400 baud.

Each byte of data consists of 10 bits.

bullet1 Start-bit
bullet8 Data-bits
bullet1 Stop-bit

At 2400 baud, the individual bit-timing is 1/2400 = 0.000416 S or 416uS. This means it will take each single "bit" 416uS to be transmitted at 2400 baud.

If we send 18 bytes this = 18 bytes x 10-bits per byte x 416uS per bit for a total data transmission time of roughly 75mS.

The PAUSE 90 instruction in the previous code example waits for 90mS between each serial data transmission before sending more serial data. This pause allows time for data packets to be sent at 2400 baud & time for SI-Pro program overhead to modulate and send each data packet.

Figure #5B shown below is the menu displayed on-screen in the editors DEBUG window.


Figure
#5B

Remember that the buffer cannot accept more than 18 bytes per data packet. Also remember to WAIT for the SI-Pro to send the contents of the data buffer before attempting to send more data to the SI-Pro. Sending serial data to the SI-Pro while it's in the process of sending the first 18-byte buffer contents will result in a loss of data.

A General Rule-of-Thumb:

bulletPause for at least 90mS to 100mS after sending an 18-byte data packet before sending more data from the BASIC Stamp to the SI-Pro for an infrared transmission.
bulletFor data packets less than 18-bytes, wait at least 5mS [Per byte sent] + 25mS [Timeout period] + 10mS [For SI-Pro program overhead].

When sending a single byte, a 40mS PAUSE period would allow for the buffer transmit timeout period of 25mS, + 10mS for SI-Pro program overhead, and 5mS for the time it takes to transmit a single data byte at 2400 baud. [ Top ]

Editor & Tokenizer:

The SI-Pro software includes an editor & tokenizer. The tokenizer is based on the publicly released BASIC Stamp code compiler or "Tokenizer" from Parallax Inc, and does not yet support the newer editor release version 2.5.

BASIC Stamp code you run through the SI-Pro tokenizer can not include the new '{$PBASIC 2.5} directive. This directive is specific to the newer version 2.5 editor/compiler, and not yet supported by the SI-Pro tokenizer. Support for version 2.5 will be added on release of the 2.5 tokenizer by Parallax Inc.

BASIC Stamp code used with the SI-Pro tokenizer must have the Stamp type directives as shown below for the various supported BASIC Stamp types.

  1. '{$STAMP BS2} for the BS2.
  2. '{$STAMP BS2e} for the BS2e.
  3. '{$STAMP BS2sx} for the BS2sx.
  4. '{$STAMP BS2p} for the BS2p.
  5. '{$STAMP BS2pe} for the BS2pe. [ Top ]

Loading, Editing & Viewing Code Files:

Figure #6

Use the "Load Stamp File" button as shown above in Figure #6 to locate & open BASIC Stamp program code files.

Select the "View Stamp File" button as shown below in Figure #7 to open the editor window for viewing & editing Stamp program code files. The editor box can be re-sized by dragging the side, bottom or top of the editor box.

Note: Changes made to BASIC Stamp code will not take affect until after you save & tokenize the file. Use the File & Save options to save all changes before tokenizing. The editor has drop-down menus that allow saving, tokenizing and downloading files.


Figure
#7 [ Top ]

Tokenizing BASIC Stamp Program Code Files:

Figure #8

BASIC Stamp program code has to be compiled or tokenized before downloading to the Stamp. After you open a file, select the "Tokenize Stamp File" button as shown above in Figure #8 to run the tokenizer, compile and check your program code for errors. If there are no errors, the compile result window shown above in Figure #8 will appear. If there are errors, look for & correct any mistakes. Then use the tokenize button to repeat the compile process until there are no errors. [ Top ]

Identifying The BASIC Stamp Type Connected to The SI-Pro:

Figure #9

Figure #9 shows the "Identify" button used to identify the Stamp type connected to the SI-Pro transceiver.  Figure #9 also shows the result screen after successfully identifying a remote BS2. It works similarly to ID the BS2e, BS2sx, BS2p, and BS2pe.

Note: To identify the Stamp type connected to an SI-Pro transceiver, you will need both the SI-Pro & Air-Byte powered-up & operating. The BASIC Stamp development board or robot must be connected to the SI-Pro transceiver. The correct SI-Pro address to communicate with must be selected in the address window. The Air-Pro transceiver must be connected to your PCs serial port.

It's important to have the correct "address" set in the SI-Pro software address selection window. If the address does not match the SI-Pro address you want to communicate with, the ID process will return an error. Refer to the section on "Finding And Changing The SI-Pro Hardware Address" for details on this step. [ Top ]

Infrared Remote Wireless Programming:

Figure #10

Once you have selected the remote SI-Pro address for the BASIC Stamp to be programmed, opened and successfully tokenized the BASIC Stamp program code file, click the program arrow button as shown above in Figure #10 to send your code to the BASIC Stamp target connected to the SI-Pro infrared transceiver.

Figure #10 shows the resulting "Download Complete" window from a successful remote programming session of a BASIC Stamp connected to an SI-Pro set to address #25.

The SI-Pro infrared remote BASIC Stamp programming & communications system has been tested in excess of 65 foot. While it's not necessary to aim the Air-Byte & SI-Pro IR transceivers directly at each other at close range [approximately 15-25 foot], longer distance programming & communications will require more direct pointing. [ Top ]

DEBUG Window & Macros

SI-Pro software includes a debug screen with easy to use macros and a robot control keypad. To open the debug window, click the "Open Debug Terminal" button as shown below in Figure #11.

Figure #11

The debug window can be used for interactive debug sessions & remote robotics control with the SI-Pro & Air-Byte transceivers. Although very similar to the Parallax editors debug window, the SI-Pro debug macros are activated with single button clicks instead of multiple key combinations. Macro buttons can be assigned individual names - making them very easy to use.

Note: All data sent from within the SI-Pro debug window automatically sends the SI-Pro address. The address selected in the  address selection window [shown below in Figure #12] is automatically sent with all outgoing data. Notice in Figure #12 how the lower case ASCII 'c' is sent when 99 is the address.

Figure #12

[ Top ]

Robot Control Keypad

The robot control keypad is located below the macro buttons. Each key will automatically send the SI-Pro hardware address followed by an "A" and then the single upper case ASCII letter shown on the key. Use the robot control keypad to send single ASCII letters F, R, B, L or S with a single key-press.

Example:

Click button F, data sent is SI-Pro address, A, & F. Click button B, data sent is SI-Pro address, A, & B. The Stamp robot would receive the A and then the ASCII letters F, R, B, L or S for directional control of a robot from the control keypad.

A very simple Stamp program to decode each key would be:

 '{$STAMP BS2}
idx var byte

main:
serin 16,16468,[WAIT("A"), idx]
if idx = "B" then backward
if idx = "F" then forward
if idx = "R" then right
if idx = "L" then left
if idx = "S" then Stop_Bot
goto main

Editing Macro Names & Data

Macros can be used to send single bytes or strings of data. As shown below in Figure #13 - macro data & button names are entered into the macro Name & Data windows.

Figure #13

ASCII characters like A,B,C, and complete text strings are entered as shown above in Figure #13. For numeric data, precede each numeric value with the pound # sign to separate individual numeric characters as shown in Figure #13.

When finished editing macros, click the OK button to save & exit. As shown above in Figure #12, macro buttons now show the macro names assigned. Clicking on a macro button will send data entered into the macro data fields as shown in Figure #13.

[ Top ]

Sample BOE Robot Control Program:

Below is a simple program to control a BOE bot from your PC using a terminal program. You can remotely control & program the BOE robot with the Air-Byte & SI-Pro system.

 '{$STAMP BS2}
x var word
right_servo con 14
left_servo con 15
address con 25
idx var byte

main:
debug address,"Waiting...!",13,10
serin 16,16468,5000,main,[WAIT("A"),idx]
if idx = "B" then backward
if idx = "F" then forward
if idx = "R" then right
if idx = "L" then left
if idx = "T" then turn_around
goto main

backward:
debug address,"Backwards",13,10
for x=1 to 60
pulsout left_servo,850
pulsout right_servo,650
pause 20
next
return

forward:
debug address,"Forward",13,10
for x=1 to 60
pulsout left_servo,650
pulsout right_servo,850
pause 20
next
return

right:
debug address,"Right",13,10
for x=1 to 18
pulsout left_servo,850
pulsout right_servo,850
pause 20
next
return

left:
debug address,"Left",13,10
for x=1 to 18
pulsout left_servo,650
pulsout right_servo,650
pause 20
next
return

turn_around:
debug address,"Turning Around",13,10
for x=1 to 30
pulsout left_servo,850
pulsout right_servo,850
pause 20
next
return 
[ Top ]

Order SI-Pro & Air-Byte Transceivers & Accessories


Air-Byte IR Transceiver & Accessories HERE


SI-Pro BASIC Stamp Programmer & Accessories HERE


The Complete BASIC Stamp Infrared Programming Package HERE


Click HERE for Hardware Installation & Accesories

Copyright © 1999-2002 Reynolds Electronics

| Contact Information |

Reynolds Electronics
3101 Eastridge Lane
Canon City, Co. 81212
Voice: (719) 269-3469
Fax: (719) 276-2853