- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Post the project so the overall setup can be examined -
“File” Designer
“Archive Project”
Regards, Dana.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Ok problem solve.