Brooke's World The life and ramblings of Brooke.

May 27, 2017

Testing SN74HC595 shift register with Bus Pirate

Filed under: Uncategorized — Brooke @ 4:54 pm

As part of the CE Header project from the CE Skills course , we have a shift register on the SensorBoard. This chip allows us to light up 8 LEDs ( more with chip chaining ) with 3 pins.  I used a Bus Pirate (Dangerous Prototypes) and probes, from Seeed Studio, to iteratively poke at it until I understood how to talk to it via SPI.

I used a DIP version of the chip in a breadboard and wired it up to the Bus Pirate.  The LEDs are in the breadboard to see it working. Please note, the cable and connectors in the image below are from the Seeed probe cable. Some of the other probe cables have the colors in a different order on the connectors.

I used putty to connect to the Bus Pirate via a mini usb cable.

Note: If you decide to hook this up to an Arduino for testing, using an example sketch, here are the pins to use for your reference:

BP MOSI=pin 11
BP CLK=pin 12
BP CS=pin 8

Command What it does
Initalize the Bus Pirate
M 5 1 1 2 1 2 2
  • Mode SPI
  • Speed 30khz
  • Clock: Idle low *default
  • Output clock edge: Active to idle *default
  • Input sample phase: Middle *default
  • CS: /CS *default, Output Type: Normal (H=3.3V, L=GND)

Make sure the mode number you use is for SPI

W Turn on power, don’t forget this.  If you try to access the FRAM chip before this, you will likely hang the Bus Pirate and have to unplug/plug,setup.

 

Command What it does Output
Turn on output pins
[ 0b00000001 ] Turn on LEDs.  Bit 1 is QA and bit 8 is QH.
QH QG QF QE QD QC QB QA
               
0 0 0 0 0 0 0 1
[ 0b10000000 ] Turn on LEDs
QH QG QF QE QD QC QB QA
               
1 0 0 0 0 0 0 0
[ 0b10101010 ] Turn on LEDs
QH QG QF QE QD QC QB QA
               
1 0 1 0 1 0 1 0
[ 0b00000000 ] Turn all LEDs off
QH QG QF QE QD QC QB QA
               
0 0 0 0 0 0 0 0

 

Looking from the right side

Looking from the left

 

 

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment

You must be logged in to post a comment.

Powered by WordPress