Go Down

Topic: Is it possible to read 218 independent inputs? (Read 6051 times) previous topic - next topic

deSilva

Quote
The PISO SRs will work just fine, the only thing is the speed using user C code and that seems to be open to conjecture at present. Certainly if the function was written in assembler it would be fast enough.

Unfortunately the Arduino doesn't have a shiftin() function to match shiftout() as it's possible a library function like this would be written in assembly (OK unlikely but possible).

The PISO approach is NOT fine as A LOT of hardware is involved. There is no need to improve the speed, as I miscalculated the time due to a slip of my memory, and the situation is quite favourable.

The ShiftOut is slow, it is NOT coded in assembly. Have a look at all that C-code in the Arduino directory from time to time...

UltraMagnus

A lot of cheap hardware though, shift registers are as cheap as, well, chips.

I would just write the SR read and write code using direct port manipulation, much faster.  

Graynomad

Quote
The ShiftOut is slow, it is NOT coded in assembly

Then maybe it should be.

Quote
There is no need to improve the speed

Our posts crossed here so I was working on the 150uS.

Quote
The PISO approach is NOT fine as A LOT of hardware is involved

Granted your idea uses only 5 chips and that's a big plus, but there's no need to shout.

Anyway I'm just presenting an idea that 2stl may (or may not) feel more comfortable with, after all despite needing 28 chips there is still only 3 wires involved.
Rob Gray aka the GRAYnomad www.robgray.com

deSilva

#33
Aug 14, 2010, 12:49 pm Last Edit: Aug 14, 2010, 03:03 pm by mpeuser Reason: 1
Sorry for shouting  :'( It had been late night here. (On second thought one should never shout at late nights...)

Well, you are right WRT to connecting to the Arduino itself (3 wires against 4 (plus ground)) A PISO approach can also abandon the latch line, as no exact sychonicity is required.

However I should be concerned with all the wiring at the interface to the 200+ key with 25+ chips. This will need good PCB design..

deSilva

#34
Aug 14, 2010, 01:44 pm Last Edit: Aug 14, 2010, 01:45 pm by mpeuser Reason: 1
To my surprise the analogue approach has been discussed in length in this thread already
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1226896251/
That elaborates the general idea...

I think a simpler explanation is this.
You implement a classical R-2R DAC, but the input is done from the keys rather than from the controller.

The decoding from the ADC then mirrors the bit pattern of the input! I did not think of this yesterday, but all the bits will become correctly reproduced automatically without any transformation!

This however it bound to the fuzziness of the analogue world... So best not use the lowest 2 bits, which gives you 8 keys to connect to one ADC channel - more or less reliably.

Graynomad

Quote
This will need good PCB design..

Not to mention a BIG design  :), Eagle free version won't handle it.
Rob Gray aka the GRAYnomad www.robgray.com

UltraMagnus

Quote
Not to mention a BIG design  Smiley, Eagle free version won't handle it.


or just protoboard and LOTS of wire.  ;D

2stl

Many thanks guys!

Sorry for my previous post because I just noticed it doesn't make much sense, as I tried (unsuccesfully) to translate a commom term in my native language :).

Quote
Whatever you do this is going to be a large wiring job though.

As a noob, this isn't a big problem, because it seems pretty much easy to understand the functioning of the 'apparatus'. The massive wiring isn't very bad because after that everything will work for sure (i think). I want to avoid the possible unpredictable problems of using a more 'advanced' (complex) method. I know that I will not be able to deal with such problems. I plan to study electronics a little more after this project and then I will try to 'enter the analog world'.

Therefore, correct me if i'm wrong, but if I understand correctly, the whole circuit will be as simple as this:

(scaled to 28 shift registrérs)

And it will be possible to read all the switches into one array at a very high frequency.

This sounds pretty much like a dream to me, because I thought it was going to be much harder. :) Will it be possible to use any register on the market? (or should I search for a particular brand/specification?)

Thank you very much guys. You have no idea how much it is important to me!  ;)

deSilva

#38
Aug 16, 2010, 02:50 pm Last Edit: Aug 16, 2010, 02:51 pm by mpeuser Reason: 1
Yes, 2stl - this is the simplest soulution. You did it quite well with all the pull-downs in place :-)

The issue is that you need 25+ of those chips, but to work around this in the analog way might result in more complex software (though much simpler hardware).

There are two kinds of PISOs that apply: 74HC165 and 74HC597 and there is no difference between them for your application - use the cheapest you can get (should be 30 cents or so).

In contrast to what I said some posts ago, it is not possible to ommit the latch strobe, as the shift-in has to be done in an orderly manner :-)

UltraMagnus

Quote
There are two kinds of PISOs that apply: 74HC165 and 74HC597 and there is no difference between them for your application


I thought I would add that you don't have to use the HC family either, most 74*165 or 74*597 chips should work, HCT, LS, AS, F, etc.

Graynomad

That is the general idea, but I don't recognize the pinout of the SRs, is that a real circuit?
Rob Gray aka the GRAYnomad www.robgray.com

2stl

What about the 74HC595 (US$2.00)? Because it's the only model that I can buy directly from a near physical store. Otherwise i'll have to wait for the shipping :(.

Thanks

Graynomad

#42
Aug 16, 2010, 04:11 pm Last Edit: Aug 16, 2010, 04:15 pm by graynomad Reason: 1
Quote
What about the 74HC595

Sorry, wrong acronym, the 595 is a SIPO (Serial In Parallel Out), you need a 165 or 597 as mentioned above.

EDIT: BTW can anyone actually find a 597, Farnell and digikey don't have any. Alldatasheet.com doesn't list it. It's got a much better pinout than the 165, all inputs on one side.

Rob Gray aka the GRAYnomad www.robgray.com

deSilva

#43
Aug 16, 2010, 04:34 pm Last Edit: Aug 16, 2010, 04:36 pm by mpeuser Reason: 1
Quote
most 74*165 or 74*597 chips should work, HCT, LS, AS, F, etc.

HCT true (but are more complex than HC types) the others: NO

Note that you have to power 30 chips. Only CMOS versions will reduce the power needed sufficiently enough. The general rule-of-thumb for such CMOS chips is:

40pF * Voltage squared * frequency used

(though it sounds funny, it's something one can explain  :-) )

For this applications <100 kHz is envisaged so we have
40p*100k*5*5 * 30 = 100 uA * 30 =3 mA
Which is extremely fine, other types will use the 10 to 100 fold current!

---
597 is readily available inGermany http://www.reichelt.de/?;ACTION=3;LA=444;GROUP=A2233;GROUPID=2932;ARTICLE=3426;START=0;SORT=artnr;OFFSET=16;SID=22DSqRNtS4ARYAAEgOVow6da6aadfbce95e7d26758f32da5dc99e

DigiKey has 25 for 15,06 USD http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=568-1486-5-ND which is astonishingly high..

UltraMagnus

so, it will need a lot more power using the ttl devices yes, but since it isn't being run off a battery that is hardly a concern.

farnell have the 597, but only in reels of 250 http://uk.farnell.com/texas-instruments/cd74hct597mt/logic-shift-reg-8bit-hs-16so-rl250/dp/1754346

Go Up