Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Interfacing shift register with pic micro using spi

Status
Not open for further replies.

Varunme

Member
How can i transfer spi data from a pic to a shift register ?
shift register to use is 74HC595.

spi data is ,

SPI1_Write(0b10100111);

I dont which pin to be high and which pin to be low to quick transfer of data.
and how much delay to be used, and ....
 
Presuming you have the SPI serial output working with your SPI1_Write(0b10100111) command. You want to setup for SPI MODE 0,0. The MCU SPI clock line connects to SHCP/STCP shift-register inputs, the MCU SPI data line connects to the DS shift-register input, and you need an additional MCU I/O pin which will connect to /OE shift-register input. Before sending the the SPI1_Write command, bring the /OE line low, and once the SPI1_Write command is finished bring the /OE line high. Something as follows...

- Setup SPI Mode for 0,0 (CPOL=0, CPHA=0)
- Bring /OE line low
- Send SPI1_Write command
- Bring /0E line high
 
nice languer ,

is there a need for delay to be given to get the spi write command to be finished ?
 
Last edited:
For 74HC595,

which pins have to be high and which pin other than OE have to be low ? to get the data transfer done ?

Dont understand the SH_CP and ST_CP.
 
For 74HC595,

which pins have to be high and which pin other than OE have to be low ? to get the data transfer done ?

Dont understand the SH_CP and ST_CP.


how can i delete this double post ?
 
Last edited:
You can certainly get these from the datasheet. Go ahead and read it, and really put forth the effort to understand it. But here is one on the SHCP & STCP:
Data is shifted on the positive-going transitions of the shift register clock input (SHCP). The data in each register is transferred to the storage register on a positive-going transition of the storage register clock input (STCP). If both clocks are connected together, the shift register will always be one clock pulse ahead of the storage register.
Simply, unless you need the separate clocks, you can tie them together. All it means is the outputs are delayed by on clock cycle.
 
Status
Not open for further replies.

Latest threads

Back
Top