Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

74HC165 serial register reading with perl

by rkrasowski (Sexton)
on Jun 18, 2018 at 18:55 UTC ( [id://1216878]=perlquestion: print w/replies, xml ) Need Help??

rkrasowski has asked for the wisdom of the Perl Monks concerning the following question:

Hi Perl Monks, that may be the silly question. I am trying to read data from 74HC165 which is PISO serial register. How effective (fast) would be to read it using Perl? Any code examples? Thanks like always Robert
  • Comment on 74HC165 serial register reading with perl

Replies are listed 'Best First'.
Re: 74HC165 serial register reading with perl
by stevieb (Canon) on Jun 18, 2018 at 19:15 UTC

    Is this for a Raspberry Pi? My RPi::WiringPi handles this shift register if on a Pi. See that linked documentation and associated FAQ for full details:

    use RPi::WiringPi; use RPi::Const qw(:all); my $pi = RPi::WiringPi->new; my ($base, $num_pins, $data, $clk, $latch) = (100, 8, 5, 6, 13); $pi->shift_register( $base, $num_pins, $data, $clk, $latch ); # now we can access the new 8 pins of the # register commencing at new pin 100-107 for (100..107){ my $pin = $pi->pin($_); $pin->write(HIGH); }

    Update: Whoops, I misread the IC device number. My code is for a 74HC595 (output) not a 74HC165 (input). Sorry for the noise.

      Thanks, will check module tomorrow and let you know how things are. Now I know where to start. I ordered PCB and 74HC165, expect to get it on few days. Will try real example at that time. Thanks Robert
Re: 74HC165 serial register reading with perl
by haukex (Archbishop) on Jun 18, 2018 at 18:59 UTC

    How is this IC connected to the system? If you're working on a Raspberry Pi, you might want to look at stevieb's RPi:: series of modules, which includes RPi::SPI, RPi::Serial, and RPi::WiringPi.

    Update: Fixed missing links.

      Thanks haukex, unfortunately after I posted I realized that the IC in question here is parallel input, where I have only got code for the parallel output register.

      I'll put this chip on my list now though.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1216878]
Approved by haukex
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others about the Monastery: (5)
As of 2024-04-19 16:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found