Go Down

Topic: chain from 3 x 74hc165 shiftin registers (Read 12105 times) previous topic - next topic

Black_Parrot

Anyone? Is there the way to use more then 2 input registers?

runaway_pancake

"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

graynomad

I've looked at that code 10 times and I can't see any reason it will work for 2 chips and not for 3. I would however change

Code: [Select]
      bytesVal |= (bitVal << ((DATA_WIDTH-1) - i));

which I think is unnecessarily complex and time-consuming to

Code: [Select]
bytesVal << 1;
bytesVal |= bitVal;
 

I can't see that has anything to do with the problem but code that's difficult to understand is always worth changing.

______
Rob
Rob Gray aka the GRAYnomad www.robgray.com

runaway_pancake

"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

musterstrasse

Hey Black_Parrot,

I just read your post and see some similarities to my post. Especially the case that two inputs fire the same time happens to me as well.  I do use two SN74HC165N daisy-chained.

Here is my story:
http://forum.arduino.cc/index.php?topic=222209.0

Let me know if you are making progress.
I will keep you posted.

Thanks,
Musterstrasse

runaway_pancake

Are we having fun yet?
Anybody need help here?
I worked out a sketch of my own, if anyone is interested - Reply.
(Didn't want to just go and cast pearls before... well, anyway.)
"Who is like unto the beast? who is able to make war with him?"
When all else fails, check your wiring!

Grumpy_Mike


I've looked at that code 10 times and I can't see any reason it will work for 2 chips and not for 3.

I am with Rob, he must have a hardware problem not a code issue.

Lord_Belenos

I found this solution to make the example found here  http://playground.arduino.cc/Code/ShiftRegSN74HC165N work with 3 or 4 chips: just change this line
Code: [Select]
byte bitVal;
found in the read_shift_regs() function into this one
Code: [Select]
long bitVal;
and it seems to work fine.
Hope it helps.

Go Up