Operating a parallel in / serial out shift register

Hi all,

I'm trying to get a 74hc165 to work.(datasheet:

formatting link
I'm operating it as follows, but I'm not sure if its correct because when I make one input high, I read the serial out like all inputs were high:

// Shift bits to register LOAD = low LOAD = high

for (i = 0; i < 8; i++) { CLOCK = low CLOCK = high

// Read DATA if (DATA == 1) set bit num i. }

Does anyone know why this is giving me all '1' when only one input is high?

Thanks, Greetings Roxlu

Reply to
diederickh
Loading thread data ...

What did you do with the clock inhibit pin?

--DF

Reply to
Deefoo

Hi,

I put it to gnd...I've added some resistors (10K) to A/H to gnd. Most of the data I read from the serial out is correct now.. 95%, though I want 100%.. Any suggestions?

Greetings

Reply to
diederickh

Just one shift register with clk, load & out connected to a microcontroller? Are the resistors from A-H to gnd supposed to be pull-down resistors because there are also switches to +5V? Ultra-simple program running that just reads the shift register or is it doing other things as well?

--DF

Reply to
Deefoo

Yes, it's just only that ulta-simple program. Though I'm also sending the result using rs-232/usart.

gr.

Reply to
diederickh

because

were

is

microcontroller?

because

You should analyse the errors you see. Do they occur randomly or only after flipping a switch (contact bouncing). Is the result shifted too much or not enough (noise/timing). You may have noise problems and your clock or load may not get through all the time. Or too much clocks. Put a bypass cap on the shift register. Does it work better if you make the clock & load strobes longer? Could it be possible that you are reading faster than that you are sending? Overwriting part of the output buffer?

--DF

Reply to
Deefoo

Thanks for the suggestions, I'm gonna try and I'll be back later.

gr.

Reply to
diederickh

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.