Cypress Perform

Home > Design Support > Cypress Developer CommunityTM > Cypress Forums > PSoC® 5 > Trying to drive SPI lines for STP1612PW05 chip

Bookmark and Share
Cypress Developer CommunityTM
Forums | Videos | Blogs | Training | Rewards Program | Community Components



Trying to drive SPI lines for STP1612PW05 chip
Moderator:
ANCY

Post Reply
Follow this topic



Trying to drive SPI lines for STP1612PW05 chip

Helmut posted on 27 Jun 2012 6:59 AM PST
Top Contributor
48 Forum Posts

 I'm trying to drive the SPI lines for a STP1612PW05 chip.  

My new board has the STP1612PW05 pins SDI, SDO, CLK, and LE connected to the PSoC5 pins for SPI_Master_v2_20 pins mosi, miso, sclk, and ss, respectively.

The STP1612PW05 datasheet at http://www.st.com/internet/com/TECHNICAL_RESOURCES/TECHNICAL_LITERATURE/DATASHEET/CD00237442.pdf 
describes on pages 13-15 a method of using the duration of LE high to identify the [type of] command being set over the data line.  I've never seen this done before and I'm not sure how to comply with this using the SPI_Master component.

Any and all help is greatly appreciated.

Here's how I perceive the situation, which could be right or wrong!  STP1612PW05 datasheet page 15 figure 6 shows how LE is high for 0 to 1 rising clock edge when one wants to perform the "Data Latch" command, but is high for 2 to 3 rising clock edges when one wants to perform the "Global Latch" command.  

I see no ability to do this in the SPI_Master.  Rather than connecting STP1612PW05 LE pin from SPI_Master ss pin, I think I need to drive STP1612PW05 LE pin explicitly myself.  Then, I'm wondering how do I then control both the width of the high LE pulse as well as the relative timing of it to the data coming out of the SPI_Master.  I'm sure hoping I won't have to totally hand code all the SPI stuff!  Furthermore, looking at the rest of figure 6, I'm not at all certain what the relative timing between LE and the data is supposed to be in general.

ARGH!




Re: Trying to drive SPI lines for STP1612PW05 chip

hli posted on 27 Jun 2012 11:08 AM PST
Top Contributor
675 Forum Posts

What comes to my mind is using a PWM for driving the LE signal. Configure the PWM to be "one shot with single trigger", and configure the trigger for falling edge. Then you can treigger the PWM with the SS signal from the SPIMaster component. Then you can, before you send out data, configure the PWM to exactly create the pulse you need (the best might be to use two outputs, and combine them with a XOR. That way you can exactly control when LE goes high, and when it goes low).



Re: Trying to drive SPI lines for STP1612PW05 chip

Helmut posted on 27 Jun 2012 12:20 PM PST
Top Contributor
48 Forum Posts

 genius.  thx.  I'll try it when my brain is working better than it is right now.  Jet lag remnants.



Re: Trying to drive SPI lines for STP1612PW05 chip

Helmut posted on 28 Jun 2012 10:10 AM PST
Top Contributor
48 Forum Posts

Please see http://www.cypress.com/?app=forum&id=2233&rID=64739



Re: Trying to drive SPI lines for STP1612PW05 chip

Helmut posted on 28 Jun 2012 01:26 PM PST
Top Contributor
48 Forum Posts

 hli, your technique is now working and I have just now successfully read the STP1612PW05 chip configuration registers, this being the most difficult (oddly formed timing) of the various commands.  Thanks!



Re: Trying to drive SPI lines for STP1612PW05 chip

hli posted on 28 Jun 2012 02:23 PM PST
Top Contributor
675 Forum Posts

Congratulations. I like when shooting out in the blue hits the target :)

But nonetheless I'm happy that you could use my idea. I think this again show the flexibilty of the PSoC (I don't think that it would work as easily with other MCUs - you either need to do bit-banging, or do some interrupt-driven stuff and hope the timing is right).






ALL CONTENT AND MATERIALS ON THIS SITE ARE PROVIDED "AS IS". CYPRESS SEMICONDUCTOR AND ITS RESPECTIVE SUPPLIERS MAKE NO REPRESENTATIONS ABOUT THE SUITABILITY OF THESE MATERIALS FOR ANY PURPOSE AND DISCLAIM ALL WARRANTIES AND CONDITIONS WITH REGARD TO THESE MATERIALS, INCLUDING BUT NOT LIMITED TO, ALL IMPLIED WARRANTIES AND CONDITIONS OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT OF ANY THIRD PARTY INTELLECTUAL PROPERTY RIGHT. NO LICENSE, EITHER EXPRESS OR IMPLIED, BY ESTOPPEL OR OTHERWISE, IS GRANTED BY CYPRESS SEMICONDUCTOR. USE OF THE INFORMATION ON THIS SITE MAY REQUIRE A LICENSE FROM A THIRD PARTY, OR A LICENSE FROM CYPRESS SEMICONDUCTOR.

Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Terms and Conditions of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Terms and Conditions of this site. Cypress Semiconductor and its suppliers reserve the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.

Spec No: None; Sunset Owner: GRAA; Secondary Owner: RAIK; Sunset Date: 01/01/20