Maker Pro
Maker Pro

Operating a parallel in / serial out shift register

Hi all,

I'm trying to get a 74hc165 to work.(datasheet:
http://www.farnell.com/datasheets/72353.pdf).
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:

<code>
// 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.
}
</code>



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


Thanks,
Greetings Roxlu
 
D

Deefoo

Jan 1, 1970
0
Hi all,

I'm trying to get a 74hc165 to work.(datasheet:
http://www.farnell.com/datasheets/72353.pdf).
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:

<code>
// 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.
}
</code>



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
 
Deefoo said:
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
 
D

Deefoo

Jan 1, 1970
0
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
 
Deefoo said:
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.
 
D

Deefoo

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

gr.

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
 
Deefoo said:
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.
 
Top