Using COM flags to step a shift register

  • Thread starter Blog the Haggis
  • Start date
B

Blog the Haggis

Guest
Hello,

I'm trying to use COMport flags (RTS & DTR) to load and step a shift
register but I'm getting an erratic output. It looks like the register is
occasionally stepping more than once on a single pulse, and I can't figure
out why.

Do the COM lines needed debouncing? I wouldn't have thought so... maybe I
should use the flag signals to trigger a monostable 555 timer?

Can anyone give me some pointers? I'm really stuck here...

-Duncan
 
Blog the Haggis <blah@nospam.org> wrote in
message news:blg80q$rs3$1@lust.ihug.co.nz...

I'm trying to use COMport flags (RTS & DTR) to load
and step a shift register but I'm getting an erratic output.
It looks like the register is occasionally stepping more
than once on a single pulse, and I can't figure out why.
How are you driving it at the PC end ?

Do the COM lines needed debouncing? I wouldn't have thought so...
Nope.

maybe I should use the flag signals to trigger a monostable 555 timer?
Shouldnt be necessary.

> Can anyone give me some pointers? I'm really stuck here...
 
Blog the Haggis <blah@nospam.org> wrote in
message news:blg80q$rs3$1@lust.ihug.co.nz...

I'm trying to use COMport flags (RTS & DTR) to load
and step a shift register but I'm getting an erratic output.
It looks like the register is occasionally stepping more
than once on a single pulse, and I can't figure out why.
How are you driving it at the PC end software wise etc ?

Do the COM lines needed debouncing? I wouldn't have thought so...
Nope.

maybe I should use the flag signals to trigger a monostable 555 timer?
Shouldnt be necessary.

> Can anyone give me some pointers? I'm really stuck here...
 
RS232 level could certainly bounce if the driving source wasn't clean, such
as a relay contact - the interface is designed to handle tens of thousands
of transitions a second.

Blog the Haggis <blah@nospam.org> wrote in message
news:blg80q$rs3$1@lust.ihug.co.nz...
Hello,

I'm trying to use COMport flags (RTS & DTR) to load and step a shift
register but I'm getting an erratic output. It looks like the register is
occasionally stepping more than once on a single pulse, and I can't figure
out why.

Do the COM lines needed debouncing? I wouldn't have thought so... maybe I
should use the flag signals to trigger a monostable 555 timer?

Can anyone give me some pointers? I'm really stuck here...

-Duncan
 
Blog the Haggis <blah@nospam.org> wrote in message
news:blg80q$rs3$1@lust.ihug.co.nz...
Hello,

I'm trying to use COMport flags (RTS & DTR) to load and step a shift
register but I'm getting an erratic output. It looks like the register is
occasionally stepping more than once on a single pulse, and I can't figure
out why.

Do the COM lines needed debouncing? I wouldn't have thought so... maybe I
should use the flag signals to trigger a monostable 555 timer?

Can anyone give me some pointers? I'm really stuck here...

-Duncan
My previous response was a silly one, wasn't it. RTS & DTR are outputs. One
thing I would check is the circuitry if you have something for converting
the RS232 to whatever level you're using to drive the register. It could be
causing multiple, very fast transitions on the data edges if eg. your
circuit is a comparator type arrangement with no hysteresis.
 
Hi Bruce & Rod,
thanks for the reply.

I am using the RTS line as a clock and the DTR line as the load/shift
selector. I am also using the CTS line as an input for 'bit-bashing'. All of
the these lines are running through a standard RS-232 line driver and
receiver.

Code at the moment asserts the DTR line to load the register (it's an
asynchronous loader), waits 100ms, checks the CTS line for the first bit,
stores the value, asserts the RTS line to shift the byte 1 place, waits 100
ms, sets the RTS to low, checks the next bit... etc for 8 iterations

I've tried this with faster and slower pause periods but with varying
success. Sometimes it reads all 8 bits, sometimes it skips a few and loads
the trailing logic zeros from the hard-wired serial input.

I have manually loaded and stepped the circuit and it all seems to work
fine, it's just not getting to the computer for some reason...

-Duncan
 
