'Err, this is SO confusing =('
This is my attempt to help get the list back on topic. I received my samples
from Maxim, the MAX187, it's a 12-Bit Serial ADC. Anyways, I get so
discouraged over the idea of 3-Wire interfaces. I'm coming here as a last
resort, I've tried MANY search engines on this topic, but the sites I come up
with are hard to understand. I think it's due to my lack of knowledge in
electronics. Ok, I'll get to the point. What I want to do is use a Cds Cell
for light measurement (duh) using an ADC. But this is where I get stuck. I've
read and understand the general operation of the 3-wire bus, BUT, I'm not
sure as to how exactly it's done. I want to interface this ADC to my parallel
port so that way I can test it, and learn it. I know most of you guys (and
gals) can implement this protocol in a PIC with no problem, but for me, I
feel like I would be doing it blindly. I usually use VB, and I use the
debugger window to output data recv'd on the printer port. It all comes down
to this...is there a simple way to use the parallel port to control this ADC?
I know that once I master the operation on a parallel port, that I could
easily master it on the PIC (because I don't have to worry about inverted
signals). And another (I know I'll owe ya guys big for all these questions)
question, if I use pullups, how is it possible to bring a line LOW if it's
being pulled up to Vdd? I could go on and on with questions, but many of them
I feel I could answer myself with a little more study, but these questions
are the toughies. If I ever strike it rich with an idea, I'll make sure and
send a check to you guys =)
It's hard to express appreciation in words....but,
Tim, if you can control individually 2 pins (output) of the PC parallel
port, and read a third pin as input, then you are able to make it works.
The procedure is simple;
1) Max187 pin 1 and 3 to +5Vdc, pin 4 with a cap 1-10uF to ground, pin 5
to ground, analog input (up to +5Vdc) to pin 2.
2) Connect one Parallel port output pin to Max187 pin 7 (CS), and
another to pin 8 (SCLK). The parallel port input pin goes to Max187 pin
3) At parallel port set output CS up and output SCLK down.
4) Now set CS output pin DOWN (ground). It starts the Max187 internal
5) Read Max187 pin 6 (DOUT), it would be low level, wait it to comes up,
it means the Max187 conversion is done (It can take ±9us).
6) Now you need a sequence of 16 loops to generate the SCLK pulses to
get the serial data out of the Max187. Just flip up, and then flip down
the SCLK at the parallel port, then read pin DOUT. This would be the
first bit, high order bit. Repeat SCLK up and down more 15 times,
reading the DOUT pin.
7) Max187 would supply you the 12 conversion bits at the first 12
failing SCLK pulses, the last 4 bits will be zeros, just ignore them.
If the Max187 16 bits output is 0001 1001 0100 0000, just ignore the
last four, your reading value would be 194 in hexadecimal.
8) it is not imperative to send 16 SCLK pulses, you can abort it right
after the 13th SCLK bit, raising CS pin.
I think this will works. You can contact me directly if needed.
Tim, about the pullups... think of it just as an elastic rubber band
pulling something up, you can easily pull it down to ground with your
hand because the "pull up" is elastic and weak, right? The same with
the pull up resistors, they just pull Vdd level to that pin, but another
low level signal stronger than what the resistor is doing would pull
that pin voltage to ground... The pull up voltage offered by pull up
resistors (5k or more Ohms) is somehow weak and any circuit output pin
(like the PIC output port pins or PC parallel output pins) can take it
easily to ground if that pin is programmed low level.
Hi Tim. Here is my two cents ;-)
> And another (I know I'll owe ya guys big for all these questions) question, if
> I use pullups, how is it possible to bring a line LOW if it's being pulled up
> to Vdd?
Pullups usually used in bus shared environments, for instance you need
to read some
wire and to drive it in some other time. For this purpose you clear some
bit in PIC
TRIS (bcf TRISx,your_pin - don't forget about current data bank ;-) and
set the same
bit in PORT latch(bsf PORTx,your_pin) After these manipulations ;-) you
pin. If TRIS bit is low you'll drive bus wire low. From the other hand
if TRIS is high
you're able to read bus wire(read directly from PORTx,your_pin). This
trick is used
for instance in I2C bus and many others.
In message <aol.com>, Tim Hamel < 9de4f92f.243a9ffcAOL.COM> IMDNICE12
I would suggest you buy a book about PC interfacing, I've just bought
one which includes various ADC routines (although not the MAX187) - you
can also download the source code from their web site.
'PC Interfacing using Centronics, RS232 and Game Ports' by Pei An
ISBN 0 2405 1448 3
However, I have recently seen a project somewhere for using a MAX187 via
a parallel port - but I can't remember where :-(.
| Nigel Goodwin | Internet : lpilsley.demon.co.uk | nigelg
| Lower Pilsley | Web Page : http://www.lpilsley.demon.co.uk |
| Chesterfield | Official site for Shin Ki Ju Jitsu |
| England | |
At 10:03 AM 4/6/99 -0400, you wrote:
>Hi Tim. Here is my two cents ;-)
>> And another (I know I'll owe ya guys big for all these questions)
>> I use pullups, how is it possible to bring a line LOW if it's being
>> to Vdd?
For what it's worth....
Think of electricity/current..as water........
If you have a bucket with a valve filling it that is 1/4 open...it will
slowly fill up......
If the bucket has a drain valve and it is full open....it will empty the
bucket..even though it is being filled...but only 1/4 flow....]
the full open drain will cause the bucket to empty...
close the drain valve and the bucket will fill!!!!
Thanks for the code! VB is a bit easier for me to understand than C.
About the Reply To thing, it's an AOL thing, I can't control it, UNLESS, I
were to use and external mail program, but AOL is too security conscious to
allow that =( I do apologize for this.
In a message dated 99-04-07 10:03:44 EDT, you write:
> Tim, I noticed that you had your "Reply To" field set to your personal
> email address. Please avoid this as the purpose of this group is to share
> ideas. I'm re-posting my reply to the public list.
|Tim, about the pullups... think of it just as an elastic rubber band
|pulling something up, you can easily pull it down to ground with your
|hand because the "pull up" is elastic and weak, right? The same with
|the pull up resistors, they just pull Vdd level to that pin, but another
|low level signal stronger than what the resistor is doing would pull
|that pin voltage to ground... The pull up voltage offered by pull up
|resistors (5k or more Ohms) is somehow weak and any circuit output pin
|(like the PIC output port pins or PC parallel output pins) can take it
|easily to ground if that pin is programmed low level.
Nice analogy, one I'd (for whatever reason) not heard before. Another
 The keys on a typical keyboard have springs in them which keep the
keys raised when you are not pushing them. If you activly push down
on a key, however, it's easy to overcome the spring and force it to
make contact. If the springs were absent, the keys would droop down
and could intermittently make contact even when you weren't pushing
them. You could be sure that if you pushed down on a key it would
register as pressed, and if you manually held a key up it would reg-
ister as released, but if you weren't touching the key it could act
 In many busses [mass-transit vehicles], the bus drivers attempt to
save time by not stopping at locations where no passengers wish to
board or disembark. To allow passengers on the bus to indicate that
they wish to stop at the next location, there is a pull-cord on
either side of the bus just below the luggage rack. Any passenger
who wishes to signal the driver to stop may pull the cord, overcom-
ing spring tension and causing a bell to ring.
The electronic equivalent to this arrangement is a "wired-or" bus:
any device which is capable of pulling down the bus can cause it
to be pulled low. This type of arrangement is used very frequently
in microprocessor systems to allow any of several devices to signal
to the CPU that they need attention. Once the signal is received,
the CPU will still have to determine who wanted attention, but such
polling only needs to be done when at least one device needs atten-
tion. Most of the time, when nobody needs attention, the CPU can
simply execute the main code without having to poll anything.
|IMDNICE12@aol.com [SMTP:aol.com] wrote: IMDNICE12
|I REALLY appreciate your analogy, it was even more helpful than the rubber
|band (I'm not slamming his analogy). I realize now, the exact purpose. The
|resistor limits the voltage to a point where it's at a logic high, but it can
|still be pulled low, thus leaving the input at a known state....I GOT IT =)
|I hope you forgive my lack of knowledge here, but where do open-collector
|inputs come into play?
|Thanks again for the oh-so-easy to understand analogy(ies)
The term "open-collector input" is rather a misnomer; the term is used to
describe a digital output. In the case of PIC port pin RA4, what's sign-
ificant is that the output driver on the pin is open-collector; this does
have some effects on use of the pin as an input, however.
An open-collector (or open-drain) output is one which can pull a pin low
or leave it floating, but which cannot pull the pin high. For such an
output to be useful, something else (such as a pull-up resistor) must pull
the pin high. Such outputs are generally useful in three cases:
-1- There is a signal wire which may be pulled low by more than one
device. A device which isn't pulling the line low should not pre-
vent other devices from doing so.
-2- An output which switches high and low will be limitted to switching
voltages between the supply rails; a normal PIC output can't switch
anything over about 5.5 volts (assuming a 5.5v supply). An open-
collector output, combined with a pull-up to a higher voltage, can
switch a higher voltage (within the breakdown limits of the device--
about 10-12 volts for the PIC RA4; more on some other devices).
-3- When driving certain kinds of devices like LED's or relays, what's
important is not the voltage on the output pin but the amount of
current it can sink. If you have a series string of 8 2.0v LED's
along with a suitable current-dropping resistor, running off a 24v
supply, the LED's are only going to glow if current is being pulled
through them. If such a string were driven from port pin RA4, it
would be good to provide a zener or similar device to protect ag-
ainst the port pn exceeding 10 volts or so, but what's significant
is not so much the voltage on RA4 as the current flowing into it.
The GOOD news is that AOL users know how TO set their reply-to address
to point to themselves, folks - they just cannot choose otherwise.
That's a good by-product of this <G>
(Also, actually, SPAMmers do use other mail programs - to send through
non-AOL mail servers, and I guess to send SPAM inside AOL, from what I
hear. Just honest regular users aren't allowed to do this <G>)
Good to see some newer/less experienced users getting help here, I
like it <G>
Tim Hamel wrote:
> About the Reply To thing, it's an AOL thing, I can't control it, UNLESS, I
> were to use and external mail program, but AOL is too security conscious to
> allow that =( I do apologize for this.
> Tim H.
|In a message dated 4/30/99 9:19:19 AM Pacific Daylight Time,
NWLINK.COM writes: mwillis
> The GOOD news is that AOL users know how TO set their reply-to address
> to point to themselves, folks - they just cannot choose otherwise.
> That's a good by-product of this <G>
> (Also, actually, SPAMmers do use other mail programs - to send through
> non-AOL mail servers, and I guess to send SPAM inside AOL, from what I
> hear. Just honest regular users aren't allowed to do this <G>)
> Good to see some newer/less experienced users getting help here, I
> like it <G>
And the BAD thing about AOL is the spam. I've sort of put together an
independent study on SPAM. I figured it out! When you go into a chat room,
there's usually one or two "Name Retrievers" who collect your name, and stick
on the list, then they leave. How I figured it out was...I haven't been into
a chat room for a LONG time, and my spam has reduced dramatically. And
regarding the Reply To part. If I could change it, believe me I would! I do
apologize for the hassle it causes =( I also VERY much enjoy this list. It
has kick-started me from just knowing that I had a 16C84 in my hand, to being
able to implement (in something, I don't know yet!). I can't express enough
appreciation to you all.
Thank you again,
More... (looser matching)
- Last day of these posts
- In 1999
, 2000 only
- New search...