Operating a parallel in / serial out shift register

Jun 20, 2006 6 Replies

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



What did you do with the clock inhibit pin?

--DF

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

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

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

gr.

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

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

gr.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required