| 1 |
From [email protected] Thu Jan 1 05:56:53 1998 |
| 2 |
Received: from aleve.media.mit.edu by hub.media.mit.edu; (5.65v3.2/1.1/06Jun95-8.2MPM) |
| 3 |
id AA29720; Thu, 1 Jan 1998 05:56:53 -0500 |
| 4 |
Received: from kott.my.domain ([email protected] [198.110.144.127]) |
| 5 |
by aleve.media.mit.edu (8.8.7/ML970927) with ESMTP id FAA31795 |
| 6 |
for <[email protected]>; Thu, 1 Jan 1998 05:06:14 -0500 (EST) |
| 7 |
Received: from kott.my.domain ([email protected] [192.168.0.1]) |
| 8 |
by kott.my.domain (8.8.8/8.8.5) with SMTP id FAA01072 |
| 9 |
for <[email protected]>; Thu, 1 Jan 1998 05:06:33 -0500 (EST) |
| 10 |
Date: Thu, 1 Jan 1998 05:06:32 -0500 (EST) |
| 11 |
From: David Kott <[email protected]> |
| 12 |
Sender: [email protected] |
| 13 |
To: [email protected] |
| 14 |
Subject: Re: Digital outputs. |
| 15 |
In-Reply-To: <[email protected]> |
| 16 |
Message-Id: <[email protected]> |
| 17 |
Mime-Version: 1.0 |
| 18 |
Content-Type: TEXT/PLAIN; charset=US-ASCII |
| 19 |
|
| 20 |
On Wed, 31 Dec 1997, Tom Brusehaver wrote: |
| 21 |
|
| 22 |
<snip> |
| 23 |
> |
| 24 |
> G> Wich are the options to have 3 digital outputs in the handyboard? |
| 25 |
> G> No matter if i have to do little modifications to the Hardware. I |
| 26 |
> G> already know how to conect the keypad if you can tell me how |
| 27 |
> G> obtain 3 outputs.. :) |
| 28 |
> |
| 29 |
> |
| 30 |
> The SPI port is sitting there. I think you can get at 3 outputs from |
| 31 |
> those pins (SD/RD/CLK). |
| 32 |
> |
| 33 |
</snip> |
| 34 |
|
| 35 |
yet ANOTHER idea, if you are suitably masochistic, is to use the SPI port |
| 36 |
for a much more extensible I/O system. As you know, SPI uses 4 basic |
| 37 |
control signals, MOSI, MISO, CLK and SS... Ok, what we used to do in |
| 38 |
Embedded Controllers class is hook up a Serial In/Parallel Out |
| 39 |
(hereforward referred to as a SIPO) shift register. You must have at |
| 40 |
least ONE output available, so, this pretty much eliminates a L293 or, if |
| 41 |
you are bold enough, obtain additional outputs using a '138 as outlined in |
| 42 |
the HandyBoard FAQ. A SIPO you might use is the 8 bit 74164. |
| 43 |
|
| 44 |
Hook the DATA IN on the SIPO to the MOSI pin on the SPI. Hook the |
| 45 |
SPI's CLK output to the SIPO's clock pin. Use a transparent latch to |
| 46 |
update and hold the data on the outputs of the SIPO and update it with the |
| 47 |
one output pin, perhaps a 74373. |
| 48 |
|
| 49 |
To update the new 8 bits of data appearing at your latch's output, you load |
| 50 |
the SPI's data register with the byte value that you want to have across |
| 51 |
your new outputs. This data will be shifted out during the next 8 E-clock |
| 52 |
cycles. After the SPI's data register is empty indicating that the SIPO |
| 53 |
has the output byte on it's parallel outputs, pulse the single control |
| 54 |
output to update the latch's outputs. |
| 55 |
|
| 56 |
With this arrangement, you could, in theory, have many, many SIPO shift |
| 57 |
register/Latch pairs; the Serial Data In of the next stage connected to |
| 58 |
the last Parallel Output on the previous adjacent stage. |
| 59 |
|
| 60 |
One would just have to make sure that you coordinated the number of stages |
| 61 |
with the number of bytes outshifted by the SPI data register (naturally). |
| 62 |
The downside to this arrangement is the time it takes to update a digital |
| 63 |
output. The entire train (8 bits, 16 bits, 24 bits... more?) Need to be |
| 64 |
loaded and shifted out to change just ONE output. The upside is, the data |
| 65 |
will shift at 2 Mhz, which makes for a (250 ns * [8+2] ) 2.5 ms update |
| 66 |
time. Not suitable for time critical applications, (PWM, Communication) |
| 67 |
but not bad for bulk outputs. |
| 68 |
|
| 69 |
I don't think I have explained my little circuit here very well.. perhaps |
| 70 |
an ASCII graphic? |
| 71 |
|
| 72 |
Output originally going to an L293D |
| 73 |
+---------------------------------------+ |
| 74 |
|Or added via a '138 from the | |
| 75 |
|expansion buss. | |
| 76 |
| +--+----+ |
| 77 |
+----+---------+ +---------+ | LE | |
| 78 |
| | SPI CLK |'164 PO0|----| '373 |---- |
| 79 |
| +-----------+ CP PO1|----| |---- |
| 80 |
| 68HC11 | SPI MOSI | PO2|----| |---- |
| 81 |
| +-----------+ Data PO3|----| |---- New |
| 82 |
| | | PO4|----| |---- Digital |
| 83 |
+--------------+ | PO5|----| |---- Outputs |
| 84 |
| PO6|----| |---- |
| 85 |
| PO7|----| |---- |
| 86 |
+---------+ +-------+ |
| 87 |
|
| 88 |
|
| 89 |
Where: |
| 90 |
PO# is a "Parallel Output" on a SIPO |
| 91 |
Data is the "Serial Data Input" on a SIPO |
| 92 |
CP is the SIPO's clock |
| 93 |
|
| 94 |
|
| 95 |
-d |
| 96 |
|
| 97 |
|
| 98 |
Win95/NT - 32 bit extensions and a graphical shell for a 16 bit patch to |
| 99 |
an 8 bit operating system originally coded for a 4 bit microprocessor, |
| 100 |
written by a 2 bit company that can't stand 1 bit of competition. -UGU |
| 101 |
|
| 102 |
|
| 103 |
|