Searching \ for '[PIC] Using PIC to sample 90 wires' 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/microchip/devices.htm?key=pic
Search entire site for: 'Using PIC to sample 90 wires'.

Exact match. Not showing close matches.
PICList Thread
'[PIC] Using PIC to sample 90 wires'
2010\05\21@074155 by Andrew Wood

flavicon
face
Hi

Im new to PIC and electronics in general, having come from a software
background. Im looking to design something which can sample 90 wires for
the presence or absence of a DC voltage (50v, but can be taken down to
say 5v with a voltage divider if needed). It then needs to store a bit
in memory for each wire indicating if the wire was live or not and then
interface to a computer over USB so the computer can read the bits.

Having done some research it seems to me that a PIC based system is
probably the best way to go, but I was wondering whats the best way to
interface the 90 wires to the PIC? All the example projects I can find
so far interface to a much smaller number of wires.

Thanks
Andrew

2010\05\21@080539 by Wouter van Ooijen

face picon face
> Having done some research it seems to me that a PIC based system is
> probably the best way to go, but I was wondering whats the best way to
> interface the 90 wires to the PIC? All the example projects I can find
> so far interface to a much smaller number of wires.

Any micrcontroller with an (internal or external) USB interface will do.
For a one-off use an usb-to-serial converter, max232, and a PIC with a UART.

For reading N inputs: use a chain of shift registers (like 74HC165), or
I/O expanders (like MCP23016 or MPC23S016). Or (analog or digital)
multiplexers.

If isolation is a requirement use optocouplers. I think the secondary
side of the opto's could be arranged as a matrix, so with maybe an extra
diode per opto you could read 100 signals with 20 I/O pins.

--

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu

2010\05\21@082029 by Michael Watterson

face picon face
Andrew Wood wrote:
> Hi
>
> Im new to PIC and electronics in general, having come from a software
> background. Im looking to design something which can sample 90 wires for
> the presence or absence of a DC voltage (50v, but can be taken down to
> say 5v with a voltage divider if needed). It then needs to store a bit
> in memory for each wire indicating if the wire was live or not and then
> interface to a computer over USB so the computer can read the bits.
>
> Having done some research it seems to me that a PIC based system is
> probably the best way to go, but I was wondering whats the best way to
> interface the 90 wires to the PIC? All the example projects I can find
> so far interface to a much smaller number of wires.
>
> Thanks
> Andrew
>  
1) use external switch IC or buffer ICs and 4 address wires. 12 x 8 bit
ports is 96. You can use a 28pin skinny 18F2550 with USB
2) Use 12 x external  I2C port expander with 18F2550
3) use a handful of pics talking via I2C to a master PIC with USB. The
master can also monitor maybe 20 wires. ie program a 40 pin PIC or 28
pin PIC as a 32 pin or 16 pin (approx) DIY I2C expander
4) look at 18Fxxkxx and 18Fxxjxx PIC in 60 to 100 pin packages and
connect maybe 2 to monitor the 90 pins. they comunicate via I2C and one
is master with a Slave I2C. There may even be a PIC than can read 90
inputs with 100 or more pins.

you will want a divider to 5V or 3V depending on PIC.

2010\05\21@083119 by Spehro Pefhany

picon face
At 07:41 AM 5/21/2010, you wrote:
>Hi
>
>Im new to PIC and electronics in general, having come from a software
>background. Im looking to design something which can sample 90 wires for
>the presence or absence of a DC voltage (50v, but can be taken down to
>say 5v with a voltage divider if needed). It then needs to store a bit
>in memory for each wire indicating if the wire was live or not and then
>interface to a computer over USB so the computer can read the bits.
>
>Having done some research it seems to me that a PIC based system is
>probably the best way to go, but I was wondering whats the best way to
>interface the 90 wires to the PIC? All the example projects I can find
>so far interface to a much smaller number of wires.
>
>Thanks
>Andrew

The real circuit depends a bit on what the source impedances are, what
the voltage thresholds should be, leakages etc. But here is a concept
that could be usable..

- one voltage divider per input (180 resistors= 12 components).
- 12 8-bit analog multiplexers (12 components).. there are 16 input
  (and more) muxes available.
- analog comparator and reference if there isn't one in micro
- micro with ~16 pins  (or fewer, depending on the MUX chosen) free to
  control mux, plus USB interface

As you can see, this could have a pretty low parts count.

In reality, you might want to use two micros with (galvanic) isolation
between them, since bad things are likely to happen if 50V at high
current mixes with a grounded USB interface. Eg. send channel number request
across the isolation barrier, wait a bit, read the resulting digital data.

You'd also want to ensure that "50V" inputs can never exceed the mux supply
voltage rails, or include dual Schottky diodes on each input for an unprotected
mux (protected ones are probably 10-20dB more expensive).

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
spam_OUTspeffTakeThisOuTspaminterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com



2010\05\21@083132 by Olin Lathrop
face picon face
Andrew Wood wrote:
> Im looking to design something which can sample 90 wires
> for the presence or absence of a DC voltage (50v, but can be taken
> down to say 5v with a voltage divider if needed).

Since your signals are slow, this can be done by multiplexing.  Brute force
would be a dozen byte wide tri-state line drivers.  You enable one at a time
to read its 8 lines.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\05\21@084828 by Tom

picon face
 ----- Original Message -----
 From: Andrew Wood
 To: .....piclistKILLspamspam@spam@mit.edu
 Sent: Friday, May 21, 2010 7:41 AM
 Subject: [PIC] Using PIC to sample 90 wires


 Hi

 Im new to PIC and electronics in general, having come from a software
 background. Im looking to design something which can sample 90 wires for
 the presence or absence of a DC voltage (50v, but can be taken down to
 say 5v with a voltage divider if needed). It then needs to store a bit
 in memory for each wire indicating if the wire was live or not and then
 interface to a computer over USB so the computer can read the bits.

 Having done some research it seems to me that a PIC based system is
 probably the best way to go, but I was wondering whats the best way to
 interface the 90 wires to the PIC? All the example projects I can find
 so far interface to a much smaller number of wires.

 Thanks
 Andrew
 --

2010\05\21@094946 by Russell McMahon

face picon face
> Im new to PIC and electronics in general, having come from a software
> background. Im looking to design something which can sample 90 wires for
> the presence or absence of a DC voltage (50v, but can be taken down to
> say 5v with a voltage divider if needed). It then needs to store a bit
> in memory for each wire indicating if the wire was live or not and then
> interface to a computer over USB so the computer can read the bits.

What  they said.
Plus:

ICs to sample 100 lines are not too costly, but you MAY be able to use
an addressed  XY or even XYZ matrix to use many less active devices,
or to use many diodes and fewer ICs.

Using XY you need 10 x 10, or in multiples of 4 say = 8x12 = 96.

If you can work an XYZ addressing scheme you can get say 5x5x5 = 125
or 4x4x8 = 128 .

In an XY system an X line drives a row (say) of inputs with matrix
points being held down (or up) by input voltages. The y colums read
the result. This may end up with more R's and / o r diodes than are
worthwhile.

_____________

Using a number of serial shft registers makes it all very easy.

The CD4021B parallel to serial  is under 40 cents at Digikey in 25's.
       http://www.fairchildsemi.com/ds/CD/CD4021BC.pdf

Each  allows 8 inputs and they can be chained in series indefinitely.

12 x 8 = 96 inputs.

There are various ways to get 50V to logic level input - but it should
not take more than 2 x resistors and 1 x diode per input and just
maybe a small capacitor too, but  could take less. They can run at up
to 15 V supply and it MAY be worth running them at near that level and
translating the very few control and data signals to PIC level.

Depending on the tolerance and noise spikes on your 50V signals you
MAY be able to use just 2 x resistors.

What's the application?
Sounds like telephone line sampling ? :-).
Dim and not wholly pleasant memories from long ago stir :-)


Russell
.

2010\05\21@100724 by ivp

face picon face
> interface to a computer over USB so the computer can read the bits

I reckon there's your tricky stuff, especially if you're new to PICs

2010\05\21@102102 by ivp

face picon face
> I was wondering whats the best way to interface the 90 wires to
> the PIC?

You might consider a couple of 64-pin PICs. Some like the 16F1946
are cheap, have 50 I/O, and one could pass its results to the other. A
Vinculum serial-to-USB IC would simplify the comms to the PC

http://ww1.microchip.com/downloads/en/DeviceDoc/41414A.pdf

http://www.vinculum.com/


Joe

2010\05\21@105945 by Alan B Pearce

face picon face
>> interface to a computer over USB so the computer can read the bits
>
> I reckon there's your tricky stuff, especially if you're new to PICs

yes and no, if one used the Microchip USB library it is pretty easy to get a
CDC system going, and then he could arrange his code to send a block of
messages as though over a serial link, with one bit per line being sensed.

2010\05\21@111851 by Mike Hagen

picon face
Just some thoughts to stir the pot.

Are you making only one of these?
Are going to sell them?
PCB or hand wired?

What if there was, say 13V on the input, what would you want to do then?

Makes lot of difference on your cost vs just get it done decisions.

I have used 74HC595 to select channels. Serial in, parallel out shift
register.  Cheap.

Siliconix (Vishay now) makes a DG4088 Ch. analog multiplexer with a 3
bit binary input.  You could actually measure the voltage.

Maybe do a 10:1 attenuator with resistors on each input.

A 3 cent Zener if you are just detecting some voltage?

Pics are cheap, a 100 inputs would not be out of the question?

Lots of fun things to think of here!




On 5/21/2010 6:49 AM, Russell McMahon wrote:
{Quote hidden}

2010\05\21@114514 by Mike Hagen

picon face
"DG408" Typo

On 5/21/2010 8:18 AM, Mike Hagen wrote:
{Quote hidden}

2010\05\21@115028 by Michael Watterson

face picon face
ivp wrote:
>> interface to a computer over USB so the computer can read the bits
>>    
>
> I reckon there's your tricky stuff, especially if you're new to PICs
>  
15mins using JAL, serial profile and 18F4550. Most of that was faffing
with Windows.

2010\05\21@154034 by YES NOPE9

flavicon
face

On May 21, 2010, at 5:41 AM, Andrew Wood wrote:
{Quote hidden}

Consider isolating the entire measuring circuit.
You can construct or buy a VFC ( voltage to frequency converter ).
     A VFC can be made from a PIC or logic gates or op amps )
Have the VFC look at the 90 voltages using addressable analog  
multiplexers.
The address to the multiplexers can come from logic counters or shift  
registers
driven by a PIC.

The isolated output can be "breaK" condition ( indicating the zeroeth  
time slot ) followed by 90 time slots.
Each time slot would feature a frequency indicating the state of one  
of the wires.

I have some schematics if you are interested.

Gus

2010\05\22@035541 by Russell McMahon

face picon face
> ICs to sample 100 lines are not too costly, but you MAY be able to use
> an addressed  XY or even XYZ matrix to use many less active devices,
> or to use many diodes and fewer ICs.
>
> Using XY you need 10 x 10, or in multiples of 4 say = 8x12 = 96.
>
> If you can work an XYZ addressing scheme you can get say 5x5x5 = 125
> or 4x4x8 = 128 .
>
> In an XY system an X line drives a row (say) of inputs with matrix
> points being held down (or up) by input voltages. The y colums read
> the result. This may end up with more R's and / o r diodes than are
> worthwhile.

