0
Offline
Edison Member
Karma: 0
Posts: 1103
Arduino rocks
|
 |
« Reply #30 on: August 13, 2010, 06:57:39 pm » |
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...
|
|
|
|
|
Logged
|
|
|
|
|
England
Offline
Full Member
Karma: 0
Posts: 211
Arduino rocks
|
 |
« Reply #31 on: August 14, 2010, 01:09:33 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6815
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #32 on: August 14, 2010, 01:57:08 am » |
The ShiftOut is slow, it is NOT coded in assembly Then maybe it should be. There is no need to improve the speed Our posts crossed here so I was working on the 150uS. 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.
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 0
Posts: 1103
Arduino rocks
|
 |
« Reply #33 on: August 14, 2010, 05:49:09 am » |
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..
|
|
|
|
« Last Edit: August 14, 2010, 08:03:36 am by mpeuser »
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 0
Posts: 1103
Arduino rocks
|
 |
« Reply #34 on: August 14, 2010, 06:44:24 am » |
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.
|
|
|
|
« Last Edit: August 14, 2010, 06:45:11 am by mpeuser »
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6815
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #35 on: August 14, 2010, 07:20:32 am » |
This will need good PCB design.. Not to mention a BIG design  , Eagle free version won't handle it.
|
|
|
|
|
Logged
|
|
|
|
|
England
Offline
Full Member
Karma: 0
Posts: 211
Arduino rocks
|
 |
« Reply #36 on: August 14, 2010, 09:33:49 am » |
Not to mention a BIG design Smiley, Eagle free version won't handle it. or just protoboard and LOTS of wire. ;D
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 35
Arduino rocks
|
 |
« Reply #37 on: August 16, 2010, 07:21:00 am » |
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  . 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! 
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 0
Posts: 1103
Arduino rocks
|
 |
« Reply #38 on: August 16, 2010, 07:50:06 am » |
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 :-)
|
|
|
|
« Last Edit: August 16, 2010, 07:51:26 am by mpeuser »
|
Logged
|
|
|
|
|
England
Offline
Full Member
Karma: 0
Posts: 211
Arduino rocks
|
 |
« Reply #39 on: August 16, 2010, 08:20:34 am » |
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.
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6815
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #40 on: August 16, 2010, 08:40:00 am » |
That is the general idea, but I don't recognize the pinout of the SRs, is that a real circuit?
|
|
|
|
|
Logged
|
|
|
|
|
0
Offline
Newbie
Karma: 0
Posts: 35
Arduino rocks
|
 |
« Reply #41 on: August 16, 2010, 08:49:58 am » |
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
|
|
|
|
|
Logged
|
|
|
|
|
nr Bundaberg, Australia
Offline
Tesla Member
Karma: 71
Posts: 6815
Scattered showers my arse -- Noah, 2348BC.
|
 |
« Reply #42 on: August 16, 2010, 09:11:08 am » |
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.
|
|
|
|
« Last Edit: August 16, 2010, 09:15:00 am by graynomad »
|
Logged
|
|
|
|
|
0
Offline
Edison Member
Karma: 0
Posts: 1103
Arduino rocks
|
 |
« Reply #43 on: August 16, 2010, 09:34:46 am » |
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=22DSqRNtS4ARYAAEgOVow6da6aadfbce95e7d26758f32da5dc99eDigiKey has 25 for 15,06 USD http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&name=568-1486-5-ND which is astonishingly high..
|
|
|
|
« Last Edit: August 16, 2010, 09:36:27 am by mpeuser »
|
Logged
|
|
|
|
|
|
|
|