Attachments are accessible only for community members.
Sep 27, 2019
12:32 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 27, 2019
12:32 AM
I'm trying to interface external flash via SPI communication with XMC4800,.
I'm using U1C1
P0_12_CE, P0_13_SCLK, P3_15_MOSI, P3_15_MISO.
Doing just simple full duplex communication as SPI master. and trying to write & read data on external flash(SST26VF064B).
Few days ago I received a code but that was quard SPI and also PIN was different. I did some changes accordingly but it's not working clock is not coming. Please help me and do the changes in main.c (attachment) file according to the given data and reply.
In case of any problem please reply.
Plaese reply @ infineon
I'm using U1C1
P0_12_CE, P0_13_SCLK, P3_15_MOSI, P3_15_MISO.
Doing just simple full duplex communication as SPI master. and trying to write & read data on external flash(SST26VF064B).
Few days ago I received a code but that was quard SPI and also PIN was different. I did some changes accordingly but it's not working clock is not coming. Please help me and do the changes in main.c (attachment) file according to the given data and reply.
In case of any problem please reply.
Plaese reply @ infineon
5 Replies
Sep 29, 2019
09:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 29, 2019
09:54 PM
@Infineon Please support me in solving this problem.
Sep 30, 2019
01:51 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 30, 2019
01:51 AM
@Infineon I have done some changes in main.c file (which you have send ) but the issue is i thing there is some error in configuring the SPI PINs. Please update the given main fine according to he pin descriptions.
Some changes I did in the file you gave me according to my hardware, please very this (I guess there is doubt is in MISO):
void SPI_init(){
XMC_SPI_CH_Init(XMC_SPI1_CH1, &spi_config);
XMC_SPI_CH_SetInputSource(XMC_SPI1_CH1, XMC_SPI_CH_INPUT_DIN0, USIC1_C1_DX0_DOUT0);
XMC_SPI_CH_SetInputSource(XMC_SPI1_CH1, XMC_SPI_CH_INPUT_DIN1, USIC1_C1_DX3_DOUT1);
XMC_SPI_CH_SetInputSource(XMC_SPI1_CH1, XMC_SPI_CH_INPUT_DIN2, USIC1_C1_DX4_DOUT2);
XMC_SPI_CH_SetInputSource(XMC_SPI1_CH1, XMC_SPI_CH_INPUT_DIN3, USIC1_C1_DX5_DOUT3);
XMC_GPIO_SetOutputStrength(SPI_SIO0, XMC_GPIO_OUTPUT_STRENGTH_STRONG_MEDIUM_EDGE);
XMC_GPIO_SetOutputStrength(SPI_SCLK, XMC_GPIO_OUTPUT_STRENGTH_STRONG_MEDIUM_EDGE);
XMC_GPIO_SetOutputStrength(SPI_CE, XMC_GPIO_OUTPUT_STRENGTH_STRONG_MEDIUM_EDGE);
XMC_GPIO_SetHardwareControl(SPI_SIO0, P3_15_HWCTRL_U1C1_DOUT0);
XMC_GPIO_SetHardwareControl(SPI_SOO0, P3_14_HWCTRL_U1C1_DOUT1);
XMC_SPI_CH_SetBitOrderMsbFirst(XMC_SPI1_CH1);
XMC_SPI_CH_SetWordLength(XMC_SPI1_CH1, 8);
XMC_SPI_CH_SetFrameLength(XMC_SPI1_CH1, 64);
XMC_SPI_CH_ConfigureShiftClockOutput(XMC_SPI1_CH1, XMC_SPI_CH_BRG_SHIFT_CLOCK_PASSIVE_LEVEL_1_DELAY_DISABLED, XMC_SPI_CH_BRG_SHIFT_CLOCK_OUTPUT_SCLK);
XMC_SPI_CH_Start(XMC_SPI1_CH1);
XMC_SPI_CH_EnableMasterClock(XMC_SPI1_CH1);
XMC_GPIO_SetHardwareControl(SPI_SCLK, XMC_GPIO_HWCTRL_DISABLED);
XMC_GPIO_SetMode(SPI_SCLK, XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT2 | P0_13_AF_U1C1_SCLKOUT);
XMC_GPIO_SetMode(SPI_SIO0, XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT2 | P3_15_AF_U1C1_DOUT0);
XMC_GPIO_SetOutputLow(SPI_CE);
XMC_GPIO_SetMode(SPI_CE, XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
}
Thanks
Some changes I did in the file you gave me according to my hardware, please very this (I guess there is doubt is in MISO):
void SPI_init(){
XMC_SPI_CH_Init(XMC_SPI1_CH1, &spi_config);
XMC_SPI_CH_SetInputSource(XMC_SPI1_CH1, XMC_SPI_CH_INPUT_DIN0, USIC1_C1_DX0_DOUT0);
XMC_SPI_CH_SetInputSource(XMC_SPI1_CH1, XMC_SPI_CH_INPUT_DIN1, USIC1_C1_DX3_DOUT1);
XMC_SPI_CH_SetInputSource(XMC_SPI1_CH1, XMC_SPI_CH_INPUT_DIN2, USIC1_C1_DX4_DOUT2);
XMC_SPI_CH_SetInputSource(XMC_SPI1_CH1, XMC_SPI_CH_INPUT_DIN3, USIC1_C1_DX5_DOUT3);
XMC_GPIO_SetOutputStrength(SPI_SIO0, XMC_GPIO_OUTPUT_STRENGTH_STRONG_MEDIUM_EDGE);
XMC_GPIO_SetOutputStrength(SPI_SCLK, XMC_GPIO_OUTPUT_STRENGTH_STRONG_MEDIUM_EDGE);
XMC_GPIO_SetOutputStrength(SPI_CE, XMC_GPIO_OUTPUT_STRENGTH_STRONG_MEDIUM_EDGE);
XMC_GPIO_SetHardwareControl(SPI_SIO0, P3_15_HWCTRL_U1C1_DOUT0);
XMC_GPIO_SetHardwareControl(SPI_SOO0, P3_14_HWCTRL_U1C1_DOUT1);
XMC_SPI_CH_SetBitOrderMsbFirst(XMC_SPI1_CH1);
XMC_SPI_CH_SetWordLength(XMC_SPI1_CH1, 8);
XMC_SPI_CH_SetFrameLength(XMC_SPI1_CH1, 64);
XMC_SPI_CH_ConfigureShiftClockOutput(XMC_SPI1_CH1, XMC_SPI_CH_BRG_SHIFT_CLOCK_PASSIVE_LEVEL_1_DELAY_DISABLED, XMC_SPI_CH_BRG_SHIFT_CLOCK_OUTPUT_SCLK);
XMC_SPI_CH_Start(XMC_SPI1_CH1);
XMC_SPI_CH_EnableMasterClock(XMC_SPI1_CH1);
XMC_GPIO_SetHardwareControl(SPI_SCLK, XMC_GPIO_HWCTRL_DISABLED);
XMC_GPIO_SetMode(SPI_SCLK, XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT2 | P0_13_AF_U1C1_SCLKOUT);
XMC_GPIO_SetMode(SPI_SIO0, XMC_GPIO_MODE_OUTPUT_PUSH_PULL_ALT2 | P3_15_AF_U1C1_DOUT0);
XMC_GPIO_SetOutputLow(SPI_CE);
XMC_GPIO_SetMode(SPI_CE, XMC_GPIO_MODE_OUTPUT_PUSH_PULL);
}
Thanks
Sep 30, 2019
05:22 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 30, 2019
05:22 AM
Hi,
Have a look at https://www.infineonforums.com/threads/5823-XMC4500-Relax-Kit-SPI-FLASH-MEMORY?p=23832&viewfull=1#po...
Regards,
Jesus
Have a look at https://www.infineonforums.com/threads/5823-XMC4500-Relax-Kit-SPI-FLASH-MEMORY?p=23832&viewfull=1#po...
Regards,
Jesus
Sep 30, 2019
09:54 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sep 30, 2019
09:54 PM
First of thanks for replying.
After trying with that main.c file only I asked you for little change in the code according to my pin configuration and SPI full duplex mode(U1C1). Reason why I have attached the SPI_init() function just tell me that MOSI and MISO pin configuration is correct or not, if not then what would be correct on.
Thanks
After trying with that main.c file only I asked you for little change in the code according to my pin configuration and SPI full duplex mode(U1C1). Reason why I have attached the SPI_init() function just tell me that MOSI and MISO pin configuration is correct or not, if not then what would be correct on.
Thanks
Oct 03, 2019
02:25 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 03, 2019
02:25 AM
Hi,
I don't know if it is relevant to your problem but I discovered a bug in the Infineon SPI001 library function 'SPI001_Configure()' which incorrectly changes I/O pin configurations and can prevent the SPI from working. I wrote my own version of the 'SPI001_Configure()' function as a work-around.
Best regards
I don't know if it is relevant to your problem but I discovered a bug in the Infineon SPI001 library function 'SPI001_Configure()' which incorrectly changes I/O pin configurations and can prevent the SPI from working. I wrote my own version of the 'SPI001_Configure()' function as a work-around.
Best regards