Some quick doodling suggests that you MAY be able to produce a
multiplexed array with 3 x diode and 1 x resistor per sample point,
plus matrix addressing logic. Probably better going with an IC
solution, but this could be workable at small size in production
volumes. For a one-off or small run then ICs much better.

I and several others mentioned serial shift registers and 4051 style
transmission gates were mentioned.

Using 8:1 addressable selectors (eg CD4051) you can address an array
of points randomly with a parallel address. ie whereas with serial
shift register schemes you have to clock the whole array (or an Nth
part in some arrangements) of data in to read a single point. With a
fully addressable array of switches you can concentrate on a selected
few inputs if desired.

Using CD4051s.
12 4051 x 8 bit = 96 inputs.
Address 12 4051's requires 4 bits of address (up to 16 can be addressed).

Using parallel input to PIC you need 8 data lines and 4 address lines
= 12 pins total.
OR you could serial clock the data in g\from the 405a array with an eg
CD3\4021 to get a hybrid and fewer PIC  pins.

Or ... - many possible answers.

If you can stand having to clock the array 96 times per array read
it's hard to beat the CD4021's on price.

4021 x 8 bit so 12 needed.
Digikey $US0.40 x 12 = $4.80.
3 ? PIC pins to drive.

The really really really enthused can do this with ONE PIC pin using
it for clocking, reset, and data read - with a little 'glue' . This
level of price saving  not usually required.


Russell McMahon

2010\05\22@052649 by Harry H. Arends

flavicon
face
You might have a look here:
http://www.opendcc.de/s88/s88_n/s88-n_e.html
http://home.wanadoo.nl/aheer/s88/s88.gif
http://www.nlms.info/images/schematics/S88.bmp
http://www.tams-online.de/download/GB/S-88-1_GB.pdf

The modelrailroad people use this modules in several version to detect
a state on the track.
They then read it serial into a commandstation(PIC based) to ackt on
it.

Harry
{Quote hidden}

read
> > the result. This may end up with more R's and / o r diodes than
are
{Quote hidden}

eg
{Quote hidden}

>

2010\05\23@035339 by Andrew Wood

flavicon
face
Thanks for the suggestions. Lots to think about! I might perhaps go for
a PIC with a large number of inputs to make the circuit as simple as
possible until I get more used to the PIC architecture & programming.

Andrew

2010\05\23@043630 by Russell McMahon

face picon face
> Thanks for the suggestions. Lots to think about! I might perhaps go for
> a PIC with a large number of inputs to make the circuit as simple as
> possible until I get more used to the PIC architecture & programming.

At the risk of appearing to be just promoting a suggestion that I (and
several others) made, then, if speed is not an issue THE simplest
circuit is probably 12 x parallel in, serial out shift register IC's.
(Speed is 90 SRclock cycles plus a small setup overhead.)(SRclock is
shift register clock. Probably can be as fast as your code will go.

Each register IC has 4 relevant control and data pins.
   Serial in
   Serial Out
   Clock
   Data load strobe.
Connect serial out on ONE IC to a PIC pin.
Connect all data strobe pins together to 1 PIC pin.
Connect all clock pins together to 1 PIC PIN.

PIC has only *THREE* pins to control the whole array.
Then.

Connect data out of each IC to data in of next IC and on last data out
connects to PIC data in pin as above.

Then

Strobe data line to load all data.
Clock once & read a data bit.
Repeat prior line 90 times (or up to 96)
Done.

Very very very simple.
Minimal code.
Minimal pins needed.
Any PIC could handle this.

Each data input pin needs to be 'conditioned to suit your application.
If signal is +50 / 0 then two resistors per input may suffice.

Noise, other polarities etc can complicate this, but probably not by much.

Try it with 1 x CD4021 - very easy and very cheap to set up.
Then go from there.

There are some things to know about connecting in series - but mainly
if at speed, and these can be discussed if you use that method.

I've used this with just a few CD4021's in series to extend I/O
capability on an ST processor. There is a matching output IC (serial
in / parallel out, to go the other way. Works well.


            Russell McMahon

2010\05\23@051931 by ivp

face picon face
> several others) made, then, if speed is not an issue THE simplest
> circuit is probably 12 x parallel in, serial out shift register IC's

How is that simpler than 2 x 16F194x ($2.76 or free as samples) ?
The s/w would simply be copying the ports. I know what I'd rather
design a PCB for

2010\05\23@053143 by Spehro Pefhany

picon face
At 05:19 AM 5/23/2010, you wrote:
> > several others) made, then, if speed is not an issue THE simplest
> > circuit is probably 12 x parallel in, serial out shift register IC's
>
>How is that simpler than 2 x 16F194x ($2.76 or free as samples) ?

Simpler because he can get the parts? ;-)

>The s/w would simply be copying the ports. I know what I'd rather
>design a PCB for.


Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
EraseMEspeffspam_OUTspamTakeThisOuTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com



2010\05\23@061240 by Oli Glaser

flavicon
face
>At the risk of appearing to be just promoting a suggestion that I (and
>several others) made, then, if speed is not an issue THE simplest
>circuit is probably 12 x parallel in, serial out shift register IC's.
>(Speed is 90 SRclock cycles plus a small setup overhead.)(SRclock is
>shift register clock. Probably can be as fast as your code will go.

While I agree that the shift register solution is obviously a good way of
doing this, my concern is that it adds a lot of complications for a beginner
as far as desgining/understanding/coding the circuit/firmware and
implementing it on a PCB. It's probably another case of what seems easy when
you already know it - the fact that this will be the OPs first project with
a PIC AND electronics in general is my main reason behind mentioning all
this. I would say that just dealing with one or two PICs on their own, and
reading the pins directly would be quite a challenge to start with anyway. I
know it seems like only a smallish leap from that to using shift registers
(the logic is nice and simple so I don't think that would be a problem to
understand) but the extra code and PCB complications makes me hesitate to
recommend it (at least as a first project/try) - plus there is simply just
more to go wrong. If it is possible to find a PIC with USB and the 90 pins
required (some PIC18F? - I wouldn't like to recommend PIC32), I would
suggest that, or the two PIC option (also has the benefit of being easily
isolated as someone mentioned) Anyway, just my two cents - whatever is
chosen, good luck to Charles.


2010\05\23@065106 by ivp

face picon face
>>How is that simpler than 2 x 16F194x ($2.76 or free as samples) ?
>
> Simpler because he can get the parts? ;-)

Dear Microchip, please send me two 16F1946 samples ......   8-)

2010\05\23@065110 by ivp

face picon face
> If it is possible to find a PIC with USB and the 90 pins required (some
> PIC18F?

I think the most I/O any PIC has is 85. 33F, 100-pin TQFP (0.5mm ?)

2010\05\23@065745 by Dario Greggio

face picon face
ivp ha scritto:
>> If it is possible to find a PIC with USB and the 90 pins required (some
>> PIC18F?
>
> I think the most I/O any PIC has is 85. 33F, 100-pin TQFP (0.5mm ?)


and no 18F part with USB and more than 44 pins... IIRC
(may be wrong though, I never needed that)

2010\05\23@071156 by Spehro Pefhany

picon face
At 06:25 AM 5/23/2010, you wrote:
> >>How is that simpler than 2 x 16F194x ($2.76 or free as samples) ?
> >
> > Simpler because he can get the parts? ;-)
>
>Dear Microchip, please send me two 16F1946 samples ......   8-)

Sometime in July, at best, it looks like.

>Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
speffspamspam_OUTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com



2010\05\23@075603 by ivp

face picon face
>>Dear Microchip, please send me two 16F1946 samples ......   8-)
>
> Sometime in July, at best, it looks like.

Yes, sadly it looks like 35 days until available for sampling or purchase

2010\05\23@075638 by Michael Watterson

face picon face
Dario Greggio wrote:
> ivp ha scritto:
>  
>>> If it is possible to find a PIC with USB and the 90 pins required (some
>>> PIC18F?
>>>      
>> I think the most I/O any PIC has is 85. 33F, 100-pin TQFP (0.5mm ?)
>>    
>
>
> and no 18F part with USB and more than 44 pins... IIRC
> (may be wrong though, I never needed that)
>  
64 and 80 pin 18F67Jxx and 18F87Jxx do USB

I have the 18F67J50 64pin USB

But I think either the 12 shift registers, 12 x 8 way switches and 12
inputs or 12 x Octal buffers in parallel with 8 inputs and using the
18F2550 if using external address decoder or shift registers, or 18F4550
if using the switches or buffers (then no address decoder needed), 12
address on buffer or 3 address on 8 way switch.


2010\05\23@085512 by Russell McMahon

face picon face
>> several others) made, then, if speed is not an issue THE simplest
>> circuit is probably 12 x parallel in, serial out shift register IC's

> How is that simpler than 2 x 16F194x ($2.76 or free as samples) ?
> The s/w would simply be copying the ports. I know what I'd rather
> design a PCB for

I can prob ... er possibly convince to otherwise.

Let's assume we can use 2 x resistors for input with nominal +50V / 0V
input wrt PIC ground and let's assume a nominal 100R impedance on that
line. Assume input is on 0.1" single in line headers at multiples of
whatever length suits - say 12 x 8 pin headers, but whatever suits.

1. Cost of ICs is about the same:
Ignoring the ""free" trap Digikey says 1 off price in stock is
$US3.06/PIC = $7 plus shipping.
CD4021 in stock is $US0.47/1Digiket, or with the here VERY magic word
"DIP" associated is $US0.50/1. $US0.37/25 - but using the 1 price it's
$US6 for 12 - and you still need a PIC - so cost of ICs is ABOUT the
same, but with more flexibility in PIC choice with the 4021's as you
can use ANY PIC with this scheme - even 12F series.

2. Now, the PICs have their own magic word. It's TQFP. Some may find
that so commonplace as to be unremarkable but for a beginner it may
rank close to banking and paging. Maybe not quite, but ... .DIP has
certain appeal.

3. PCB layout
3a for TQFP PICs has lots of port lines being brought out from central
point to resistor arrays.Not hard but you have all the 50V inputs
coming from the headers so the 'nice & easy' approach is along a
linear edge - either a straight  line (90/10 = 9 inches, or around a
PCB outer edge. Say 4"x3" PCB ~= 14" edge is very ample. More complex
staged inputs in rows is not hard but beginner starts to get
justifiably nervous with 50V/logic mix etc. Single sided with links
would work.

3b Now, look at the 4021 layout ! :-).
Layout 1 x 16 pin IC and you have a template for ALL of them - the end
one to the PIC is very slightly different.
These can form "islands" on a single PCB with 50V leads  coming in on
headers 8 at a time  without 90-8 = 82 other lines snaking past on
their way to the PICs. These COULD be on a PCB edge OR on an X x Y
matrix or even on daughter boards - each piking up Vdd, gnd, SIN,
SOUT, Clock, Latch. Equip N of these and short SIN-SOUT on PCB  when
not equipped.

Inputs are on pins 1,4,5,6,7,13,14,15 on a 16 pin IC. With 2xR per
input - one to 50V and one to common ground, even a beginner could
have a fair chance of doing the simple single sided layout for ONE IC
and replicating it 12 times (or 50, or 3) *AND* Joe would do it for
them free if they start out nicely enough. Getting Joe to do a 90
input 2 x TQFP PIC layour for free MAY be pushing thingsgthings too
far - even with Joe's generosity :-).

