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

XMC™ Forum Discussions

Not applicable
hi everyone,

I am using xmc 4200 microcontroller in hexagonal application kit. I haven't seen any spi pins exposed to interface with my devices. I also saw in boards manual and there is no pins exposed even in ACT (satellite conductor). Please help me out to find spi pins or else give an idea to interface spi with other devices by multiplexing. If any multiplexing available, please give me an idea of doing it.
0 Likes
10 Replies
DRubeša
Employee
Employee
First solution authored First like received
Hi,

so you can use USIC module 0 channel 1 which is, for the mentioned board, connected to the following pins:
P2.4 (SCK)
P2.5 (MOSI)
P2.2 (MISO)
P2.3 (CS/SS)

and how to expose the pins so you can connect them to your slave device? Use pin extension board that is provided inside your Hexagon application kit.
http://www.infineon.com/cms/en/product/microcontroller/32-bit-industrial-microcontroller-based-on-ar...

Best regards,
Deni
0 Likes
Not applicable
Hi DRubesa,

I am using Dave 3.1.10. The examples which downloaded from library didn't have pin configurations(I had only 0.7,0.8 and 2 other pins) as u said. I also tried with your pin configurations by creating new projects(There I got your pin configs) and importing spi into it. But still I can't see any changes from SCLK and CS on oscilloscope. Please tell me how to correct it and get the clock signals at the port 2.4.


Thanks & Regards,
Suriya.
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
Hi Suriya,

can you please tell me if it´s mandatory for you to use DAVE 3? Do you have such a requirement or there is a chance of using DAVE 4. I´m asking that while it´s much easier to provide you with an example for DAVE 4.

Once you answer me this question, I will see how I can support you further.

Best regards,
Deni
0 Likes
Not applicable
Hi Deni,

Ya I also have Dave 4.3.2. I don't have working spi samples in that too. So please provide me the spi example for xmc4200 in version 4.

Additionally, I am going to use FreeRTOS in my complete process. There is no availability of FreeRTOS in version 4. So I preferred version 3. Please also provide FreeRTOS port if had.

Thanks & Regards,
Suriya.
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
Hi Suriya,

you have examples for both SPI and FreeRTOS as part of DAVE Project library. Go to "Help" -> "Install DAVE APP/Example/Device Libray..". Just in case disable option "Hide items that are already downloaded" (maybe you already have installed some examples in the past, so I want to be sure we start from a clean state). Select in "Work with" dropdown menu "DAVE Project Library Manager". Then select the XMC4500 series and you´ll find FreeRTOS example. Also, you can find SPI example using DAVE APPs.

Additionally, take a look at http://www.infineon.com/dgdl/Infineon-USIC-XMC1000_XMC4000-AP32303-AN-v01_00-EN.pdf?fileId=5546d4624... for some detailed description regarding USIC module and SPI specifically and finally, take a look at the given example code: http://www.infineon.com/dgdl/Infineon-USIC-XMC1000_XMC4000-AP32303_Example_Code-AN-v01_00-EN.exe?fil...

P.S I know you´re using XMC4200 instead of XMC4500 but there are mostly minor differences (pins that are used and maybe USIC module and channel).

Best regards,
Deni
0 Likes
Not applicable
Hi Deni,

Thanks for your support and help Deni. I did some changes in connectivity so that I can get the SCLK as well as Data in Dave version 3 itself. The pins you configured is absolutely perfect. Thanks.

Best Regards,
Suriya.
0 Likes
Not applicable
Hi Deni,

For my slave device, I have to give 10 clocks as leading delay and 3 clocks as trailing delay. I was unable to give that separately because in DAVE there will be configured as Lead trail delay in the same. Without this configuration, I can't able to read from my slave device. Please suggest me how to do this manually or else give me a different idea of getting those configuration.


Thanks & Regards,
Suriya
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
Hi Suriya,

from what I see it´s not possible to distinguish leading and trailing delay...they share the same XMCLib function call and the same register bitfield (BRG.DCTQ) is used for the calculation of both delays. However, I assume that 10 and 3 are MINIMAL values, not exact ones....meaning that you can try to set value 10 and then OK, trailing delay will be slightly bigger than it should be (a little bit slower baudrate but i´m pretty sure you don´t need to run it on the maximal speed), but I guess the slave device shouldn´t complain. Can you please tell me what is the slave device or give me the link to the reference manual, so I can take a look at the time diagram to verify my suspicions.

Best regards,
Deni
0 Likes
Not applicable
Hi Deni,

Thanks for your support. I still have some doubts on my slave device. But before that, I couldn't able to see clock and chip select signals while reading through SPI (SPI001_ReadData) and I was able to see those signals while writing (SPI001_WriteData). Still I am using Dave 3.1.10 and I also have 4.2.6. Actually you have shared some examples for SPI and FreeRTOS. Is that files are used for Dave 4.2.6 or Dave 4.3.2??

Thanks & Regards,
Suriya.
0 Likes
DRubeša
Employee
Employee
First solution authored First like received
Hi Suriya,

the examples that I provided are available through "DAVE Project Library Manager" on every DAVE version. However these examples are build long time ago so any version of DAVE4 will suffice. Your version (DAVE 4.3.2) is the newest version and all the examples will work under that version.

Regards,
Deni
0 Likes