"Blog the Haggis" <blah@nospam.org> wrote in message news:blh7to$ql3$1@lust.ihug.co.nz...
Hi Bruce & Rod,
thanks for the reply.

I am using the RTS line as a clock and the DTR line as the load/shift
selector. I am also using the CTS line as an input for 'bit-bashing'. All of
the these lines are running through a standard RS-232 line driver and
receiver.

Code at the moment asserts the DTR line to load the register (it's an
asynchronous loader), waits 100ms, checks the CTS line for the first bit,
stores the value, asserts the RTS line to shift the byte 1 place, waits 100
ms, sets the RTS to low, checks the next bit... etc for 8 iterations

I've tried this with faster and slower pause periods but with varying
success. Sometimes it reads all 8 bits, sometimes it skips a few and
loads the trailing logic zeros from the hard-wired serial input.
I'd do some basic checks like checking if you can clock
whatever is being driven reliably. While the the Rx and Tx
are designed for high data rates, the RTS line isnt, and it
may just be that you arent actually getting a clean clock
signal out of it or something because you are driving it too fast.

Obviously look at the RTS line with a cro if you can. If you
cant, just use it to clock a FF etc and see that it ends up in
the state it should after you have sent 100 clocks etc.

If that fine, it could well be a problem
with the CTS being driven properly etc.

I have manually loaded and stepped the circuit and it all seems
to work fine, it's just not getting to the computer for some reason...
 
----- Original Message -----
From: "Rod Speed" <rod_speed@yahoo.com>
Newsgroups: aus.electronics
Sent: Friday, October 03, 2003 10:37 AM
Subject: Re: Using COM flags to step a shift register
I'd do some basic checks like checking if you can clock
whatever is being driven reliably. While the the Rx and Tx
are designed for high data rates, the RTS line isnt, and it
may just be that you arent actually getting a clean clock
signal out of it or something because you are driving it too fast.

Obviously look at the RTS line with a cro if you can. If you
cant, just use it to clock a FF etc and see that it ends up in
the state it should after you have sent 100 clocks etc.

If that fine, it could well be a problem
with the CTS being driven properly etc.
Sorry Rod, accidently replied to your email address.

Yeah, I had already looked at the clock signal on the CRO and it looks nice,
no transients even at high frequencies. The timing of the RTS and DTR lines
looks right for the load/shift cycle and the LED indicator I put on the
output is doing all the right things.

As you said, I thought it might be the CTS line but I wrote some test code
that read square wave from the CTS line faster than 200Hz so it seems to be
getting there, so maybe my problem is software.

*scratches head* I just removed the delay times between the high-low
transitions on all lines and now it seems to be working... must be running
in the kHz range now. Is it possible that my shift register doesn't like
slow clock pulses?

-Duncan
 
Blog the Haggis <blah@nospam.org> wrote in
message news:blj6in$6po$1@lust.ihug.co.nz...

I'd do some basic checks like checking if you can clock
whatever is being driven reliably. While the the Rx and Tx
are designed for high data rates, the RTS line isnt, and it
may just be that you arent actually getting a clean clock
signal out of it or something because you are driving it too fast.

Obviously look at the RTS line with a cro if you can. If you
cant, just use it to clock a FF etc and see that it ends up in
the state it should after you have sent 100 clocks etc.

If that fine, it could well be a problem
with the CTS being driven properly etc.

Sorry Rod, accidently replied to your email address.
I wont even notice due to the stupid Swen spew.

Yeah, I had already looked at the clock signal on the CRO and
it looks nice, no transients even at high frequencies. The timing
of the RTS and DTR lines looks right for the load/shift cycle and
the LED indicator I put on the output is doing all the right things.

As you said, I thought it might be the CTS line but I wrote some
test code that read square wave from the CTS line faster than 200Hz
so it seems to be getting there, so maybe my problem is software.
Yeah, or whats driving the CTS line isnt really up to the job.

*scratches head* I just removed the delay times between
the high-low transitions on all lines and now it seems to be
working... must be running in the kHz range now. Is it possible
that my shift register doesn't like slow clock pulses?
I guess it might not if you havent got a proper DC signal path.
 

Welcome to EDABoard.com

Sponsor

Back
Top