Re: Single pin to control a shift register



Tomás Ó hÉilidhe wrote:

(I already posted this but it didn't show up after half an hour
so I posted it again. If there's a duplicate thread, then please
ignore THIS one and put all replies in the other thread.)

Usenet posts can take their time. One principle is: Never assume
anyone has (or will) receive all posts, so make each message stand
by itself. That's why there are quoting facilities.

I'm just a novice really in embedded systems, and I'm doing a
college project. I've already gotten my board made and already
stuffed it with components, so the time for backtracking the
design has been and gone. My design might not be brilliant, but
I hope it will work in the end. Here goes...

I have an 8-Bit shift register chip, and at any time there will
only be one HIGH on it. For instance:

1000000
.... snip ...
0000001

Each shift-register pin will go to a single LED, and the HIGH
will be used to power one LED at a time. The shift register will
be clocked so fast that I'll have 8 LED's that will look like
they're all on at the same time.

First point - look at the drive current available from the chip.
Usually much more is available in the low state than the high. So
you should reverse your logic (or use an inverter to drive the
LED), i.e.

01111111
...
11111110

Now I could have done this fairly easily using TWO pins from my
microcontroller. The first pin would go to the actual shift
register input, and the second pin would go to the clock input on
the shift register. (An RC circuit would be put on the shift
register's master reset to make sure that we start off with all
zeroes). When the micrcontroller boots up, I would put a HIGH
onto the input, clock it, then set the input low, then clock it
a further six times, then set the input high again, clock it, set
the input low, then clock it a further six times, ad infinitum.

Very iffy. You don't know the relationship between the RC circuit,
the oscillator, and the gate thresholds. So avoid it all. In
part, this depends on the available input signals to the SR. The
idea is to get it into all 1's, and then feed in a single zero. If
you use an inverter on the output pin you can use all 0's and feed
in a single one. If you use a register within the microcontroller,
you can set up just what you need. Then the 'shift code' can be:

if (rh_bit == 0) next_state = 01111111b;
else next_state = (old_state / 2) | 10000000b;

which you perform on one clock edge. On the other clock edge you
perform

old_state = next_state;

Good luck.

--
[mail]: Chuck F (cbfalconer at maineline dot net)
[page]: <http://cbfalconer.home.att.net>
Try the download section.



--
Posted via a free Usenet account from http://www.teranews.com

.



Relevant Pages

  • Re: Just one pin to control a shift register
    ... My design might not be brilliant, but I hope it will work in the end. ... Jumper a pin from the PIC to the SR so that you clock it properly. ... The first pin would go to the actual shift register ...
    (comp.arch.embedded)
  • Single pin to control a shift register
    ... I have an 8-Bit shift register chip, and at any time there will only ... Each shift-register pin will go to a single LED, ... micrcontroller boots up, I would put a HIGH onto the input, clock it, ... On the input to the shift register, I put an OR gate. ...
    (comp.arch.embedded)
  • Just one pin to control a shift register
    ... I have an 8-Bit shift register chip, and at any time there will only ... Each shift-register pin will go to a single LED, ... micrcontroller boots up, I would put a HIGH onto the input, clock it, ... On the input to the shift register, I put an OR gate. ...
    (comp.arch.embedded)
  • Clock and Asynchronous Reset with just one pin
    ... As you clock it, the output pins go high in sequence. ... I'm going to take the microcontroller pin ... Given that the pulses will be 1 microsecond in length, ... When a 1 microsecond pulse is applied, the voltage doesn't swing ...
    (comp.arch.embedded)
  • Re: LCD controlling with comparators
    ... It listens to a pendulum clock ticking and measures the time between the ... latch pin since it tells the slave pick when to capture the information. ... This means it needs a pullup resistor when used as an ...
    (sci.electronics.basics)