cy7c63813-pxc SPIM help for using SSEL output

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
Anonymous
Not applicable

Hi, I'm new onPSOC MiniProg stuf.

   

I have some difficulty to use my chip cy7c6313 for SPIM communication.
My problem is to change state of PORT_1_3.
I have check the state of this pin with my oscilloscope, and there is no change to low state or high state.

   

P1[3] config is set to :
SSEL, 5V SSEL, Push/Pull, DisableInt

   

in my main.c program, i have make this :

   

#include "appconfig.h"
 #include <m8c.h>
#define TIME_DELAY {for(i=30000; i>0; i--);}
WORD i;
CHAR Message[] = "Hello SPI Slave";
#define SS 0x8;

   

void main( void )
{

   

  SPIM_Start();
  P13CR |= 0x01;
  P1DATA |= SS;
  BYTE bIndex;
  SPIM_SetMOSI(SPIM_MOSI_P15);
  P13CR &= ~0x01;
  P1DATA  &= ~SS;
  bIndex = 0;
  TIME_DELAY;
  while (bIndex < sizeof(Message))
   {

   

    Message[bIndex] = SPIM_bIO(Message[bIndex]);
    bIndex++;
    TIME_DELAY; // Insert a user provided function here to make delay

   

  }
  P1DATA |= SS;   
  P13CR |= 0x01;

   

}

   

What do you think of that ? somthing wrong ?
Are you need more information to help me ?

   

Nicolas. French user.

0 Likes
5 Replies
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Possibly you need to use shadow registers ?

   

 

   

    

   

          

   

https://www.youtube.com/watch?v=tei6q5M3C0g       Shadow Registers

   

http://www.cypress.com/?rID=39497     Shadow Registers

   

 

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

I don't have shadows registers module aviable for this chip.

   

 

   

I have make a test for check, and no best result... in the main loop.

   

                                                                            BYTE Port_1_Data_SHADEs;

   

                                                                            BYTE bIndex;

                                                                            SPIM_SetMOSI(SPIM_MOSI_P15); // Set MOSI pin to P1.5
                                                                            Port_1_Data_SHADEs &= ~0x08;
                                                                            P1DATA = Port_1_Data_SHADEs;

                                                                            bIndex = 0;
                                                                            TIME_DELAY;
                                                                            while (bIndex < sizeof(Message))
                                                                            {
                                                                            // Send the whole message by loading the every next byte into TX buffer
                                                                            // Replace the transmitted byte with the received one from other SPI device
                                                                            Message[bIndex] = SPIM_bIO(Message[bIndex]);
                                                                            bIndex++;
                                                                            TIME_DELAY; // Insert a user provided function here to make delay
                                                                            }

                                                                            Port_1_Data_SHADEs |= 0x08;
                                                                            P1DATA = Port_1_Data_SHADEs;

0 Likes
ETRO_SSN583
Level 9
Level 9
250 likes received 100 sign-ins 5 likes given

Post the project so the overall setup can be examined -

   

 

   

    

   

          

   

“File”                                                           Designer

   

“Archive Project”

   

 

   

Regards, Dana.

0 Likes
Anonymous
Not applicable

here the simplified project :

   

drive.google.com/file/d/0B7QVnVacIrMwSjZDYmRuWXpkNHc/view

0 Likes
Anonymous
Not applicable

Ok problem solve.

0 Likes