Searching \ for 'Dip Switches Replacement' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: www.piclist.com/techref/index.htm?key=dip+switches+replacement
Search entire site for: 'Dip Switches Replacement'.

Truncated match.
PICList Thread
'Dip Switches Replacement'
1998\07\03@005503 by Alvin Tan

flavicon
face
Could someone suggest whats the best way to replace 40 dip switches?  I
have 10 preset settings that I require.  Some have pull up resistors,
and some has Pull-down resistors, and some are just stright switches.

       Thank You in advance for taking some time to read this.


Alvin Tan

spam_OUTAlvin_TanTakeThisOuTspambc.sympatico.ca

1998\07\03@030607 by Peter L. Peres

picon face
On Thu, 2 Jul 1998, Alvin Tan wrote:

> Could someone suggest whats the best way to replace 40 dip switches?  I
> have 10 preset settings that I require.  Some have pull up resistors,
> and some has Pull-down resistors, and some are just stright switches.
>
>         Thank You in advance for taking some time to read this.
>
>
> Alvin Tan
>
> .....Alvin_TanKILLspamspam@spam@bc.sympatico.ca

For pull-ups and pull-downs you can substitute PIC outputs directly. A
pull-up is obtained by setting the pin to HIGH and then turning the
tristate control to OUTPUT. To turn off, turn the tristate control to
INPUT. For pull-low you need to output a LOW in the register bit and
control the tristate as shown.

If I understand what I think I understand with 'straight' switches, you
can use either CD 4066 or CD 4052 analog multiplexers or relays depending
on specs. There are also other more powerful analog switches to be had,
but they cost an arm and a leg (intended for video applications mainly).

Figure 1 PIC IO pin per item to be controlled. With 40 IO pins, you could
use two PIC 64's or 66's, but they would be grossly under-used if only
doing this.

The other way to do this, is to use latching bus shift registers and build
a daisy chain of them. This is a simple bus expander. This has nothing to
do with PICs but it's a good general solution when many outputs are to be
controlled at a slow rate.  The registers that I use (by the bucketfull)
when it comes to these things, are CD 4094 CMOS registers (and their
functional complements, CD 4021s). These can be cascaded directly (w/o
glue), have tristate outputs themselves, and are fast enough to be driven
by a PIC at top speed. Thy require 3 wires from the PIC no matter how long
the register. You have 8 CMOS outputs per chip used, tristate-able
together (all 8).

Depending on how many of your switches are 'straight through' ones, you
could get away with a PIC 64 or 66 and one or two 4094s that would drive
the analog switches. Of course you could use two 64s.

hope this helps,

       Peter

1998\07\03@225042 by ephen Rothlisberger

picon face
>Could someone suggest whats the best way to replace 40 dip switches?  I
>have 10 preset settings that I require.  Some have pull up resistors,
>and some has Pull-down resistors, and some are just stright switches.

We did this for some telco equipment we upgraded. We replaced 5 sets of 8
dip switches (yes, 40 in total) with a small 8x1 LCD and three pushbuttons.
We then used an 18-pin microcontroller (not PIC that time) with some EEPROM
on it, and the dip switches became virtual. The user selected the settings
off the screen. We also used the LCD's user-programmable characters to
graphically simulate the old dip switches. The whole thing ended up taking
less space than the original dip switches. More expensive, of course (but
on the equipment it went into that didn't matter), but much more versatile
and more fun!

Stephen.

1998\07\04@122312 by Alvin Tan

flavicon
face
That's what exactly I am looking for.  The unit that I need to replace
the dip switches is for testing purposes.  The Dip Switches is used for
setting the ID of the unit to be tested.  By replacing the dip switches,
we don't have to pull the card each time and set the dip switches for
the ID of the unit being tested.

       I was thinking of using (as Peter Peres suggested) 5 x CD4091 (8 bit
shift registers with latches) and then it's output is used to control 10
x CD4066 (qual bilateral switches).

       Is this how you did yours?  If not could you tell me more how you
tackled this problem.  Thank You.


Stephen Rothlisberger wrote:
{Quote hidden}

Alvin Tan

Alvin_TanspamKILLspambc.sympatico.ca

1998\07\05@034549 by paulb

flavicon
face
Alvin Tan wrote:

> The Dip Switches are used for setting the ID of the unit to be tested.
> By replacing the dip switches, we don't have to pull the card each
> time and set the dip switches for the ID of the unit being tested.

 This sounds OK.

> I was thinking of using (as Peter Peres suggested) 5 x CD4091 (8 bit
> shift registers with latches)

 So far, so good.

> and then it's output is used to control 10 x CD4066 (quad bilateral
> switches).

 Hey!  You've lost me there! what would you use quad bilateral switches
for?  This ID system is set by analog components?  Resistors?
Capacitors?

--
 Cheers,
       Paul B.

1998\07\05@174134 by ephen Rothlisberger

