Feb 11, 2014
04:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 11, 2014
04:08 AM
Hello
(XMC4500 Relax Kit)
I tried to change the CS of 2 SPI001 Controlls. Basically it works but I get the Problem that when I change the CS with the following commands both CS go to zero at the same time for a moment. (Including MTRS)
Is there anything I'm doing wrong? This behavior is very evil for may SPI devices.
best regards,
Michael Grassl
(XMC4500 Relax Kit)
I tried to change the CS of 2 SPI001 Controlls. Basically it works but I get the Problem that when I change the CS with the following commands both CS go to zero at the same time for a moment. (Including MTRS)
SPI001_Handle0.Config->CESelected = CE_B;
SPI001_Configure(&SPI001_Handle0,SPI001_Handle0.Config);
SPI001_Handle1.Config->CESelected = CE_B;
SPI001_Configure(&SPI001_Handle1,SPI001_Handle0.Config);
Is there anything I'm doing wrong? This behavior is very evil for may SPI devices.
best regards,
Michael Grassl
6 Replies
Feb 11, 2014
06:45 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 11, 2014
06:45 AM
A quick Solution for me was to config the PCR register in a separat function. Hope it helps somebody out.
So there is only one question. Since Dave/XMC4500 supports multislave SPI out of the box what is the way dave developers will change CS?
Best regards,
Michael
void xmc4500_switch_cs(const SPI001_HandleType* Handle, uint8_t CESelected)
{
USIC_CH_TypeDef* USICRegs = Handle->USICRegs;
USICRegs->PCR_SSCMode &= (~(uint32_t)(USIC_CH_PCR_SSCMode_SELO_Msk));
USICRegs->PCR_SSCMode |= (((((uint32_t)0x01 << Handle->ChipSelTable[CESelected]) << USIC_CH_PCR_SSCMode_SELO_Pos) & USIC_CH_PCR_SSCMode_SELO_Msk));
}
So there is only one question. Since Dave/XMC4500 supports multislave SPI out of the box what is the way dave developers will change CS?
Best regards,
Michael
Not applicable
Feb 18, 2014
01:41 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Feb 18, 2014
01:41 AM
Hi Michael,
Thank you very much for the feedback. This is a known issue and will be fixed in the future release (eTicket 241497566).
Best regards,
Sophia
Thank you very much for the feedback. This is a known issue and will be fixed in the future release (eTicket 241497566).
Best regards,
Sophia
Not applicable
Mar 10, 2015
08:07 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 10, 2015
08:07 AM
Is this already corrected? Because when I look in SPI001_Conf.c there is nothing that shows to which pin my ChipSelectA is connected to.
I manually assigned pin 0.2 to ChipSelectA. But this is my SPI001_Conf.c:
SPI001_ConfigType SPI001_Config0 =
{
.Mode = SPI001_STANDARD_FULLDUPLEX,/* SPI Mode */
.HBMode = SPI001_MSB, /* Transmit LSB/MSB */
.ClkPol = SPI001_CLK_POL0, /* Clock Polarity */
.ClkPh = SPI001_CLK_PHASE0, /* Clock Phase */
.BaudRate = (uint32_t) 100000,/* Baud Rate */
.LeadTrailDelay = SPI001_ONE_SCLK_PERIOD,/* Leading/TrailingDelay */
.NextFrameDelay = SPI001_ONE_SCLK_PERIOD,/* NextFrameDelay */
.WordLen = (uint8_t) 16,/* Wordlength */
.FrameLen = (uint8_t) 16,/* Framelength */
.CESelected = (uint8_t) CE_A /* Default Chip Select line selection */
};
SPI001_PinHandleType SPI001_PinHandle0 =
{
.Port_Num = {(uint8_t) 0, (uint8_t) 0, (uint8_t) 0, (uint8_t) 0},
.Pin_Num = {(uint8_t) 1, (uint8_t) 0,(uint8_t) 0, (uint8_t) 0},
/* Pin Port Base Address */
.PinPortRegs = {(SPI001_PORTS_TypeDef*)PORT0_BASE,
(SPI001_PORTS_TypeDef*)PORT0_BASE,
(SPI001_PORTS_TypeDef*)PORT0_BASE,
(SPI001_PORTS_TypeDef*)PORT0_BASE
},
.MRST_DSEL = (uint8_t) 3, /* DSEL Value */
.MTSR_IOCR = (uint8_t) 2 /* IOCR_PCR value */
};
const SPI001_HandleType SPI001_Handle0 =
{
.USICRegs = USIC1_CH1, /* Usic Channel offset value */
.FrmEndMode = SPI001_ENABLE_FEM,/* Frame End mode Selection*/
.Config = &SPI001_Config0,
.NoOfCS = (uint8_t) 1, /* No of ChipSelect line */
.ChipSelTable = {(uint8_t) 1, (uint8_t) 0, (uint8_t) 0, (uint8_t) 0,
(uint8_t) 0, (uint8_t) 0, (uint8_t) 0, (uint8_t) 0
},
.TxLimit = (uint8_t) 1,/* FIFO Tigger Level */
.RxLimit = (uint8_t) 1,/* FIFO Tigger Level */
.TxFifoSize = (uint8_t) 4,/* Tx FIFO Size */
.RxFifoSize = (uint8_t) 4,/* Rx FIFO Size */
.MSLSIntrEn = (bool) 0,/* MSLS Event enable */
.PinHandle = &SPI001_PinHandle0
};
I'm working with DAVE3.1.10 and SPI001[1.0.24].
I manually assigned pin 0.2 to ChipSelectA. But this is my SPI001_Conf.c:
SPI001_ConfigType SPI001_Config0 =
{
.Mode = SPI001_STANDARD_FULLDUPLEX,/* SPI Mode */
.HBMode = SPI001_MSB, /* Transmit LSB/MSB */
.ClkPol = SPI001_CLK_POL0, /* Clock Polarity */
.ClkPh = SPI001_CLK_PHASE0, /* Clock Phase */
.BaudRate = (uint32_t) 100000,/* Baud Rate */
.LeadTrailDelay = SPI001_ONE_SCLK_PERIOD,/* Leading/TrailingDelay */
.NextFrameDelay = SPI001_ONE_SCLK_PERIOD,/* NextFrameDelay */
.WordLen = (uint8_t) 16,/* Wordlength */
.FrameLen = (uint8_t) 16,/* Framelength */
.CESelected = (uint8_t) CE_A /* Default Chip Select line selection */
};
SPI001_PinHandleType SPI001_PinHandle0 =
{
.Port_Num = {(uint8_t) 0, (uint8_t) 0, (uint8_t) 0, (uint8_t) 0},
.Pin_Num = {(uint8_t) 1, (uint8_t) 0,(uint8_t) 0, (uint8_t) 0},
/* Pin Port Base Address */
.PinPortRegs = {(SPI001_PORTS_TypeDef*)PORT0_BASE,
(SPI001_PORTS_TypeDef*)PORT0_BASE,
(SPI001_PORTS_TypeDef*)PORT0_BASE,
(SPI001_PORTS_TypeDef*)PORT0_BASE
},
.MRST_DSEL = (uint8_t) 3, /* DSEL Value */
.MTSR_IOCR = (uint8_t) 2 /* IOCR_PCR value */
};
const SPI001_HandleType SPI001_Handle0 =
{
.USICRegs = USIC1_CH1, /* Usic Channel offset value */
.FrmEndMode = SPI001_ENABLE_FEM,/* Frame End mode Selection*/
.Config = &SPI001_Config0,
.NoOfCS = (uint8_t) 1, /* No of ChipSelect line */
.ChipSelTable = {(uint8_t) 1, (uint8_t) 0, (uint8_t) 0, (uint8_t) 0,
(uint8_t) 0, (uint8_t) 0, (uint8_t) 0, (uint8_t) 0
},
.TxLimit = (uint8_t) 1,/* FIFO Tigger Level */
.RxLimit = (uint8_t) 1,/* FIFO Tigger Level */
.TxFifoSize = (uint8_t) 4,/* Tx FIFO Size */
.RxFifoSize = (uint8_t) 4,/* Rx FIFO Size */
.MSLSIntrEn = (bool) 0,/* MSLS Event enable */
.PinHandle = &SPI001_PinHandle0
};
I'm working with DAVE3.1.10 and SPI001[1.0.24].
Not applicable
Mar 11, 2015
02:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 11, 2015
02:49 AM
Hi,
It has been fixed in DAVE v4 already. Would you pls try SPI_MASTER App in DAVE v4?
Best regards,
Sophia
It has been fixed in DAVE v4 already. Would you pls try SPI_MASTER App in DAVE v4?
Best regards,
Sophia
Not applicable
Mar 11, 2015
07:58 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 11, 2015
07:58 AM
Hi,
Yes, but I am using Dave 3. Is there a solution for this problem? Because I need to assign 8 different pins to the ChipSelects
Yes, but I am using Dave 3. Is there a solution for this problem? Because I need to assign 8 different pins to the ChipSelects
Not applicable
Mar 12, 2015
12:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mar 12, 2015
12:56 AM
Hi,
You can use the workaround provided in eTicket 241497566 which uses SPI001_Configure () API with input "SPIConfig.CESelected" to change the chip select.
BTW, you can find the corresponding ChipSelect pin from Resource Mapping Reports (by clicking "Resource Mapping Information" button in the tool bar). The port pin configuration can be found in MULTIPLEXER.c DAVE_MUX_Init().
Best regards,
Sophia
You can use the workaround provided in eTicket 241497566 which uses SPI001_Configure () API with input "SPIConfig.CESelected" to change the chip select.
BTW, you can find the corresponding ChipSelect pin from Resource Mapping Reports (by clicking "Resource Mapping Information" button in the tool bar). The port pin configuration can be found in MULTIPLEXER.c DAVE_MUX_Init().
Best regards,
Sophia