ChrisO
02-06-2005, 02:47 AM
Hello-
A while back I wrote asking for help using the BS2 to control a Kitsrus K108 serial I/O module. I am very new to using Stamps and appreciate the help.
Thanks to John Williams for his relpy....however, Looking at my BS2 manual, I am not totally clear how to use the template you sent to select baud, etc. (I know, thick newbie)...
Just to review my situation....the K108 uses simple ASCII commands to turn relays on and off--ie, "N1" followed by CR turns Relay 1 on, "F1", CR turns it off.
Kitsrus says that is the only data that needs to be sent. The K108 uses 9600, 8 data bits, 1 stop bit, no parity, no flow control.
I used a straight-through DB9 to connect the BOE to the K108 serial in, and my program basicially looked like this:
DO
SEROUT 16, 84, ["N1", CR]
PAUSE 1000
SEROUT 16, 84, ["F1", CR]
PAUSE 1000
LOOP
for example, to make Relay 1 turn on and off as a test.
While I have the BOE hooked to my PC via the USB-to-serial adapter, I can see the Rx light blinking, so I know the Stamp is outputting data.
I have tried using the ASCII numbers for the N, 1, and CR, and just about every other data formatting variation I can think of.
I have also tried baudmode 16468 (inverted 8bit no-parity).
I saw the note that when Tpin=16 is used, the data is inverted and driven regardless of baudmode......so I tried using I/O pin 1 and Vss hooked to DB9 pins 2 and 5, with Tpin=1 instead. Then I connected DB9 pins 1,4,6 and 7,8 to disable hardware handshaking.
Nothing.
Can anyone give me a Clue? :) Thanks!
Chris
A while back I wrote asking for help using the BS2 to control a Kitsrus K108 serial I/O module. I am very new to using Stamps and appreciate the help.
Thanks to John Williams for his relpy....however, Looking at my BS2 manual, I am not totally clear how to use the template you sent to select baud, etc. (I know, thick newbie)...
Just to review my situation....the K108 uses simple ASCII commands to turn relays on and off--ie, "N1" followed by CR turns Relay 1 on, "F1", CR turns it off.
Kitsrus says that is the only data that needs to be sent. The K108 uses 9600, 8 data bits, 1 stop bit, no parity, no flow control.
I used a straight-through DB9 to connect the BOE to the K108 serial in, and my program basicially looked like this:
DO
SEROUT 16, 84, ["N1", CR]
PAUSE 1000
SEROUT 16, 84, ["F1", CR]
PAUSE 1000
LOOP
for example, to make Relay 1 turn on and off as a test.
While I have the BOE hooked to my PC via the USB-to-serial adapter, I can see the Rx light blinking, so I know the Stamp is outputting data.
I have tried using the ASCII numbers for the N, 1, and CR, and just about every other data formatting variation I can think of.
I have also tried baudmode 16468 (inverted 8bit no-parity).
I saw the note that when Tpin=16 is used, the data is inverted and driven regardless of baudmode......so I tried using I/O pin 1 and Vss hooked to DB9 pins 2 and 5, with Tpin=1 instead. Then I connected DB9 pins 1,4,6 and 7,8 to disable hardware handshaking.
Nothing.
Can anyone give me a Clue? :) Thanks!
Chris