4. Blow up an input line. It happens. Worst case you get magic smoke
all round in both  systems. BUT if you destroy one pin (as happens)
you can drop in a new socketed CD4021 or stare at a 64 pin TQFP with
some apprehension, while remembering what it took to put it in place.
(Or maybe it's a QFN :-).)

You THINK that input 33 is dead due to a dead 4021. Plug in a new one
and you'll quickly see. But, dead TQFP/QFN pin? Quick trial swap? -
:-(.

5. The dread software.

Hyper PICS:  Getting 12 bytes into 12 locations is easy enough, but a
lot easier once you have done it a lot. It may or may not be  a linear
mapping depending on language, port addressing etc. Not rocket science
but not 100% trivial for a beginner.

3 pin serial. I suggested trying a single CD4021 as a trial. ANY PIC.
ANY. I gave the complete algorithm / pseudo code. I didn't say what to
do with each input bit. You can byte pack them or store them as 1 bit
per memory location etc. Using an HLL it's about the same either way.
Using assembler you can start with 8 pins and 8 bytes to try it out.
You are going to handle this sort of complexity in storing and/or
retrieving somewhere along the line.

Once you have the basic code going it is very very easy to extend it
to N bits. You don't care which IC a bit is on. You do have to map IC
+ I/O pin to bits, but that is not 100% trivial on the hyper-PIC
system either. Easy but with enough teeth to trap.

Again.
   Initialise.
   90 x (Clock , read bit, save bit)
   Finished
It really is that easy.

4. So, for a beginner this is a very easy and forgiving system to
implement and to code.
Construction is modular in 8 bit chunks.
Once you have 16 bits working (so you have staged at least 2 x 8 bits
successfully) then you can implement N x 8 bits just as easily.
16 pin DIP packages and ANY PIC allows ease of construction and coding
and troubleshooting.

I know what I'd rather design a PCB for :-).
Or, write code!

5. Extra points.
Assume system is a telephone line system with inputs. 0 / -50V wrt PIC ground.

You could eg

- Run  electronics on -50V as ground so ligic looks as before and then
deal with the output at -50V as it comes. This MAY be a sensible
solution.

-  Run at ground = -5V (or -3V or ...) and true ground = Vdd. Inputs
are negative when at -50V and at Vdd when at true-ground. Annoying
(clamp diodes or similar etc) but doable.

- Run PIC at 0/5V or 0/3v and translate -50 / 0 signals to Vdd / 0

The latter is the ideal from the PIC management point of view but
leaves the signal translation task.

With a hyper-PIC solution you have 90 x level shifting inputs. Not
hard, but small whiffs of rocket science may be detected.

With a seial shift register system you can, if desired, run the whole
shift register system as before, referenced to -50V as logic ground,
and then level translate ONLY Serial In, clock and data latch signals.

6  For extra extra points you can opto couple these.

7 Don't try this at home (until more experienced) - For Oak leaves
with diamonds you can use a SINGLE line to do clocking, data strobe
and serial in. Don't try this at home at first, but it can be done.
eg clock usually high. Force clock low for N periods to reset. In
normal use clock low then float high - if SIN is high line will go
high asap. If SIN is low line will stay low until  forced high by
changing clock drive from float to high. Then repeat. This and similar
also really works. Very nasty, but workable. Having a single pair to
control it or a radio channel (beware noise)  may make it attractive -
or did long ago when adding a simple mpu was less of an option.

Joe - convinced ? :-)

                   Russell

2010\05\23@093903 by Russell McMahon

face picon face
> >>How is that simpler than 2 x 16F194x ($2.76 or free as samples) ?

Presumably you'd transfer data between the 2 PICs using synchronous
serial ? :-).



             R

2010\05\23@125803 by Dario Greggio

face picon face
Michael Watterson ha scritto:

>> and no 18F part with USB and more than 44 pins... IIRC
>> (may be wrong though, I never needed that)
>>  
> 64 and 80 pin 18F67Jxx and 18F87Jxx do USB


I see, thank you Michael :)

--

Ciao, Dario
--
Cyberdyne

2010\05\23@162300 by Youda He

flavicon
face
A simple solution is to use USB Bit Whacker,
www.sparkfun.com/commerce/product_info.php?products_id=762
there is also a 32 bit version available. This one plus IO port
expander, may just do it, and you don;t even need to program PIC.

You can send command through COM port using simple command to read write ports.

-- Youda

On Sun, May 23, 2010 at 9:58 AM, Dario Greggio <@spam@adpm.toKILLspamspaminwind.it> wrote:
{Quote hidden}

> -

2010\05\23@172833 by ivp

face picon face
> Getting Joe to do a 90 input 2 x TQFP PIC layour for free MAY
> be pushing thingsgthings too far - even with Joe's generosity :-)

Well, I do like a challenge and strive to be liked ....... ;-))

Have to say I'm wondering about hand-working these MCP1640
DFN-8 packages though. MSOP8 is bad enough


2010\05\23@172833 by ivp

face picon face

>> >>How is that simpler than 2 x 16F194x ($2.76 or free as samples) ?
>
> Presumably you'd transfer data between the 2 PICs using synchronous
> serial ? :-).

Oh ha ha, funny guts ;-)

But I would agree about swapping out a 64-pin TQFP. A socketed QFN
would be a better choice

2010\05\23@175352 by Olin Lathrop

face picon face
ivp wrote:
> Have to say I'm wondering about hand-working these MCP1640
> DFN-8 packages though. MSOP8 is bad enough

I've had to do a few small packages lately.  After some experimentation I
found a way that seems to work OK for doing these by hand.  First you put
extra solder on the pads on the bare board.  Make sure there aren't solder
bridges.  This can usually be done just by dragging the soldering iron over
each pad.  If that doesn't work you used too much solder, so clean some off
with a solder wick and try again.

Once you've got solder on all the pads, smear the whole area with paste
flux.  Make sure this is non-conductive, like rosin, since it's not going to
get cleaned off under the package.  Now place the package in the correct
position on the pads.  The paste will stick it loosely to the board.  Align
it correct.  A magnifying light and tweasers help a lot.

Now you've got the package sitting on its pads held there by a layer of flux
paste.  Flow the solder with hot air at 650 degF or so long enough for the
flux to smoke for a few seconds.  Sometimes you can see the solder melt, but
usually not.  If the flux stops smoking you're definitely done, although you
don't need to hold the hot air on it that long.

I've done some QFNs that way, and a few TQPF 64 pin PICs.  For me the
hardest part is lining up the chip correctly before applying heat.  A
magnifier helps, but the hand movements need to be really tiny.  Once it's
properly lined up, the actual soldering is fairly easy.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\05\23@183659 by ivp

face picon face
>> Have to say I'm wondering about hand-working these MCP1640
>> DFN-8 packages though. MSOP8 is bad enough
>
> I've had to do a few small packages lately.  After some experimentation
> I found a way that seems to work OK for doing these by hand

Thanks. With only a couple of samples I haven't much lee-way for
trial-and-error

2010\05\23@183728 by Oli Glaser

flavicon
face
> Have to say I'm wondering about hand-working these MCP1640
> DFN-8 packages though. MSOP8 is bad enough

Same as Olin, I've been doing some small packages and some TQFP PIC32s
recently too (using drag soldering technique mostly, but also hot air,
especially for smaller parts, SOT5-6 etc) and the hardest part I find is to
align the chip properly before applying heat, the liquid flux certainly
helps to keep the chip in place, it's a lot harder without it (small dab of
glue apparantly helps with tiny components like 1206 caps/resistors, though
I have not tried this myself). I found that you don't have to be *so* exact
with alignment with the hot air, as the surface tension of the solder
usually pulls the chip into place when it melts, like with reflow soldering
(especially with larger packages). Solder paste can be used also instead of
applying regular solder to the pads, this also has the nice effect of
holding the component in place until heat is applied. For the drag
soldering, I really like the Pace (angled) miniwave tip (fine pitch
version -
http://uk.farnell.com/pace/1121-0564-p5/tip-fine-pitch-miniwave-pk5/dp/3120740) -
I didn't get the Pace iron, just ordered 5 replacement microwave tips and
used them in my standard (non temperature sensing) iron - had no problems
yet, although I really should get another half decent iron - last one died
but as yet I seem to be doing fine without it. Plenty of tutorials out there
on soldering/reworking the SMD stuff, I think the main thing is using plenty
of flux, plus a bit of practice. My next project is to rig up a small reflow
oven..


2010\05\23@184418 by sergio masci

flavicon
face


On Sun, 23 May 2010, Russell McMahon wrote:

{Quote hidden}

I have to agree with Russel, this would definately be the simplest
solution and by far the quickest to implement software wise.

Think about it, the PIC is controlling the rate at which data is being
clocked through the "wide" shift register. You can make this go as slow as
you need to while you are debugging your system (software AND hardware).
You can even run it through a simulator or debugger (and single step
without breaking anything). Now can you just imagine how hard it's going
to be to debug two or more PICs running in parallel. Sure it would be fun
to do, but for a first PIC project - no not really.

And as Russell points out, you can start small using just one shift
register and when you get that working for 8 lines, you can progress by
cascading more shift registers between the first (known working one) and
the PIC. All you need to do in the software is change a constant that is
used to define how many inputs you are reading via the shift register. All
this would be so trivial.

Regards
Sergio Masci

2010\05\23@193157 by Oli Glaser

flavicon
face

----- Original Message -----
From: "sergio masci" <KILLspamsmplxKILLspamspamallotrope.net>
To: "Microcontroller discussion list - Public." <RemoveMEpiclistTakeThisOuTspammit.edu>
Sent: Monday, May 24, 2010 3:43 AM
Subject: Re: [PIC] Using PIC to sample 90 wires


>
> I have to agree with Russel, this would definately be the simplest
> solution and by far the quickest to implement software wise.

While I don't "disagree" with Russell, the only problem I have with these
statements is the fact that no solution is going to be even vaguely "simple"
for a beginner. They will all include USB, which is pretty nasty to debug
even with the right tools, then there is the possible need for isolation
that could add a bit of hassle to the mix, so some form of isolated serial
comms may end up being used in the shift register solution anyway - 8+ opto
isolators for each SR? or one isolated SPI/USB interface?. As far as I was
concerned, the "easiest" would be to keep the whole thing in one IC, but it
seems that the I/O limit on PICs is 85 so that's out (although add one SR
and you have a two IC solution :-)).

> All
>this would be so trivial.

Again, I think we are forgetting that nothing will be trivial to someone who
has not touched a PIC before. Most people start with flashing an LED, not
designing a 90 input, USB capable board that may have >13 ICs on it. I think
the argument for one or the other is not quite as simple as it may seem.
Whatever the choice, it's not like there isn't going to be plenty to go
wrong with either, I still think that the (less ICs = less wiring = less to
go wrong) argument could have some weight to it.

As far as adding one shift register, learning a bit, and then progressing
etc, you could also apply that argument to the multi PIC scenario. As far as
communication goes between PICs, it would certainly be easier than the USB
part and SPI (if used) is pretty much just another shift register anyway.

I guess all I am saying is that I am not totally sold with either method for
a beginner, and I don't think there is a "clear" winner, for someone who
wants to keep it a simple as possible, with concept/code and circuit.


