Not applicable
Jul 01, 2013
10:36 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 01, 2013
10:36 AM
Hi
For a schoolproject I use a XMC4500 relax kit and I want to communicate with a FPGA over SPI.
I use the SPI001 [1.0.16] app from DAVE and it works great, the XMC4500 as master and the FPGA as slave.
But now I want to use 2 FPGA's, so I need to switch between 2 slaves. Therefor I want to use 2 chip select lines.
So I set number of chip select lines on 2. But if I want to write data, how do I set the right chip select line? Or how could I switch between the 2 chip select lines.
Or should I take an other SPI001_handle?
But then I couldn't assign the right pins to it, for the MTSR I only can choose between P2.5 and P3.5. and I could find these on the board.
What should I do?
Kind regards,
Jeroen
For a schoolproject I use a XMC4500 relax kit and I want to communicate with a FPGA over SPI.
I use the SPI001 [1.0.16] app from DAVE and it works great, the XMC4500 as master and the FPGA as slave.
But now I want to use 2 FPGA's, so I need to switch between 2 slaves. Therefor I want to use 2 chip select lines.
So I set number of chip select lines on 2. But if I want to write data, how do I set the right chip select line? Or how could I switch between the 2 chip select lines.
Or should I take an other SPI001_handle?
But then I couldn't assign the right pins to it, for the MTSR I only can choose between P2.5 and P3.5. and I could find these on the board.
What should I do?
Kind regards,
Jeroen
- Tags:
- chip select
- IFX
- spi
3 Replies
Not applicable
Jul 02, 2013
12:53 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jul 02, 2013
12:53 AM
Hi Jeroen,
For the Apps configuration, just input "2" for "Number of Chip Select Lines" in "SPI001_Configuration" tab. Then you are able to do Manual Pin Assignment for ChipSelectA & B. In order to active the corresponding chip select lines, you need to write to PCR.SELO by yourself in main.c. Do have a try...
Best regards,
Zain
For the Apps configuration, just input "2" for "Number of Chip Select Lines" in "SPI001_Configuration" tab. Then you are able to do Manual Pin Assignment for ChipSelectA & B. In order to active the corresponding chip select lines, you need to write to PCR.SELO by yourself in main.c. Do have a try...
Best regards,
Zain
Not applicable
May 26, 2015
04:13 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 26, 2015
04:13 AM
Hi,
I am working with the same kit. Now I connect two external DAC-Converter to the Relax Light Kit via SPI (SPI001 App).
So I generated an Interrupt where I send the new data to the converters. This works and the data is transmitted correct, but
always the CS A line is going down to ground while the data is transmitted...
My code:
int ERU_ISR(void){
SendData_3 |= Mask_A;
SPI001_WriteData(&SPI001_Handle0,&SendData_3,SPI001_STANDARD);
//Switch from CS A to CS B?
SendData_4 |= Mask_B;
SPI001_WriteData(&SPI001_Handle0,&SendData_4,SPI001_STANDARD);
return 0;
}
So the question is:
How can I easily switch the Chip Selct Lines?
Best regards,
misisp
I am working with the same kit. Now I connect two external DAC-Converter to the Relax Light Kit via SPI (SPI001 App).
So I generated an Interrupt where I send the new data to the converters. This works and the data is transmitted correct, but
always the CS A line is going down to ground while the data is transmitted...
My code:
int ERU_ISR(void){
SendData_3 |= Mask_A;
SPI001_WriteData(&SPI001_Handle0,&SendData_3,SPI001_STANDARD);
//Switch from CS A to CS B?
SendData_4 |= Mask_B;
SPI001_WriteData(&SPI001_Handle0,&SendData_4,SPI001_STANDARD);
return 0;
}
So the question is:
How can I easily switch the Chip Selct Lines?
Best regards,
misisp
Not applicable
May 26, 2015
11:58 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 26, 2015
11:58 PM
Hi misisp,
Have you tried to set the frame length to the max. 64 and see the effect?
BR,
Zain
Have you tried to set the frame length to the max. 64 and see the effect?
BR,
Zain