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 ....
 
What is confusing you? I know serial data streams are a bit confusing at first, but it is relatively simple..... Tell me your issues.
 
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:
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.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…