2010\05\23@212433 by sergio masci

flavicon
face


On Mon, 24 May 2010, Oli Glaser wrote:

{Quote hidden}

But you can take the USB complexity away from PIC completely by simply
using an RS232 to USB converter (as someone else has already pointed out).
Communicating via RS232 is trivial on a PIC.

> then there is the possible need for isolation
> that could add a bit of hassle to the mix, so some form of isolated serial
> comms may end up being used in the shift register solution anyway - 8+ opto
> isolators for each SR? or one isolated SPI/USB interface?.

You can easily achive isolation with a minimal number of optos by placing
them between the PIC and an RS232 level shifter and then connecting that
directly to a RS232 to USB converter.

{Quote hidden}

On the contrary, I belive there is far less to go wrong once the wiring is
in place and shown to be working than if you have a complex piece of
software effectively running in a distributed mode across 2 processors
running in parallel. Bullet proof comms between two processors requires
careful design and implementation. Amoungst other things you need to prove
that one processor crashing isn't going to leave the other seeing false
"healthy" lines serviced by the faulty processor.

>
> As far as adding one shift register, learning a bit, and then progressing
> etc, you could also apply that argument to the multi PIC scenario. As far as
> communication goes between PICs, it would certainly be easier than the USB
> part and SPI (if used) is pretty much just another shift register anyway.

The hardware implementation of SPI really isn't the issue, it's the
software drivers in the PIC that deal with the incomming and outgoing data
(the ISR etc), the high level protocol, that's what gets people every
time. Is the slave just going to send several bytes with each bit
representing the value of one of the (subset of) 90 lines? How are you
going to synchronise this so that you know which byte refers to which
group of lines? What happens if the slave doesn't load it's SPI transmit
register quickly enough? How are the master and slave going to handshake?
Are there going to be any timeouts to prevent lockups? You could just go
on and on with this stuff. You can't just throw something together adhock
it's got to be designed and then shown to be working. With 2 PICs in the
circuit you need some way to program each seperately. Then you need some
way to debug this multiprocessor system. Ok maybe you use the USB link to
talk to the master (get the master to dump some stuff or go into a special
error mode to do some checking). How will this help debugging the slave?
Are you going to make the protocol between master and slave capable of
supporting debug commands?

Friendly Regards
Sergio Masci

2010\05\23@223417 by Oli Glaser

flavicon
face

----- Original Message -----
From: "sergio masci" <RemoveMEsmplxspamTakeThisOuTallotrope.net>
To: "Microcontroller discussion list - Public." <piclistEraseMEspam.....mit.edu>
Sent: Monday, May 24, 2010 6:23 AM
Subject: Re: [PIC] Using PIC to sample 90 wires


> But you can take the USB complexity away from PIC completely by simply
> using an RS232 to USB converter (as someone else has already pointed out).
> Communicating via RS232 is trivial on a PIC.

Agreed on that one, I forgot someone mentioned this, it would be the obvious
solution as regards a beginner with PICs.

> You can easily achive isolation with a minimal number of optos by placing
> them between the PIC and an RS232 level shifter and then connecting that
> directly to a RS232 to USB converter.

Agreed also, as long as the isolation is between the PIC and PC there is not
much to it - certainly having an external USB transceiver or similar with
basic opto islolation is easier/cheaper than USB dataline isolation. The
bidirectional, hi speed nature of USB makes it akward, but there is the
ADuM4160.

{Quote hidden}

Still not convinced on this one - just doing the wiring is going to be a
tricky task for someone with no prior experience with electronics or PICs.
The "Bullet proof comms" with this particular project is not going to be
much to speak of, and the software certainly won't be too complex.


{Quote hidden}

I understand that it's the software side of SPI that could throw someone,
but as comms go, it's about the easiest to pick up. As far as handshaking,
syncing, timeouts etc go they are all obviously pitfalls of pretty much any
communication system, but it doesn't stop them being used efficiently, I
often use SPI or I2C between PICs with no problems, and with this particular
project it could be as "simple" as an interrupt driven, one directional
stream of data, using the chip select line to sync it at the start of the
loop. I agree that it is the main problem (for a beginner) with more than
one PIC, and this could likely cause problems, which is why I was hoping
there was a one PIC solution. I'm also agreed that using shift registers is
a sensible choice, the only worry I have is that it could be a pain to deal
with so many ICs for a *beginner*, so I (and a couple of others) was looking
at an easy way to keep it simple, circuit wise, like possibly one 85 I/O PIC
with one shift register instead of one PIC with 12, this would avoid the
SPI/Multi PIC stuff entirely.

Best Regards,

Oli


2010\05\23@231856 by ivp

face picon face
> I understand that it's the software side of SPI that could throw
> someone, but as comms go, it's about the easiest to pick up

An ad hoc bit-bang would do to pass a few bytes. The receiver
can signal its readiness by changing a handshake line from L to H
or something equally basic. It could tri-state that line and receive
data on it. Simple timing loop if they're on the same clock or even
Manchester. Or data + clock


2010\05\24@050829 by Michael Watterson

face picon face
Oli Glaser wrote:
> ----- Original Message -----
> From: "sergio masci" <EraseMEsmplxspamallotrope.net>
> To: "Microcontroller discussion list - Public." <RemoveMEpiclistEraseMEspamEraseMEmit.edu>
> Sent: Monday, May 24, 2010 3:43 AM
> Subject: Re: [PIC] Using PIC to sample 90 wires
>
>
>  
>> I have to agree with Russel, this would definately be the simplest
>> solution and by far the quickest to implement software wise.
>>    
>
> While I don't "disagree" with Russell, the only problem I have with these
> statements is the fact that no solution is going to be even vaguely "simple"
> for a beginner. They will all include USB, which is pretty nasty to debug
> even with the right tools, then there is the possible need for isolation
> that could add a bit of hassle to the mix, so some form of isolated serial
> comms may end up being used in the shift register solution anyway - 8+ opto
> isolators for each SR? or one isolated SPI/USB interface?.
Isolate the CMOS SR from PIC, only 3 optos. But you don't know isolation
is needed.

Serial USB on 18F using the ready to go JAL or C libraries seems simple.
No harder than RS232. At least on JAL anyway.

If I was needing isolation I'd use Russell's idea on 18F2550 skinny DIP.
If I didn't like serial SR, I'd use 12 x 8 way switches, 3 address lines
in parallel all switches and read 8 inputs on Port D and  4 inputs on
Port B on 18F4550 40pin DIP. Though my initial thought was 12 x Octal
tristate buffers.

If no isolation, high volume  and low part count I'd use 2x 18F87Jxx, maybe.

We don't know enough about the volume , space constraints and application.
if Each input is separate phone line then you actually need 96 opto
isolators and can wire them in a 8 x 12 matrix direct to one PIC, maybe.

2010\05\24@062807 by Russell McMahon

face picon face
> > I have to agree with Russel, this would definitely be the simplest
> > solution and by far the quickest to implement software wise.

> While I don't "disagree" with Russell, the only problem I have with these
> statements is the fact that no solution is going to be even vaguely "simple"
> for a beginner. They will all include USB, which is pretty nasty to debug
> even with the right tools, then there is the possible need for isolation
> that could add a bit of hassle to the mix, so some form of isolated serial
> comms may end up being used in the shift register solution anyway - 8+ opto
> isolators for each SR? or one isolated SPI/USB interface?. As far as I was
> concerned, the "easiest" would be to keep the whole thing in one IC, but it
> seems that the I/O limit on PICs is 85 so that's out (although add one SR
> and you have a two IC solution :-)).

I don't know if you went through my (& others' ) serial suggestion
circuit description and software description. You may be amazed at how
simple it is, even for a beginner. And the hardware like unto it.
Leave aside the USB for now which is a common factor and can be dealt
with separately.

Beginner:

1. Flash an LED on a specified port pin. Change the flash rate.

2. Read another port pin and use it to turn LED in one on and off.
No debounce needed.

So far 1. is "hello world" / flash a LED and 2. is basic sw3itch input.

So, now:

CLOCK_[high|low]  involves raising and lowering a pin
LATCH_[high|low]  involves raising and lowering a pin.
GETBit involves reading a pin.
SAVEBit involves storing a bit from GETBit. They have to learn how to
do this sooer or later.

INIT involves setting up input and output regsiters etc.

ALL of these are done in 1. & 2. The beginner needs only extend them to SR use.
N=90 say

INIT
N x (clock high, read bit, clock low,GETBit, SAVEBit )

That's the software.

Per input pin provide an input divider as required. May be  x R per
line. May be more.

Hardware.
Vdd to Vdd
Vss to Vss.
8 inputs to 8 inputs.
SerialIn to SerialOut on preceding register.
Serial_out to Serial_In on preceding register.
Clock to all other clock pins.
Latch to all other latch pins.

That's the hardware.

The 2x PIC system is going to take more explaining to your beginner.

> > All
> >this would be so trivial.

> Again, I think we are forgetting that nothing will be trivial to someone who
> has not touched a PIC before. Most people start with flashing an LED

Yes. As above.

> designing a 90 input, USB capable board that may have >13 ICs on it.

The "13 ICs" is a conceptual bogeyman.
There are two IC's. One is a PIC, The other is a SR with NO external
parts that is divided into m8 bit chunks for convenience. Dasiy chain
it all together and it works. NO other hardware, apart from the
necessary input networks and power supply decoupling.

> I think
> the argument for one or the other is not quite as simple as it may seem.

Not for "the other" certainly :-).

> Whatever the choice, it's not like there isn't going to be plenty to go
> wrong with either, I still think that the (less ICs = less wiring = less to
> go wrong) argument could have some weight to it.

Yes. But repetition of a design in 8 bit modules where all are
identical has great merit. The 2 x hyperPIC arrangement has assymetric
port use, lots of lines crossing over, and more. The SR version is
simplicity galore.

>  As far as adding one shift register, learning a bit, and then progressing
> etc, you could also apply that argument to the multi PIC scenario.

