Hi there guys,
I have a absolute shaft encoder for position sensing.
It's the EAW version:
I'm fast running out of I/O on my micro and can't spare 8 pins - so this means I need to do something smart to lower my pin counts.
Been looking at the 74HC165 and 74HC166 which are 8 bit parallel-in/serial-out shift register.
The difference between them is that:
165 is asynchronous 166 is synchronousWhat I want to do is:
- get the 8 bit data from the encoder
- send it to the micro
- during the sending, the encoder data could change, but I want it ignored until all the data is sent.
- when sending has completed, new data is then latched into the register again and the process is repeated.
So my question is, what's the difference between the 165 and 166 and more importantly, which one will do what I described above?
My program algorithm would read:
- latch the register to get the 8 bit data from the encoder
- enable serial reading on the 74HC16X
- pulse clock (rising edge)
- read serial data
- goto step 3 until all 8 bit has been read
- disable serial reading 74HC16X
- convert serial data to something useful for my application
- repeat the process again.
Hope that make sense guys. Appreciate any help on deciding which register I should use (165 or 166)??!!
Cheers