picon face
>That's what exactly I am looking for.  The unit that I need to replace
>the dip switches is for testing purposes.  The Dip Switches is used for
>setting the ID of the unit to be tested.  By replacing the dip switches,
>we don't have to pull the card each time and set the dip switches for
>the ID of the unit being tested.
>
>        I was thinking of using (as Peter Peres suggested) 5 x CD4091 (8 bit
>shift registers with latches) and then it's output is used to control 10
>x CD4066 (qual bilateral switches).
>
>        Is this how you did yours?  If not could you tell me more how you
>tackled this problem.  Thank You.

It all depends on what you want to do with the data from your dip switches.
On our original system we had the system microcontroller read the dip
switches by accessing buffers (74HC541) sequentially, retreiving the data a
byte at a time. For 40 dip switches, this was five buffers plus an address
decoder.

In the new system, we threw out the dip switches, the buffers and the
address decoder altogether, and replaced them with an LCD module and a
single microcontroller. The data and address lines from the system
microcontroller went directly to the new microcontroller. From the point of
view of the system microcontroller (the "customer" of the dip switch data)
nothing had changed. If it accessed address 0 it still got the same eight
bits of configuration info. On the "supply" side, however, everything was
different. Instead of switches and buffers providing the data (or in your
case the 4091 and 4066 chips), it was a microcontroller providing the data.
The old system interfaced with the user via electromechanical switches (the
dip switches), while the new system interfaced with the user via the LCD
and three pushbuttons.

In other words, we replaced the "real" dip switches with "virtual" dip
switches.

Stephen.


{Quote hidden}

1998\07\06@114342 by Peter L. Peres

picon face
>4091

Just case you got it wrong: The registers are 4094 and 4021, not 4091.

Peter

1998\07\06@182749 by paulb

flavicon
face
Stephen Rothlisberger wrote:

> In the new system, we threw out the dip switches, the buffers and the
> address decoder altogether, and replaced them with an LCD module and a
> single microcontroller. The data and address lines from the system
> microcontroller went directly to the new microcontroller. From the
> point of view of the system microcontroller ... If it accessed address
> 0 it still got the same eight bits of configuration info.

 Neat.  But the only microcontroller of which I know capable of that is
the "virtual peripheral" 8042/ 8742 whose biggest single application was
and still is to implement the keyboard controller of the AT and all
later PCs.

 Is there any other MCU which has an interface (virtually a small
twin-port RAM) designed to look *like*, rather than look *at*, an I/O
port?  It certainly has its uses.

--
 Cheers,
       Paul B.

1998\07\06@205308 by Mike Keitz

picon face
On Tue, 7 Jul 1998 08:19:15 +1000 "Paul B. Webster VK2BZC"
<EraseMEpaulbspam_OUTspamTakeThisOuTmidcoast.com.au> writes:

>  Is there any other MCU which has an interface (virtually a small
>twin-port RAM) designed to look *like*, rather than look *at*, an I/O
>port?  It certainly has its uses.

Most of the 40-pin PIC chips have a "parallel slave port" mode where one
of the I/O ports becomes a register which can be read or written by an
external processor.  Three pins become the CS, RD, and WR controls.  When
the "master" processor accesses the port, the PIC gets an interrupt so it
can figure out what to do next.  Since it is only a single byte port, the
feature is limited compared to the 8042.  If I remember the 8042 also
accepted an address line from the master CPU so it would act like two
ports.  Typically one was used for commands and one for data.  The PIC
would need to sort out commands from data by software, complicating the
communication process.

I've done quite a bit of stuff replacing DIP switches and arrays of
diodes by using a PIC which synchronizes to the other system and outputs
the switch data at the right time.  The 84 is excellent for this since
the settings can be stored in internal EEPROM.


_____________________________________________________________________
You don't need to buy Internet access to use free Internet e-mail.
Get completely free e-mail from Juno at http://www.juno.com
Or call Juno at (800) 654-JUNO [654-5866]

1998\07\07@090327 by paulb

flavicon
face
Mike Keitz wrote:

> Most of the 40-pin PIC chips have a "parallel slave port" mode where
> one of the I/O ports becomes a register which can be read or written
> by an external processor.

 They're above my requirements/ price range, so I hadn't looked.

> Since it is only a single byte port, the feature is limited compared
> to the 8042.

 I thought as much.

> If I remember the 8042 also accepted an address line from the master
> CPU so it would act like two ports.  Typically one was used for
> commands and one for data.

 That's about the size of it, and exactly how used in the PC AT.
Actually, my memory relates to the 8041 as that's the version my manual
details - but then it's the 1978 version.  I wonder if the 8041/ 8042/
8742/ 8748 datasheets are available on the web?

> I've done quite a bit of stuff replacing DIP switches and arrays of
> diodes by using a PIC which synchronizes to the other system and
> outputs the switch data at the right time.

 In other words, both chips are reset together, the PIC asserts the
first byte; waits for a strobe or interrupt indicating this has been
read; asserts the next and so on assuming they are read in a certain
sequence and only once?  If so, sneaky!

 Cheers,
       Paul B.

More... (looser matching)
- Last day of these posts
- In 1998 , 1999 only
- Today
- New search...