There are only two stages of learning.
- Use one shift register
- Use 2 or more shift registers. This ensures you know how to chain
them (which is not hard to understand once done but anything can be
surprisingly confusing to start.

If you must have more speed and use more PIC pins, use 12 x SR, each
feeding a port pin = 12 bits. Add 3 pins for SIN, CLK, Latch and you
still have  pin spare in 16 to send async serial to the PC via a
USB/RS232 converter.

> As far as
> communication goes between PICs, it would certainly be easier than the USB
> part and SPI (if used) is pretty much just another shift register anyway.

1. SR scheme doesn't have a 2nd processor.

2. Getting two PICs talking SPI coms with data fetch from A and store
in B etc will be a vast conceptual and practical jump for beginners.

3. USB/RS232 converter eases the SUB lod vastly.

> I guess all I am saying is that I am not totally sold with either method for
> a beginner, and I don't think there is a "clear" winner, for someone who
> wants to keep it a simple as possible, with concept/code and circuit.

I started off suggesting the serial system mainly because I have used
it and found it useful. I was by no mans sold on it and "lots of
ports" sounds easy. But having argued the point I feel the SR scheme
is simpler to do, conceptually simpler and easier to code than the two
processor system. Do it all in one processor and it would be
different.


     Russell

2010\05\24@070149 by sergio masci

flavicon
face


On Mon, 24 May 2010, Russell McMahon wrote:

> I started off suggesting the serial system mainly because I have used
> it and found it useful. I was by no mans sold on it and "lots of
> ports" sounds easy. But having argued the point I feel the SR scheme
> is simpler to do, conceptually simpler and easier to code than the two
> processor system. Do it all in one processor and it would be
> different.

Hmm, now there's a thought! Build a small unit that looks after N lines
and talks to the PC via USB. If you can get N down to 45, build two
identical units with different USB addresses, get them to look after their
own block of lines and let the PC sort out the rest. You could even reduce
N to a much (DIP PIC) friendlier number and use more units. I don't know
much about USB, how easy would it be to have several PICs sharing one USB
socket? Of course all this is assuming that the project is just a one off.

Anyway I still prefer the "wide" shift register solution.

Regards
Sergio Masci

2010\05\24@071935 by Michael Watterson

face picon face
sergio masci wrote:
> On Mon, 24 May 2010, Russell McMahon wrote:
>
>
>  
> Hmm, now there's a thought! Build a small unit that looks after N lines
> and talks to the PC via USB. If you can get N down to 45, build two
> identical units with different USB addresses, get them to look after their
> own block of lines and let the PC sort out the rest. You could even reduce
> N to a much (DIP PIC) friendlier number and use more units. I don't know
> much about USB, how easy would it be to have several PICs sharing one USB
> socket? Of course all this is assuming that the project is just a one off.
>
> Anyway I still prefer the "wide" shift register solution.
>
> Regards
> Sergio Masci
>  
Bad idea. You have multiple USB devices.
To use same socket you need a hub. More expense.
It's trivial to have say HW TTL USART between the PICs and one with USB.
but one PIC with shift registers or switches or buffers is best unless a
space issue.

2010\05\24@082416 by Justin Richards

face picon face
I have a suspicion that Andrew Wood has long gone.

Andrew, are you still receiving. Over.


On 24 May 2010 19:18, Michael Watterson <RemoveMEmikespam_OUTspamKILLspamradioway.org> wrote:

{Quote hidden}

> -

2010\05\24@085043 by Olin Lathrop

face picon face
Justin Richards wrote:
> I have a suspicion that Andrew Wood has long gone.

If he is the OP, I can't say I blame him.  The phrase "beating a dead horse"
came to mind quite a few posts ago already.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\05\24@090439 by Russell McMahon

face picon face
> Justin Richards wrote:
>> I have a suspicion that Andrew Wood has long gone.

> If he is the OP,

You need a threading browser, sometimes :-)

> I can't say I blame him.  The phrase "beating a dead horse"
> came to mind quite a few posts ago already.

Indeed.
But sometimes vivisection can be educational.
Andrew posted, then responded to input  2 days later and that was ~ 2 days ago.

I thought the subject was worth talking about in its own right as it
explores what a beginner sees as easy and why, what people perceive a
beginner will perceive and why, what people see as trivial from their
own perspectives, and how people analyse the technical aspects of such
issues. Whatever.

I know which solution I'd prefer :-)


              Russell

2010\05\25@055216 by Justin Richards

face picon face
I agree totally.

I learn so much from other peoples questions and the answers that follow.

At times there are questions that are asked that I would like to ask but
dont ask as I really dont have an immediate application and enjoy the
various posts that follow.

Indeed.
{Quote hidden}

> -

2010\05\25@070113 by Oli Glaser

flavicon
face

----- Original Message -----
From: "Justin Richards" <RemoveMEjustin.richardsTakeThisOuTspamspamgmail.com>
To: "Microcontroller discussion list - Public." <EraseMEpiclistspamspamspamBeGonemit.edu>
Sent: Tuesday, May 25, 2010 10:52 AM
Subject: Re: [PIC] Using PIC to sample 90 wires

{Quote hidden}

I also agree fully. Discussions like these can generally enlighten all
involved directly, plus the people that read them. It's always nice to hear
others views on things, how they apply themselves to a problem. This is what
interests me most - the application of "knowledge" rather than the
"knowledge" itself. Great for people who may be mostly "self taught" and may
rarely have the benefit of fellow students/tutors/colleagues to pick up the
practical stuff from, the "real world" things that books often miss out. In
short, it's all good stuff.


2010\05\29@035407 by Andrew Wood

flavicon
face
Ive been doing some research into possible solutions and have found  
references to  a MAX4626 "analogue switch" which to me looks like a  
solid state relay - it says its the size of a grain of rice.

What Im contemplating is using 90 of these arranged in a matrix with 9  
columns and 10 rows per column.  Each column would share an output pin  
from the PIC which I shall refer to as "column select" This would be  
wired in parallel to the COM pin of the MAX4626.  The IN pin would go  
to the wire I want to sample which has a voltage divider on it to drop  
it to 5v.

The PIC then tests each column in turn by switching on the appropriate  
column select wire, thus applying 5v to the COM pin of all the  
MAX4626s in that column.  If the wire being sampled is live it will  
put 5v on the IN pin and the solid state relay will close.  The  
prescence of 5v on the NO pin of the 4626 will indicate the wire  
sampled is live.  This will allow me to sample the 90 wires using  
only 19 i/o pins on the PIC.


Does that sound reasonable?

Thanks
Andrew

Sent from iPhone

On 25 May 2010, at 12:00, Oli Glaser <RemoveMEoli.glaserKILLspamspamtalktalk.net> wrote:

>
> {Original Message removed}

2010\05\29@041324 by Wouter van Ooijen

face picon face
> What Im contemplating is using 90 of these arranged in a matrix with 9  
> columns and 10 rows per column.  Each column would share an output pin  
> from the PIC which I shall refer to as "column select" This would be  
> wired in parallel to the COM pin of the MAX4626.  The IN pin would go  
> to the wire I want to sample which has a voltage divider on it to drop  
> it to 5v.
> Does that sound reasonable

IMHO a bunch of analog muxers (4051 or the like) would be much easier.

Most analog switches require their in/out voltages to be within the
gnd-power range. Is that the case in your design?

--

Wouter van Ooijen

-- -------------------------------------------
Van Ooijen Technische Informatica: http://www.voti.nl
consultancy, development, PICmicro products
docent Hogeschool van Utrecht: http://www.voti.nl/hvu

2010\05\29@051934 by RussellMc

face picon face
> Ive been doing some research into possible solutions and have found
> references to  a MAX4626 "analogue switch" which to me looks like a
> solid state relay - it says its the size of a grain of rice.

Only if you use REALLY big fat rice.
About 3mm long in typical packages.

I'll bring your question up to here

> Does that sound reasonable?

No.

It sounds like you have looked at a data sheet as you know  about
there being a COM pin, but maybe not.

There's an extremely good datasheet search engine here - one of the best.
Doesn't list everthing, but more than most, is easy to get at the
datasheets, unlike some., also gives an idea of typical proices and
availability and more.
They seem to have an ulterior motive :-)

        http://www.digikey.com

Data sheets of your nominated IC and some friends are here - are here

    datasheets.maxim-ic.com/en/ds/MAX4624-MAX4625.pdf
    http://pdfserv.maxim-ic.com/en/ds/MAX4626-MAX4628.pdf

For the '4626 it says

   - Analog switch range = 0 - v+
   - V+ = 5V.

