PDA

View Full Version : spi pins not exposed in xmc 4200



leosuriya
Nov 20th, 2016, 09:48 AM
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.

DRubeša
Nov 22nd, 2016, 07:06 AM
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-arm-registered-cortex-registered-m/32-bit-xmc4000-industrial-microcontroller-arm-registered-cortex-registered-m4/evaluation-boards/KIT_XMC4X_UNI_EXT01_001/productType.html?productType=db3a304433b8a4100133d af9e260112c

Best regards,
Deni

leosuriya
Nov 24th, 2016, 03:23 AM
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.

DRubeša
Nov 24th, 2016, 05:55 AM
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

leosuriya
Nov 24th, 2016, 10:14 PM
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.

DRubeša
Nov 25th, 2016, 05:03 AM
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=5546d4624e765da5014ed93960ae3391 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?fileId=5546d4624e765da5014ed94b13903518&sd=t

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

leosuriya
Nov 25th, 2016, 08:19 PM
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.

leosuriya
Nov 29th, 2016, 11:07 PM
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

DRubeša
Nov 30th, 2016, 06:38 AM
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

leosuriya
Dec 9th, 2016, 02:30 AM
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.

DRubeša
Dec 9th, 2016, 05:11 AM
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