Thanks, Bob. Very strange. I removed the wires and replaced them with other wires and carefully checked. No change. So I moved the project to the CY8CKIT-059 and I still have the same problem. Very strange. I will try to post a picture of my board with wiring in the morning. I am in -7 Universal Time.
Start with my project and step-by-step replace the internal wires with external pins and cable.
I am sure I made some simple dumb mistake I am not seeing. Bob, I took your project and removed each internal wire and replaced each with a I/O pin. Then I added physical wires to the board. I attached a jpg file showing: Photo of my 059 board with the little 0.1" (2.5mm) jumpers on the female headers of P0; Also, the board diagram from the Quick Start Guide; And the cydwr diagram. I used an Ohm meter to check continuity of the pin connections on the bottom of the board. They look good.
I added a LED after the while loop but we never arrive there. If I turn on the LED before the while statement, it lights. I have the same problem on the CY8CKIT-050 board so the problem must be in my PSoC Creator configuration. If anyone sees my mistake, please let me know. Otherwise I could open a case with Cypress.
I checked your project on PSoC Creator4.0 Update1 on CY8CKIT-050.
I only changed the port pin no. of Pin_LED_1 signal according to kit to P6_3.
The LED glowed as expected,I then even debugged the code and found everything is working as expected.When i debugged the code removing the sclk connection between master and slave ,the LED is not glowing(LED_write API is placed after the while loop in this case)
Thus,this appears as a hardware issue.
Thank you ANKS. Interesting. Two things I will try. When I unlock the SPI pins, Creator likes to place them on banks P3 and P12. I will try to use those pins. Second, I have a second 059 board to try.
I resolved the problem by unlocking the SPI pins from bank P0. I let Creator place them where it liked. It works now. The external wiring is messier but it works.
I connected :
m_mosi P3.7 to s_mosi P15.0
m_miso P12.1 to s_miso P12.3
m_sclk P3.5 to s_sclk P12.2
m_ss P15.3 to s_ss P15.1