Using BS2pe serial port
Archiver
Posts: 46,084
Hello,
I need to connect a BS2pe to a TI microcontroller using a 9600 baud
serial port. So far, whenever I have sent a series of commands to
the microcontroller, it does not preform the commands. I have also
set the mode on the microcontroller using jumpers and connected the
output to the BS2pe and ran loop containing serin and only received
output of 00 or 255. the code I have been using to test the input is,
theloop:
SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),inp(2),inp(3),inp(4),inp(5),inp(6),inp
(7)]
DEBUG ? len(0)
DEBUG ? len(1)
DEBUG ? len(2)
DEBUG ? len(3)
DEBUG ? len(4)
DEBUG ? len(5)
DEBUG ? len(6)
DEBUG ? len(7)
GOTO theloop
I have also tested it with SERIN 7,16624,[noparse][[/noparse]WAIT(1),inp(0),inp(1),inp
(2),inp(3),inp(4),inp(5),inp(6),inp(7)]
Because the microcontroller start byte is 01hex, but I never receive
anything
to output I have been using
SEROUT 7,16624,[noparse][[/noparse]1,9,8,50,57]
what I'm trying to send is 01h, 09h, 08h, 32h, 39h
if this works, an led on the microcontroller should blink, which it
isn't
The microcontroller is 9600 baud, it sends 8 bits of data with no
parity. there is one start bit and one end bit.
Can anybody help me here?
Thank you
Doug Carssow
I need to connect a BS2pe to a TI microcontroller using a 9600 baud
serial port. So far, whenever I have sent a series of commands to
the microcontroller, it does not preform the commands. I have also
set the mode on the microcontroller using jumpers and connected the
output to the BS2pe and ran loop containing serin and only received
output of 00 or 255. the code I have been using to test the input is,
theloop:
SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),inp(2),inp(3),inp(4),inp(5),inp(6),inp
(7)]
DEBUG ? len(0)
DEBUG ? len(1)
DEBUG ? len(2)
DEBUG ? len(3)
DEBUG ? len(4)
DEBUG ? len(5)
DEBUG ? len(6)
DEBUG ? len(7)
GOTO theloop
I have also tested it with SERIN 7,16624,[noparse][[/noparse]WAIT(1),inp(0),inp(1),inp
(2),inp(3),inp(4),inp(5),inp(6),inp(7)]
Because the microcontroller start byte is 01hex, but I never receive
anything
to output I have been using
SEROUT 7,16624,[noparse][[/noparse]1,9,8,50,57]
what I'm trying to send is 01h, 09h, 08h, 32h, 39h
if this works, an led on the microcontroller should blink, which it
isn't
The microcontroller is 9600 baud, it sends 8 bits of data with no
parity. there is one start bit and one end bit.
Can anybody help me here?
Thank you
Doug Carssow
Comments
The problem might be that you are using the BS2sx baudmode, which is
wrong for the BS2pe. Try 16468 instead of 16624. In hex that is
$4054. If that doesn't work, then try $54.
The baud modes for the BS2pe are the same as the BS2 and BS2e.
-- Tracy
>Hello,
>
>I need to connect a BS2pe to a TI microcontroller using a 9600 baud
>serial port. So far, whenever I have sent a series of commands to
>the microcontroller, it does not preform the commands. I have also
>set the mode on the microcontroller using jumpers and connected the
>output to the BS2pe and ran loop containing serin and only received
>output of 00 or 255. the code I have been using to test the input is,
>
>theloop:
>SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),inp(2),inp(3),inp(4),inp(5),inp(6),inp
>(7)]
>DEBUG ? len(0)
>DEBUG ? len(1)
>DEBUG ? len(2)
>DEBUG ? len(3)
>DEBUG ? len(4)
>DEBUG ? len(5)
>DEBUG ? len(6)
>DEBUG ? len(7)
>GOTO theloop
>
>I have also tested it with SERIN 7,16624,[noparse][[/noparse]WAIT(1),inp(0),inp(1),inp
>(2),inp(3),inp(4),inp(5),inp(6),inp(7)]
>
>Because the microcontroller start byte is 01hex, but I never receive
>anything
>
>to output I have been using
>
>SEROUT 7,16624,[noparse][[/noparse]1,9,8,50,57]
>
>what I'm trying to send is 01h, 09h, 08h, 32h, 39h
>if this works, an led on the microcontroller should blink, which it
>isn't
>
>The microcontroller is 9600 baud, it sends 8 bits of data with no
>parity. there is one start bit and one end bit.
>
>Can anybody help me here?
>
>Thank you
>
>Doug Carssow
>
>
>
>
>
>To UNSUBSCRIBE, just send mail to:
> basicstamps-unsubscribe@yahoogroups.com
>from the same email address that you subscribed. Text in the
>Subject and Body of the message will be ignored.
>
>Yahoo! Groups Links
>
>
>
>
> Hello,
>
> I need to connect a BS2pe to a TI microcontroller using a 9600 baud
> serial port. So far, whenever I have sent a series of commands to
> the microcontroller, it does not preform the commands. I have also
> set the mode on the microcontroller using jumpers and connected the
> output to the BS2pe and ran loop containing serin and only received
> output of 00 or 255. the code I have been using to test the input
is,
>
> theloop:
> SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),inp(2),inp(3),inp(4),inp(5),inp(6),inp
> (7)]
> DEBUG ? len(0)
> DEBUG ? len(1)
> DEBUG ? len(2)
> DEBUG ? len(3)
> DEBUG ? len(4)
> DEBUG ? len(5)
> DEBUG ? len(6)
> DEBUG ? len(7)
> GOTO theloop
>
> I have also tested it with SERIN 7,16624,[noparse][[/noparse]WAIT(1),inp(0),inp(1),inp
> (2),inp(3),inp(4),inp(5),inp(6),inp(7)]
>
> Because the microcontroller start byte is 01hex, but I never
receive
> anything
>
> to output I have been using
>
> SEROUT 7,16624,[noparse][[/noparse]1,9,8,50,57]
>
> what I'm trying to send is 01h, 09h, 08h, 32h, 39h
> if this works, an led on the microcontroller should blink, which it
> isn't
>
> The microcontroller is 9600 baud, it sends 8 bits of data with no
> parity. there is one start bit and one end bit.
>
> Can anybody help me here?
>
> Thank you
>
> Doug Carssow
Doug,
Two things to check:
- Does the TI use a standard serial port or is it 5-volt levels?
If its a standard serial port ( ie 9-pin connector )the TI might
also need some handshaking pins jumpered, typically 7 - 8. If its 5-
volt levels, it may be sending with true logic and you might have
change your baudmode parameter.
- Is the TI just sitting there spitting out data? You can
temporarily connect a PC or laptop and run communications software
(hyperterm or the stamp debug window)to check to see if any data is
being transferred. Otherwise, is the TI expecting some sort of query
command before sending the requested data?
Tom Sisk
wrote:
> --- In basicstamps@yahoogroups.com, "Doug" <d.carssow@u...> wrote:
> > Hello,
> >
> > I need to connect a BS2pe to a TI microcontroller using a 9600
baud
> > serial port. So far, whenever I have sent a series of commands
to
> > the microcontroller, it does not preform the commands. I have
also
> > set the mode on the microcontroller using jumpers and connected
the
> > output to the BS2pe and ran loop containing serin and only
received
> > output of 00 or 255. the code I have been using to test the
input
> is,
> >
> > theloop:
> > SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),inp(2),inp(3),inp(4),inp(5),inp
(6),inp
> > (7)]
> > DEBUG ? len(0)
> > DEBUG ? len(1)
> > DEBUG ? len(2)
> > DEBUG ? len(3)
> > DEBUG ? len(4)
> > DEBUG ? len(5)
> > DEBUG ? len(6)
> > DEBUG ? len(7)
> > GOTO theloop
> >
> > I have also tested it with SERIN 7,16624,[noparse][[/noparse]WAIT(1),inp(0),inp
(1),inp
> > (2),inp(3),inp(4),inp(5),inp(6),inp(7)]
> >
> > Because the microcontroller start byte is 01hex, but I never
> receive
> > anything
> >
> > to output I have been using
> >
> > SEROUT 7,16624,[noparse][[/noparse]1,9,8,50,57]
> >
> > what I'm trying to send is 01h, 09h, 08h, 32h, 39h
> > if this works, an led on the microcontroller should blink, which
it
> > isn't
> >
> > The microcontroller is 9600 baud, it sends 8 bits of data with
no
> > parity. there is one start bit and one end bit.
> >
> > Can anybody help me here?
> >
> > Thank you
> >
> > Doug Carssow
>
>
>
> Doug,
>
> Two things to check:
>
> - Does the TI use a standard serial port or is it 5-volt
levels?
> If its a standard serial port ( ie 9-pin connector )the TI
might
> also need some handshaking pins jumpered, typically 7 - 8. If its
5-
> volt levels, it may be sending with true logic and you might have
> change your baudmode parameter.
>
> - Is the TI just sitting there spitting out data? You can
> temporarily connect a PC or laptop and run communications software
> (hyperterm or the stamp debug window)to check to see if any data
is
> being transferred. Otherwise, is the TI expecting some sort of
query
> command before sending the requested data?
>
> Tom Sisk
We have tried to send to hyperterm with the BS2pe to test our
communication settings, but we have been unsuccessful. To test
hyperterm, we jumped pins 2-3 together and typed to see if we got
back what we typed but we didn't. Is there anything I need to setup
on hyperterm to get it to work right? Thank you
Doug Carssow
The problem is that you are using the BS2sx baudmode, which is wrong
for the BS2pe. Try 16468 instead of 16624. The baud modes for the
BS2pe are the same as the BS2 and BS2e.
-- Tracy
> > SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),... WRONG
should be
SERIN 7,16468,[noparse][[/noparse]inp(0),inp(1),...
>We have tried to send to hyperterm with the BS2pe to test our
>communication settings, but we have been unsuccessful. To test
>hyperterm, we jumped pins 2-3 together and typed to see if we got
>back what we typed but we didn't. Is there anything I need to setup
>on hyperterm to get it to work right? Thank you
While you can do those tests from htpe, there are in fact settings
you need to get the right serial port configuration. On the other
hand, you should be able to do the same thing, much easier with the
DEBUG terminal within STAMPW.EXE. When you do that, you will find
that 16468 is the correct baudmode.
- Tracy
> Hi Doug,
>
> The problem is that you are using the BS2sx baudmode, which is
wrong
> for the BS2pe. Try 16468 instead of 16624. The baud modes for
the
> BS2pe are the same as the BS2 and BS2e.
>
> -- Tracy
>
> > > SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),... WRONG
>
> should be
> SERIN 7,16468,[noparse][[/noparse]inp(0),inp(1),...
>
>
> >We have tried to send to hyperterm with the BS2pe to test our
> >communication settings, but we have been unsuccessful. To test
> >hyperterm, we jumped pins 2-3 together and typed to see if we got
> >back what we typed but we didn't. Is there anything I need to
setup
> >on hyperterm to get it to work right? Thank you
>
>
> While you can do those tests from htpe, there are in fact settings
> you need to get the right serial port configuration. On the other
> hand, you should be able to do the same thing, much easier with
the
> DEBUG terminal within STAMPW.EXE. When you do that, you will find
> that 16468 is the correct baudmode.
>
> - Tracy
Thanks for your help. we had actually already been using the correct
baudmode, which I had learned from an earlier post. Mostly we want
to figure out how to use hyperterm to check the output we should be
receiving from our TI microreader. We've been having a hard time
trying to read the output of the microreader into the BS2pe serial
input. We keep on receiving what I'm guessing has to be noise, but
there is some noticable change in the rate at which we receive
serial input into the BS2pe when the microreader should be sending
certain commands. we have it set to wait for 01hex which should be
the start byte of a series of status and data bytes, but a lot of
the time, the following bytes don't make any sense. would we pick up
a lot of noise over a small piece of wire in between the two chips?
the microreader testing board is setup with an RS232 chip that it
uses when being programmed from the computer. would using the RS232,
instead of bypassing it, make much of a difference in noise
reduction? it doesn't seen like it should really be a problem.
Thank you
Doug Carssow
Okay, hyperterminal does need to be configured. Here are links to a
couple of references on how to do that for use with the BASIC Stamp
or other device like your microterminal:
http://www.emesystems.com/OWL2HTPE.txt
http://www.seetron.com/ht_tip1.htm
The StampW Debug window also should also be able to receive the
output from the microterminal.
If the microterminal sends out control codes, like ascii $01, you
will have best insight if you use a capture program on the PC that
can display ascii codes instead of plain text.
Quite often the problem with capturing data on a Stamp is that the
other device sends out data too fast. The Stamp does not have a
buffer and it cannot keep up with full-speed 9600 baud input. So
what you get is garbage. The exact command that you use on the stamp
can make a big difference. For example,
> > SERIN 7,16468,[noparse][[/noparse]inp(0),inp(1),...
is slower in capturing a burst of bytes than,
inp var byte(8)
SERIN 7,16468,[noparse][[/noparse]STR inp\8]
Another problem might be that you have to send a command from the
stamp to the microterminal and the microterminal starts its response
before the stamp is ready for it. It takes the stamp a whole
millisecond to get ready, so if the microterminal transmits its
response 10 microseconds after it receives the command, you're sunk.
These problems often do come down to timing. In tough cases you
would have to resort to an external serial buffer chip.
I presume that once you set the baudmode correctly, now the
microterminal is at least responding to commands sent from the Stamp?
Do you have any control over baud rate and stop bits etc. on the
microterminal?
-- Tracy
>--- In basicstamps@yahoogroups.com, Tracy Allen <tracy@e...> wrote:
>> Hi Doug,
>>
>> The problem is that you are using the BS2sx baudmode, which is
>wrong
>> for the BS2pe. Try 16468 instead of 16624. The baud modes for
>the
>> BS2pe are the same as the BS2 and BS2e.
>>
>> -- Tracy
>>
> > > > SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),... WRONG
>>
> > should be
> > SERIN 7,16468,[noparse][[/noparse]inp(0),inp(1),...
> >
>>
>> >We have tried to send to hyperterm with the BS2pe to test our
>> >communication settings, but we have been unsuccessful. To test
> > >hyperterm, we jumped pins 2-3 together and typed to see if we got
> > >back what we typed but we didn't. Is there anything I need to
>setup
> > >on hyperterm to get it to work right? Thank you
>>
>>
>> While you can do those tests from htpe, there are in fact settings
>> you need to get the right serial port configuration. On the other
>> hand, you should be able to do the same thing, much easier with
>the
>> DEBUG terminal within STAMPW.EXE. When you do that, you will find
>> that 16468 is the correct baudmode.
>>
>> - Tracy
>
>Thanks for your help. we had actually already been using the correct
>baudmode, which I had learned from an earlier post. Mostly we want
>to figure out how to use hyperterm to check the output we should be
>receiving from our TI microreader. We've been having a hard time
>trying to read the output of the microreader into the BS2pe serial
>input. We keep on receiving what I'm guessing has to be noise, but
>there is some noticable change in the rate at which we receive
>serial input into the BS2pe when the microreader should be sending
>certain commands. we have it set to wait for 01hex which should be
>the start byte of a series of status and data bytes, but a lot of
>the time, the following bytes don't make any sense. would we pick up
>a lot of noise over a small piece of wire in between the two chips?
>the microreader testing board is setup with an RS232 chip that it
>uses when being programmed from the computer. would using the RS232,
>instead of bypassing it, make much of a difference in noise
>reduction? it doesn't seen like it should really be a problem.
>Thank you
>
>Doug Carssow
> --- In basicstamps@yahoogroups.com, "stamptrol" <sisk1404@n...>
> wrote:
> > --- In basicstamps@yahoogroups.com, "Doug" <d.carssow@u...> wrote:
> > > Hello,
> > >
> > > I need to connect a BS2pe to a TI microcontroller using a 9600
> baud
> > > serial port. So far, whenever I have sent a series of commands
> to
> > > the microcontroller, it does not preform the commands. I have
> also
> > > set the mode on the microcontroller using jumpers and connected
> the
> > > output to the BS2pe and ran loop containing serin and only
> received
> > > output of 00 or 255. the code I have been using to test the
> input
> > is,
> > >
> > > theloop:
> > > SERIN 7,16624,[noparse][[/noparse]inp(0),inp(1),inp(2),inp(3),inp(4),inp(5),inp
> (6),inp
> > > (7)]
> > > DEBUG ? len(0)
> > > DEBUG ? len(1)
> > > DEBUG ? len(2)
> > > DEBUG ? len(3)
> > > DEBUG ? len(4)
> > > DEBUG ? len(5)
> > > DEBUG ? len(6)
> > > DEBUG ? len(7)
> > > GOTO theloop
> > >
> > > I have also tested it with SERIN 7,16624,[noparse][[/noparse]WAIT(1),inp(0),inp
> (1),inp
> > > (2),inp(3),inp(4),inp(5),inp(6),inp(7)]
> > >
> > > Because the microcontroller start byte is 01hex, but I never
> > receive
> > > anything
> > >
> > > to output I have been using
> > >
> > > SEROUT 7,16624,[noparse][[/noparse]1,9,8,50,57]
> > >
> > > what I'm trying to send is 01h, 09h, 08h, 32h, 39h
> > > if this works, an led on the microcontroller should blink,
which
> it
> > > isn't
> > >
> > > The microcontroller is 9600 baud, it sends 8 bits of data with
> no
> > > parity. there is one start bit and one end bit.
> > >
> > > Can anybody help me here?
> > >
> > > Thank you
> > >
> > > Doug Carssow
> >
> >
> >
> > Doug,
> >
> > Two things to check:
> >
> > - Does the TI use a standard serial port or is it 5-volt
> levels?
> > If its a standard serial port ( ie 9-pin connector )the TI
> might
> > also need some handshaking pins jumpered, typically 7 - 8. If its
> 5-
> > volt levels, it may be sending with true logic and you might have
> > change your baudmode parameter.
> >
> > - Is the TI just sitting there spitting out data? You can
> > temporarily connect a PC or laptop and run communications
software
> > (hyperterm or the stamp debug window)to check to see if any data
> is
> > being transferred. Otherwise, is the TI expecting some sort of
> query
> > command before sending the requested data?
> >
> > Tom Sisk
>
> We have tried to send to hyperterm with the BS2pe to test our
> communication settings, but we have been unsuccessful. To test
> hyperterm, we jumped pins 2-3 together and typed to see if we got
> back what we typed but we didn't. Is there anything I need to setup
> on hyperterm to get it to work right? Thank you
>
> Doug Carssow
Doug,
Hyperterm will usually try the patience of a saint!!
When you start Hyperterm up, immediately go to "File",
Properties, make sure the correct Com port is selected ( COM 1, I
expect) and then click on Configuration. Check that the speed is the
same as you want to use with the Stamp. At 'Flow Control, change it
to None.
Then, jumper 2 and 3 and try again.
Tom Sisk
the bs2pe was having a hard time receiving the incoming data at 9600
baud so we used a RSB509b from Protean Logic. it's a 32 byte buffer
for serial input. after that, we were finally able to receive data
expected to be sent by the TI microreader. Now we just need to fix a
little problem that we might be having with the buffer overflowing,
but we think that if we call Protean they can tell us how to fix
that. stamptrol and Tracy, thanks for your help
Doug Carssow
have any trouble receiving data at 9600 baud -- unless you're doing a
lot of really messy stuff with input formatters. And keep in mind that
the BS2pe can buffer data to the Scratchpad RAM (using the SPSTR
modifier) -- this works very well if you're receiving fixed-length
packets.
-- Jon Williams
-- Parallax
Original Message
From: Doug [noparse]/noparse]mailto:[url=http://forums.parallaxinc.com/group/basicstamps/post?postID=PHwfIopef2gbbx876GF2uAliCEhXfPUc5_UYZ8lC3TwQfx9Ln1WaXIPzqArky3Y2KeKa5C1hfU2o0KQw]d.carssow@u...[/url
Sent: Monday, March 15, 2004 10:45 AM
To: basicstamps@yahoogroups.com
Subject: [noparse][[/noparse]basicstamps] Re: Using BS2pe serial port
Alright, we found a way to fix our problem. from what we could tell,
the bs2pe was having a hard time receiving the incoming data at 9600
baud so we used a RSB509b from Protean Logic. it's a 32 byte buffer
for serial input. after that, we were finally able to receive data
expected to be sent by the TI microreader. Now we just need to fix a
little problem that we might be having with the buffer overflowing,
but we think that if we call Protean they can tell us how to fix
that. stamptrol and Tracy, thanks for your help
Doug Carssow
To UNSUBSCRIBE, just send mail to:
basicstamps-unsubscribe@yahoogroups.com
from the same email address that you subscribed. Text in the Subject
and Body of the message will be ignored.
Yahoo! Groups Links
This message has been scanned by WebShield. Please report SPAM to
abuse@p....