AND if you turn off V+ as a means  of deselecting an IC then V+ = 0 so
Vin max = 0 so :-(.

To use them you will need to divide (or otherwise reduce) your input
voltage FIRST so you will need probably 2, just possibly one and
perhaps 3 or 4 components per input.

And your grains of rice  probably cost over to well over $1 each, have
to be mounted etc.

If you want an idea that would perhaps allow a  single divider see
"SINGLE DIVIDER?" at end.

____________

A very major "problem" here is that you have not told people what you
are trying to do in adequate detail. Questions have been asked and
some but not all answered.

It MAY be that your application is so secret that you don't wish to
tell people what it is. BUT if not it would probably help immensely if
you provided more detail.
eg
- re the input telephone lines?
- Are they able to be "unbalanced" by sampling while  measuring and/or
by the measuring system when not measuring (eg tapping even a large
value resistor to ground from one leg of a telephone pair at all times
will cause audio imbalance and, usually, hum induction.
- Is the voltage ground referenced and  if so is it +ve or -ve wrt
gtound? Or is it floating?
- If floating - one sort of isolation voltage is needed and/or how
much may it float away from 'ground' by.
- Is there a cost budget, size budget, other budget?
- Is this a one off or many off.
- Is there a lower limit to the acceptable sampling rate. (Per uS, per
ms, per second, per day , ...)

All or some of the above MAY seen unnecessary questions and they MAY
in fact be so. But, probably not.

"Just telling us" what you are really trying to do in as much detail
as reasonably possible would greatly aid us in aiding you. Probably.
Given all the specs there are probably  tens of people on this list
who could give you extremely good cost effective answers.

___________

SINGLE DIVIDER?

Blame Jinx for the inspiration.

Assume inputs are 0/+50V wrt aq common ground.
Other polarities and relationships can be dealt with similarly.

90 optocouplers.
PIC drives optos in row/column arrays.
Opto collector per input.
Combine emitters
Monitor emitters as optos are turned on either one at a time or in groups.

Note that the title has a ? in it.
Turning on an opto with an active high collector input will pull the
common emitter rail high to "above" any other 'off' collectors.
This may/will cause design issues which have to be dealt with.
Doable - but more details re overall system is required.

Putting a single resistor in each input lead and sharing a common
output resistor - or a semi matrixed array of outputs, would probably
fix the above problems. There will be other ways once the REAL
question is known.m

Also, leakage from 90 optos needs considering.

These may do
40 cents each in 100 quantiyty.
Others are cheaper to much cheaper.
80 V rated.

About  ? twice as latge as your transmission gates - but these would work.

 http://media.digikey.com/pdf/Data%20Sheets/Sharp%20PDFs/PC357NJ0000F.pdf

You can go to 2 or 4 per package.
These cost about 20cents per opto channel  in 4 per package at 10 up rate.
SSOP etc available.

             http://media.digikey.com/pdf/Data%20Sheets/Lite-On%20PDFs/LTV-8x6.pdf

Haven't gone into any detail on how ell would work (except Vout max)
as real problem isn't known.

_______________


A similar arrangement could be considered with multiple FETs or
bipolar transistors as switches and some form of matrixed gate/base
drive. The optos are cleaner.

The above using reed relays would work well BUT expensive.









{Quote hidden}

No, again :-).

Real problem please.


      R

2010\05\29@062831 by Michael Watterson

face picon face
Andrew Wood wrote:
{Quote hidden}

no. an 8 way switch is better CD4051
3 address wires out in common paralleled for all twelve switches.  12
inputs. Total 15 pins.
or if you add a 16 way 4 bit decoder IC, to drive Inhibit lines, then 1
input and and 7 outputs.

or use a matrix of opto-isolators   12 x  8  = 96  = 20 pins

9 x 10 can be done too, but the code for  12 x8  is simpler.

or Russell's serial shift register


2010\05\29@063641 by RussellMc

face picon face
> SINGLE DIVIDER?
>
> Blame Jinx for the inspiration.
>
> Assume inputs are 0/+50V wrt aq common ground.
> Other polarities and relationships can be dealt with similarly.
>
> 90 optocouplers.
> PIC drives optos in row/column arrays.
> Opto collector per input.
> Combine emitters
> Monitor emitters as optos are turned on either one at a time or in groups.

Answering myself.

My previously mentioned "reverse biased CE junction concern matters as
a reversed biased transistor will break down (Veco) at a much lower
voltage than it will withstand when normally biased (VCEO). Veco is
usually in the 5 to 10 volt range.

With the above assumptions, if the opto couplers use  PNP transistors,
apply Vin x 90 to separate emitters and combine all collectors the
transistors will always be correctly biased..

Transistors are now "happy" with bias conditions under all circumstances.

If swing is 0/-50V wrt ground then use NPN optos for same result.

I'm not aware of PNP optocouplers - they may exist.

IF this is a relphone line sampling situation, as it may be, then th
ability to use NPN optos in this manner is 'fortunate.'

_________________

A special case may exist if input s are say [+50 V | float]  rather
than +50/ground. In such a case if inputs are taken to emitters of NPN
optos and collectors all joined, then a sense resistor from the
combined collectors to a voltage > 50V (say 60V) will cause all
combined collectors to be at 60 V (transistor off OR inout float) and
50V (transistor on and input = +50V.

Whether it is acceptable for a floating input to have 60V applied in
this was is moot in the absence of a proper problem definition.



  Russell

2010\05\29@065935 by Michael Watterson

face picon face
RussellMc wrote:
>
> A special case may exist if input s are say [+50 V | float]  rather
> than +50/ground. In such a case if inputs are taken to emitters of NPN
> optos and collectors all joined, then a sense resistor from the
> combined collectors to a voltage > 50V (say 60V) will cause all
> combined collectors to be at 60 V (transistor off OR inout float) and
> 50V (transistor on and input = +50V.
>
> Whether it is acceptable for a floating input to have 60V applied in
> this was is moot in the absence of a proper problem definition.
>
>
>  
I'm confused..
there is 100V to 1kV isolation on typical optocouplers.

The LED bit is driven via resistor from 50V line. It can be balanced
pairs, isolated pairs or common ground.

Transistor outputs: I've only ever seen NPN commonly. Some vague memory
of triac/thyristor?  Though I suppose PNP  or FET is possible.

The base can be "floating".

At more than 5V reverse  you could have zener action on  BE  junction
and  current  via  BC. But at PIC input and drive levels I think an
output transistor matrix will work. Examination of a datasheet or device
would tell.  many NPN have zener volts around 6V to 7V, which is why a
1N4148 diode across base from ground on RS232 line driving a NPN via 1k
to 10K is a good idea, in the event you actually meet a serial port with
ANY -ve swing or indeed -8.6 (typical pumped interface converter from
+5V)  to -12V (original  drivers with a real -12V supply).


2010\05\29@071904 by Dario Greggio

face picon face
Michael Watterson ha scritto:

> Transistor outputs: I've only ever seen NPN commonly. Some vague memory
> of triac/thyristor?  Though I suppose PNP  or FET is possible.


triac output i.e. "photodiac" do exist - moc3020

2010\05\29@072545 by RussellMc

face picon face
>> A special case may exist if input s are say [+50 V | float]  rather
>> than +50/ground. In such a case if inputs are taken to emitters of NPN
>> optos and collectors all joined, then a sense resistor from the
>> combined collectors to a voltage > 50V (say 60V) will cause all
>> combined collectors to be at 60 V (transistor off OR inout float) and
>> 50V (transistor on and input = +50V.
>>
>> Whether it is acceptable for a floating input to have 60V applied in
>> this was is moot in the absence of a proper problem definition.

> I'm confused..

Read my original description and sketch one channel.
I was describing the opposite way of using the opto to what you describe.

You suggest using the input to drive the opto's LED and do X/Y PIC
dive via the transistor.

I drive the LED from the PIC with XY drive and tak the output from ALL
transistors arranged with either C or E commoned (see text ) and E or
C connected one per opto to an input.

My meythod has the following "advantages"

- Load resistance on input can be high - does not need to assume
ability to draw LED driving current.

- Does not need a resistor per input or pair of resistors etc - uses
an OPTO per input but R's etc are common to all circuitry.

- Sample input voltages relative to reference of choice - eg voltage
may be +50/0 or +50 float etc.

The OP's spec is not clear enough to be sure whether input is xxV /
float or + or - wrt ground or able to provide opto level current or
...m. My solution accepts  most of those points.

I do prefer the "inputs drive LED via R" solution but it requires some
of the above to be true.

SO my comments re reverse bias were re CE junction. BE junction is not
accessible or affected.
IF turning on one transistor causes another to have Vce > ~ 5V the off
transistor may reverse conduct. This matters if the input circuit
cannot tolerate this. My various discussions were aimed at avoiding
this.

> there is 100V to 1kV isolation on typical optocouplers.

Yes. Or more. OP has not specified need if any but optos can be bought to suit.

> The LED bit is driven via resistor from 50V line. It can be balanced
> pairs, isolated pairs or common ground.

Yes. Not in my scenario. Good solution if tolerable. Note that at 50V,
dissipation is 50 mW per mA of opto current. And, if say this was a
phone line that current would be far too high to be acceptable. OP
needs to specify.

> Transistor outputs: I've only ever seen NPN commonly. Some vague memory
> of triac/thyristor?  Though I suppose PNP  or FET is possible.

SCR are available. And FET. PNP I've not seen. Quite often, as bipolar
floats, you could use NPN upside down for reverse polarity BUT here
you cannot as the scenario I describe drives devices into all  4
quadrants at various times.

> The base can be "floating".

Yes. That was how I treated it.

> At more than 5V reverse  you could have zener action on  BE  junction
> and  current  via  BC.

But, as bad or worse, you get VECO breakdown at 5 to 10 V. Not usual
to use a transistor there.


> But at PIC input and drive levels I think an
> output transistor matrix will work. Examination of a datasheet or device
> would tell.  many NPN have zener volts around 6V to 7V, which is why a
> 1N4148 diode across base from ground on RS232 line driving a NPN via 1k
> to 10K is a good idea, in the event you actually meet a serial port with
> ANY -ve swing or indeed -8.6 (typical pumped interface converter from
> +5V)  to -12V (original  drivers with a real -12V supply).

Yes - for Vbe considerations. For Vce as here doesn't apply.




    Russell

2010\05\29@080851 by Michael Watterson

face picon face
RussellMc wrote:
>
>
> I drive the LED from the PIC with XY drive and tak the output from ALL
> transistors arranged with either C or E commoned (see text ) and E or
> C connected one per opto to an input.
>
>  
Yes.. an X-Y addressed switch with a single common
That won't work with phone lines though as they are "balanced". If you
have a single common, your shift register idea is better.
On "line" cards for Central Office or small office Voice mail we used
total isolation, no assumptions. No interconnect between pairs except on
C.O. end only on transformer centre tap. We also did some Active Hybrid
(ICs and -48V line drive, no transformer!). Typically the hybrid
transformer(s) at exchange end had AC centre point fed by -48 & 0V.

On subscriber end cards (PABX or voicemail) no earth at all.

{Quote hidden}

But we don't know what sort of 50V lines it is. If it's common "ground"
then the shift register or CD4051 approach is better than 90 opto-isolators.
If it's phone lines then the reverese opto isn't suitable at
subscriber/PABX, but could be used at C.O. end.

you can use optoisolator to detect subscriber line powered without
exceeding current draw to cause off hook sense at exchange.
{Quote hidden}

Well, at low currents the transfer gain falls. So maybe 20uA on
transistors needs 100uA of LED.

Normally LEDs are driven in mA range, but 100uA or maybe even 50uA
depending on isolator is possible.
lower drive might be problematic with leakage currents on X-Y matrix
even if workable for a single sensor.
>
>  

2010\05\29@085835 by RussellMc

face picon face
> But we don't know what sort of 50V lines it is.

Indeed! :-).
My point also.
The "specification is too vague and too wide to allow of a certain solution.
Andrew has been asked various questions, but has so far answered selectively.
While it's quite interesting to speculate on how things MIGHT be able
to be done, until Andrew gets more specific, preferably MUCH more
specific, it's more an interesting exercise than a solution.

+50/-50
ground/float
balanced, audio ,stiff, hi z , ... ?
speed.
Power / current allowed.
Cost
Quantity.
More ....


   R

2010\05\29@125520 by Andrew Wood

flavicon
face
Its sort of telephones but not conventional phone lines.  Its to go  
into a reed relay based telephone switch from the 1
Sent from iPhone
On 29 May 2010, at 10:19, RussellMc <apptechnzSTOPspamspamspam_OUTgmail.com> wrote:

{Quote hidden}

> --

2010\05\29@125934 by Andrew Wood

flavicon
face
Its to go into a reed relay telephone switch from the 1960s.  If  
something went wrong it would print out what equipment was at fault by  
burning upto 90 lines onto electrosensitive paper.  I need to take the  
50v from each "pen" and log which ones are live.

Im sorry if Im not giving full details but some things you mention I  
havent a clue what they are. Like a shift register for example?

Thanks for the help.



Sent from iPhone

On 29 May 2010, at 11:28, Michael Watterson <spamBeGonemikeSTOPspamspamEraseMEradioway.org> wrote:

{Quote hidden}

> --

2010\05\29@133558 by RussellMc

face picon face
> Its to go into a reed relay telephone switch from the 1960s.  If
> something went wrong it would print out

(? - the circuit you are building 'would' or the original circuit did this?
Presumably your circuit).

> ...what equipment was at fault by
> burning upto 90 lines onto electrosensitive paper.  I need to take the
> 50v from each "pen" and log which ones are live.
>
> Im sorry if Im not giving full details but some things you mention I
> havent a clue what they are. Like a shift register for example?
>
> Thanks for the help.

OK.
The thot plickens.
But, even now you have just given us one more smallish (but very
useful) dollop of information about what you are wanting to do.
There are still a few dollops missing.

If you can expand "it's to go into ... " into a fairly full
description we should be almost there!

eg are you trying to monitor the DRIVE voltages that drive 90 relays -
ie the voltages that cause the relays to operate.

OR are you trying to 'look' at the outputs of the relays to see if
they are operated or not, and they are switching 50 V.

Or

???

AND:
Are the voltages also connected to a speech circuit - ie will
connecting to the line to be monitored also connect to a circuit which
is carrying speech.
OR
Is there no actual speech signal on the actual wiring to be connected to.

Best of all, if you paint us a word picture of exactly what you are
wanting to do we'll be home .

Probably :-).
____________

Note that none of the questions were asking about shift registers.
Rather, some of the answers involved shift registers.
They still may be a good answer BUT it's looking like the opto-coupler
solution may be workable and, if so, it saves a lot of extra resistors
etc.



              Russell

2010\05\29@152253 by Michael Watterson

face picon face
RussellMc wrote:
{Quote hidden}

sounds like it is drivers for 90 pin parallel head printer, not voice
lines directly (but who knows?)
So common ground, no opto isolators needed
use resistor divider on each driver pin/pen to convert to 5V. Since it
might not be exactly 50V, a resistor divider to reduce volts to 6V out
from 48V in  and 4.7V zener .

the shift register is a fairly simple very cheap IC, one signal from PIC
loads 8 pins of 0V or 5V, a clock changed by PIC then allow one pin on
pic to read all 8 bits in turn. Since the shift register has a shift in,
you can "daisy chain" 12 of them and with a single pin on PIC connected
to all 12 of the shift register ICs (about 25c each) you read all 90
pins of  the "printer driver". then 90 clock pulses reads them to PIC.
This can be done at about 1MHz, so you can re-read the electrosensitive
paper pins about 10,000 times a second.

Or you can use 12 x 8 way switches, CD4051. 3 wires select which one of
8 inputs, and you read all 12 switches at once, change address and read
again. This method since it is 12 bit parallel, will read at about
120,000 times a second if using same clock rate as shift register to
change address and read 12 pins instead of one.




2010\05\29@165137 by Bob Blick

face
flavicon
face

On Sat, 29 May 2010 20:23:19 +0100, "Michael Watterson" said:

> sounds like it is drivers for 90 pin parallel head printer, not voice
> lines directly (but who knows?)
> So common ground, no opto isolators needed
> use resistor divider on each driver pin/pen to convert to 5V. Since it
> might not be exactly 50V, a resistor divider to reduce volts to 6V out
> from 48V in  and 4.7V zener .

Unless it's positive ground like lots of old phone company stuff seems
to be...

Hey, Andrew, have you reverse-engineered the part of the circuit you
need to monitor? Where is ground in reference to the 50 volts(positive
or negative)? Or, even better, is there some driver for these
pen-thingys that is driven with a logic-level signal? That would be LOTS
easier to monitor. I don't know what your level of electronics expertise
is, but the more you know about the problem, the simpler your solution
will be.

Cheerful regards,

Bob

--
http://www.fastmail.fm - Access all of your messages and folders
                         wherever you are

2010\05\29@205405 by RussellMc

face picon face
Andrew

We are homing in on your requirement.

BUT would you PLEASE write us a small essay -   few paragraphs should
do - describing EXACTLY what you are trying to do. Each little extra
tidbit has allowed us a slightly better idea, but there is still some
way to go.

You have several centuries of engineering experience hanging on your
every utterance. PLEASE now try and make best use of it by now
providing a clear picture

eg the following MAY adequately describe what you are trying to do,
and may not.

A.  There are 90 reed relays.
The coils are driven with [ +50 | -50 ] volts relative to earth via
relay contact so that on the coil there is either [+50V | -50 ] V wrt
ground when the coil should be activated or a resistive coil to ground
when the coil is deactivated. The aim of the project is to be able to
electronically monitor the 50V signals to establish when they are or
aren't applied applied.

The 50 V signals are
    i  for control purposes only and do not form part of an actual
speech circuit.
       (ie The relays are/aren't involved in switching speech but the signals
         concerned do not have speech voltage on them).
OR
    ii also have AC speech signals on the same circuit as the DC 50V.
      (ie as per standard telephone circuits)

The reed coil resistances are [xxx ohms | unknown]

It would be adequate for the PIC to be able to read the state  of the
90 lines once every
[ ms | 100 mS | 1 second | 10 seconds]

The 90 channels on electrosensitive paper mentioned
i Were what was originally there and I wish to replace them with a PIC monitor.
OR
ii Were not originally driven by the system - I wish to use the PIC to
drive them.


Overall:  A historical status monitoring unit drove a 90 channel
electrosensitive paper recorder using 90 reed relays activated by +50V
signals relative  to ground, applied by relay contacts. The aim is to
dispense with this recording unit, monitor the 90 lines with a PIC
based circuit and process and act on the signals accordingly.

etc
___________

SO, Andrew, your turn. If you can be at least as detailed as above
then we can probably provide some very good answers.

Failing to provide this level of detail is wasting a lot of people's
time unnecessarily.
(That's not a complaint - just advice re asking good questions).
It will be a complaint if you now don't do it :-).




               Russell


On 30 May 2010 08:51, Bob Blick <KILLspambobblickspamBeGonespamftml.net> wrote:
{Quote hidden}

>

2010\05\29@212647 by ivp

face picon face

> Its to go into a reed relay telephone switch from the 1960s

How about Hall Effect sensors monitoring coil fields, with the
sensors' outputs into analogue or digital multiplexers ? Or LEDs
in series with the coils ?

2010\05\30@135659 by Andrew Wood

flavicon
face

> sounds like it is drivers for 90 pin parallel head printer, not voice
> lines directly


correct.


forget the reed relays, theyre just used for switching the speech  
paths. ive just realised the word line is confusing - Im referring to  
lines as in marks burnt on the paper not lines as in phone lines

the 90 wires come from the control system, and literally burn a line/
mark on the paper if the wire is energised. you then hold the paper  
against a transparent overlay and see which lines /marks are marked on  
the paper and which arent. the presence/absence of certain marks  
indicates (with the help of the overlay) which parts of the system are  
at fault.


the special paper is no longer available so I want to sample the print  
heads to see which are live then store the result in a PIC so I can  
connect to it over USB and read them out.

All I want to do is test which of the 90 wires are live and which  
arent and for each one store a 1 or a 0.

Being a telephone switch its positive earth, although to be honest Ive  
never really understood what this means. To me its always been the  
negative that was earthed.

Im looking at using an Atmel AT76C711 for the USB interface which can  
connect to the PIC over SPI.

Andrew


2010\05\30@143829 by Bob Ammerman

flavicon
face
> ...
> Im looking at using an Atmel AT76C711 for the USB interface which can  
> connect to the PIC over SPI.
>
> Andrew

FWIW: I'd just use async serial and a generic USB<->serial converter.

SPI is easy enough, but serial is probably easier yet.


-- Bob Ammerman
RAm Systems

2010\05\30@162350 by Michael Watterson

face picon face
Bob Ammerman wrote:
>> ...
>> Im looking at using an Atmel AT76C711 for the USB interface which can  
>> connect to the PIC over SPI.
>>
>> Andrew
>>    
>
> FWIW: I'd just use async serial and a generic USB<->serial converter.
>
> SPI is easy enough, but serial is probably easier yet.
>
>
> -- Bob Ammerman
> RAm Systems
>
>  
I'd use 18F2550 or 18F4550 with serial profile USB. HW is 220nF cap and
USB socket. SW is off the shelf library.

2010\05\30@221413 by RussellMc

face picon face
{Quote hidden}

OK.
ALMOST there:

You still haven't answered specific questions that it is within your
ability to have answered by now.
People can guess at the answers from what you have said. But the
guesses may be wrong.
You can take a few cuts off the death by 1000 cuts by actually
providing specifics.

Normal state of line when "unoperated" is
   - "Open" - no connection to ground or
   - Ground via a relay coil, printer coil, resistor etc
   - Hard Ground (operated contact) or
   - -50 V wrt earth.

State of line when operated is
   - -50 V wrt ground.
   - Ground via contact
    - +50V wrt earth  (unlikely)

Update rate required (as per prior questions).

Other ...?

> Im looking at using an Atmel AT76C711 for the USB interface which can
> connect to the PIC over SPI.

That may be a good choice if you are Atmel capable, and or USB capable
AND PIC&Atmel SPI capable
Otherwise you are adding to complexity when you may rather have
something working initially.

As previously noted by several people, use of PIC asynchronous serial
to an off the shelf serial to USB converter will allow very very very
easy get you going USB. What you described instead is about 10 to 100
x as complex for a beginner. By all means do it if there is an
overwhelmingly good reason to do so. Otherwise strongly consider
starting with serial/USB converter.


     Russell

2010\05\31@153552 by Andrew Wood

flavicon
face
50v Positive Earth when operated, open when not operated. Needs to be  
checked at a frequency of 13Hz (every 80millisec)


On 31 May 2010, at 03:13, RussellMc wrote:
{Quote hidden}

2010\05\31@162056 by Michael Watterson

face picon face
Andrew Wood wrote:
> 50v Positive Earth when operated, open when not operated. Needs to be  
> checked at a frequency of 13Hz (every 80millisec)
>
>  
Ok, so you can level translate to +5V for off and 0V for -50V in by two
resistors and 2 x cheap 1N4148 diodes for each of 90 signals.
One resistor is 10K pullup to +5v  with clamp diode from ground to
pin.on Shift register parallel in, 2nd diode anode to input pin also  
and cathode via 100k resistor to the -50v or off signal.

OFF will = +5V
-50V in will = 0V

use 12 x 8 bit shift registers with clock pins all parallel driven by a
PIC pin
parallel all "load" pins. drive by a PIC pin
daisy chain SO and SI  (11 connections between 12 chips) and final SO to
PIC input pin.

Software:
do forever
toggle load pin to read all 90 inputs to Shift registers  (< 2uS)
 for 90 times:  (takes
    toggle clock pin and then read last SO pin.  (takes  <  2uS  per  
bit!)
 end for
 send data to host via serial or USB*  (even at 4,800 baud is < 50ms
for 96 bits) (or do this every 8 inputs)
wait till 80ms is up  (do nothing for 30ms if 4800baud, or 55ms if 9600
baud!)
loop
(*Doing this on 18F2550 using JAL USB serial library is simpler than
serial in Assembler)



'[PIC] Using PIC to sample 90 wires'
2010\06\02@143506 by Andrew Wood
flavicon
face
Thanks for the suggestions? Just one query.

Why have you mapped Off to +5v and -50v to 0v? I was thinking 5v for
-50v and 0v for off?

Im still a little confused what is meant by positive earth and -50v?.
The circuit board on which this is going to be mounted has a -50v
continuous supply which Im going to use for general power.  Will this
cause a problem being negative?

Andrew


On 31/05/10 21:21, Michael Watterson wrote:
{Quote hidden}

2010\06\02@150800 by Michael Watterson

face picon face
Andrew Wood wrote:
> Thanks for the suggestions? Just one query.
>
> Why have you mapped Off to +5v and -50v to 0v? I was thinking 5v for
> -50v and 0v for off?
>
> Im still a little confused what is meant by positive earth and -50v?.
> The circuit board on which this is going to be mounted has a -50v
> continuous supply which Im going to use for general power.  Will this
> cause a problem being negative?
>
> Andrew
>  
you can get an isolated  -48V module to 5V PSU module cheap off the
shelf, it is likely good to -64V or at least -57V as -48V power supplies
are often 4 x12V batteries which used to be 13.8V each and now are
typically 14.2V fully charged. 4 x 12 = 48, 4 x 14.2 = 56.8.  Most 12V
battery gear is rated to 16V, so 4 x16 = 64V

-50V -> +5V and off to 0V needs an inverter.  if Off = 5V (pullup
resistor on PIC pin to the +5V supply) then a simple potential divider
with protection diode pulls the +5V down to 0V when input is -50V.  
Inverting the logic in software is free. Inverting the physical signal
requires a transistor and resistor extra per pin.

You absolutely need to run the PIC of +5V or +3.3V. So you need a low
power isolated converter module. These are very standard as ALL
electronics in Telecoms is +12, +24, +8V, +5, +3.3V PCB power but -48V
system power. This is not just telephone systems but virtually all Mast
mounted or mast base station gear. It's often not really -48V or -50V
but -42V (battery nearly flat) to -57V (battery fully charged). Some
sites just have 4 x truck batteries on a "smart charger" and run
everything off that "-48" or "-50V" supply.  There may even be AC mains
inverter run off the -48V. One site had a 220V AC smart charger powered
of inverter off the -48V, which was on a single truck battery providing
+12V for a voice repeater. That repeater gets to have about 20 hrs
continuous use after the rest of the base station/mast gear has died :)


2010\06\02@152647 by Olin Lathrop

face picon face
Michael Watterson wrote:
> You absolutely need to run the PIC of +5V or +3.3V.

You absolutely don't.  The PIC needs to see something suitable between its
Vdd and Vss pins, but the absolute value of those doesn't matter to the PIC.
In this system for example, you could tie the PIC Vdd to ground and Vss
to -5V.  Or Vdd could be -45V and Vss -50V.

Since the PIC has to sense 90 input lines and can produce a single serial
output stream (if I understand the specs right), then it would be better to
power the PIC such that interfacing to the 90 lines is easiest and
opto-isolate the serial output stream.  It sounds like isolation to the rest
of the world is desirable here anyway.

Perhaps running the PIC from +5V and 0V is the way to go, but that is
certainly not a inherent requirement.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\06\02@163623 by Michael Watterson

face picon face
Olin Lathrop wrote:
> Michael Watterson wrote:
>  
>> You absolutely need to run the PIC of +5V or +3.3V.
>>    
>
> You absolutely don't.  The PIC needs to see something suitable between its
> Vdd and Vss pins, but the absolute value of those doesn't matter to the PIC.
> In this system for example, you could tie the PIC Vdd to ground and Vss
> to -5V.  Or Vdd could be -45V and Vss -50V.
>
> Since the PIC has to sense 90 input lines and can produce a single serial
> output stream (if I understand the specs right), then it would be better to
> power the PIC such that interfacing to the 90 lines is easiest and
> opto-isolate the serial output stream.  It sounds like isolation to the rest
> of the world is desirable here anyway.
>
> Perhaps running the PIC from +5V and 0V is the way to go, but that is
> certainly not a inherent requirement.
>
>  
Why complicate with opto isolator when you don't need one.
Any how you love to prove you are smarter, but obviously I was referring
to VDD vs Vss. Of course the vss could be -5V, but a -48V (maybe -60V)
to -5V regulator + opto isolator is perverse when -48V to 5V  or -48V to
3.3v is a stock item. All telecom gear I've ever worked on or designed
actually uses + supply of isolated -48V module.

You might be the most expert person on this list, but you are also the
most pedantic and rude one. Brings back memories of UseNet.

2010\06\02@171905 by YES NOPE9

flavicon
face
{Quote hidden}

Michael,
You are wrong.  I am mostly the most rude person on the PIClist and I  
have
photos to prove it.  And testimonials.
Gus

2010\06\02@172832 by Olin Lathrop

face picon face
Michael Watterson wrote:
> Why complicate with opto isolator when you don't need one.

You are missing the point.  I wasn't saying it was necessarily better to run
the PIC at -5V to 0V, or -50V to -45V, or something else, only that it was
possible.  It might be reasonable in this design to do so, or maybe not.
That depends on what the external world interface requirements are, which I
don't think we know.  It may also be quite possible that isolation is
required anyway, in which case there is no additional cost due to the opto.

> Any how you love to prove you are smarter, but obviously I was
> referring to VDD vs Vss.

That was not obvious, and certainly not what you said.

> You might be the most expert person on this list, but you are also the
> most pedantic and rude one.

Attention to detail is important.  There can be 2000 people reading a
message, with many of them not able to tell the good from the bad.  I make
no apologies for pointing out incorrect or ambiguous statements.  If you
don't like that happening to your statements, be more correct and less
ambiguous.


********************************************************************
Embed Inc, Littleton Massachusetts, http://www.embedinc.com/products
(978) 742-9014.  Gold level PIC consultants since 2000.

2010\06\02@202030 by RussellMc

face picon face
Gentlemen!
Please!
...

:-)
:-(
Stamps on hat ...

2010\06\04@095620 by Andrew Wood

flavicon
face
Maybe Im just too thick to be working on this because Im totally lost.

I dont see why I cant use strobing to arrange the 90 wires into 9
columns of 10 and at each crosspoint put an AND gate transistor.

On 31/05/10 21:21, Michael Watterson wrote:
{Quote hidden}

2010\06\04@101340 by Jim

flavicon
face

Andrew,

If you think that will work, go for it.  If it works, you'll be on your
way to finalizing your project.
If it doesn't work, you'll have some new knowledge that will make you
more educated, and you'll
know not to try that method again within the context of that problem.

The combined education, knowledge, and information posessed by the
members of this list is enormous.
And the advice given to someone from this list can generally be
considered true and correct, and you can
pretty much bank on the use of said information.  But that doesn't mean
that there aren't other methods
and solutions to a given problem.  So if you have an idea for a
solution, you have the ability to give it a try.

However, remember that if you ask about a certain idea you have, and the
general concensus is that it won't work, or it is, or will be dangerous
to try, and you decide to go ahead and try it anyway,  first, think
twiceabout doing it, second, be careful, and third, if it doesn't work
and you get hurt somehow, you have only yourself to blame because you
were old it wouldn't work, and that it could or wil be dangerous.

The bottom line is use good judgement using any method.

Regards,

Jim




---{Original Message removed}

2010\06\04@101752 by Michael Watterson

face picon face
Andrew Wood wrote:
> Maybe Im just too thick to be working on this because Im totally lost.
>
> I dont see why I cant use strobing to arrange the 90 wires into 9
> columns of 10 and at each crosspoint put an AND gate transistor.
90 transistors  & 19 pins
vs 12 ICs that are cost of two transistors and 3 pins

2010\06\04@113422 by Marechiare

picon face
> You might be the most expert person on this list, but you
> are also the most pedantic...

Wrong usage of "but", it should be "therefore".

2010\06\04@113748 by Bob Blick

face
flavicon
face

On Fri, 04 Jun 2010 14:55:16 +0100, "Andrew Wood"
said:
> Maybe Im just too thick to be working on this because Im totally lost.
>
> I dont see why I cant use strobing to arrange the 90 wires into 9
> columns of 10 and at each crosspoint put an AND gate transistor.

That would only work if the existing circuit drove them as a 9 x 10
array. But it sounded to me like you had 90 signals and 1 common.

Cheers,

Bob

--
http://www.fastmail.fm - The way an email service should be

2010\06\04@113923 by Bob Blick

face
flavicon
face

On Fri, 4 Jun 2010 18:34:21 +0300, "Marechiare" said:
> > You might be the most expert person on this list, but you
> > are also the most pedantic...
>
> Wrong usage of "but", it should be "therefore".

Hey, Russell already said "play nice".

--
http://www.fastmail.fm - IMAP accessible web-mail

2010\06\04@144330 by Xiao Xu

picon face
Wrong usage of "play nice". It should be "play nicely". Must use the
adverbial form.
- Xiao Xu


On Fri, Jun 4, 2010 at 11:39 AM, Bob Blick <EraseMEbobblickspamEraseMEftml.net> wrote:

{Quote hidden}

> -

2010\06\04@150925 by Spehro Pefhany

picon face
At 02:43 PM 04/06/2010, you wrote:
>Wrong usage of "play nice". It should be "play nicely". Must use the
>adverbial form.
>- Xiao Xu

Sorry, but "Play nice" is idiomatic English.

Googlecount("Play Nice") = 1.8E6
Googlecount("Play Nicely") = 0.2E6

More than 8:1 in favor of "Play Nice".

Best regards,

Spehro Pefhany --"it's the network..."            "The Journey is the reward"
@spam@speff@spam@spamspam_OUTinterlog.com             Info for manufacturers: http://www.trexon.com
Embedded software/hardware/analog  Info for designers:  http://www.speff.com



2010\06\04@152010 by Michael Watterson

face picon face
Spehro Pefhany wrote:
> At 02:43 PM 04/06/2010, you wrote:
>  
>> Wrong usage of "play nice". It should be "play nicely". Must use the
>> adverbial form.
>> - Xiao Xu
>>    
>
> Sorry, but "Play nice" is idiomatic English.
>
> Googlecount("Play Nice") = 1.8E6
> Googlecount("Play Nicely") = 0.2E6
>
> More than 8:1 in favor of "Play Nice".
>
>  
Maybe in America

2010\06\05@013044 by RussellMc

face picon face
> > Maybe Im just too thick to be working on this because Im totally lost.

No. Obviously not "too thick".
BUT.
It is liable to help if you

- Take note of the technical answers that you get.

- Try and assess which are liable to be useful ones (generally but not
always assessable from detail provided, part numbers or general
descriptions, care of explanation, technical persistence of answerer
over several questions etc)

- THEN try and understand such answers.

- THEN answer any questions that such answerers have asked.

- THEN ask more questions as/if required.

Note - you tend to fit the following 'model' to a reasonable extent.
Note that this is NOT a personal criticism per se, as it is common
enough with people dealing in things a bit beyond their areas of
expertise. It's useful to you and others if you can short-circuit this
process if possible.

Newcomers often:

- Tend to seize on parts of answers that seem good to you without
taking the whole answers, and
- When people ask good questions,  tend to answer them selectively.
- As a  consequence -  don't get where they  are trying to go nearly
as quickly as if they'd  'coopererated',
- Get more confused than is strictly necessary and
- Tend to wear out the people trying to help.

The 'flip side' of avoiding this is you have to trust the 'experts'
somewhat, they have to be polite and helpful and you need to decide
which experts really are experts :-). In a group of several they will
be somewhat self correcting.

Where you read YOU below expand it mentally in each case to read

                 " you (as is common enough amongst beginners, so we
understand,
                 but we'd appreciate you learning from the experience)

> > I dont see why I cant use strobing to arrange the 90 wires into 9
> > columns of 10 and at each crosspoint put an AND gate transistor.

> 90 transistors  & 19 pins
> vs 12 ICs that are cost of two transistors and 3 pins

Yes. Transistor and gates are an option.
An AND gate would eg consist of 3 base inputs which are all -ve wrt
ground to turn the transistor off .
eg 5 VDC local supply with +5 to gnd and loacal-gnd = -5V.
Logic high = ground = 1
Logic low = -5VDC wrt ground = 0

Row and column mux are normally high.
Inputs are 0/-50V.
Row & column inputs = sat 1 diode each.
-50V input = 1 resistor to -50V and 1 resistor to logic high as pullup

Per gate = transistor + 2 diodes + 2 resistors.
(90+180+180 all up)
+ some common mux components.
+ 19 PIC pins

"My" opto solution used 90 opto ICs (or 45 duals or 23 quads) and
AFAIR NO other per channel parts, + required some drive components. +
19 PIC pins

A serial shift register arrangement needed 12 x 8-input SR ICs (which
are very low cost)  + 180 resistors + 3 PIC pins.

4051 transmission gate solution needed similar but more PIC pins.

The 4051 solution has the advantage that you COULD use an ADC and
measure actual input voltage, if you cared. (you don't, probably).

Which solution is best for you is unknowable to "us" because" you did
not provide enough detail and didn't answer questions relating. What
is an acceptable cost target? Are you comfortable with SMD, ICs,
soldering, many resistors, ... . etc.
If we know what you know and what your real objectives are then we can
better help. We'd like to.

If ease of manual assembly was the aim I'd look hard at the opto solutions.
For overall convenience and cost and size and ... I'd lean towards the
shift register solution.


etc


          Russell












>
>

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