Announcements

From sunburn to sun earn – we’ve got the power! Watch our #poweringgreen videos now.

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

cross mob
lock attach
Attachments are accessible only for community members.
AbhishekD
Level 1
Level 1
First like received 10 sign-ins 5 sign-ins

Hello 

I am trying to established a connection between TC399 and TLF35584 using QSPI0.

I am using Infineon MCAL ( AUTOSAR ) and configured SPI module with below values. 

- Communication mode is set to synchronous.

- Baudrate at 50MHz

I am using example code given by infineon. The sequence I am following is as below.

Spi_Init () : This function is initializing the configured channels ( Currently only one for TLF )

initTLF35584() : This follows the sequence of

unlockRegisterTLF35584();
disableWindowWatchdogTLF35584(tlfDevice);
disableErrPinMonitorTLF35584(tlfDevice);
lockRegisterTLF35584();

Then calling getCurrentStateTLF35584() to read Device Status. I am getting 0xFF which does not look like right value. I am expecting a value indicating device is in INIT state.  
 

 

0 Likes
1 Solution
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

Can you please share the oscilloscope trace for this? I will check that and let you know. At your end can you please try adding a delay between Init() and getCurrentState() and check if you are able to get a proper response?

Best regards,
Pranava

View solution in original post

0 Likes
3 Replies
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

Can you please share the oscilloscope trace for this? I will check that and let you know. At your end can you please try adding a delay between Init() and getCurrentState() and check if you are able to get a proper response?

Best regards,
Pranava
0 Likes
AbhishekD
Level 1
Level 1
First like received 10 sign-ins 5 sign-ins

Hi @Pranava_YN , Thanks for response. 

ANS 1 : At this moment oscilloscope trace is not available. Its actual ECU on which I am figuring out testpoint to capture trace on oscilloscope.

ANS 2 : As per suggestion I added delay but the result was same.

With some modification in SPI configuration , the value which I am getting now is 0xFF7F when I am disabling the watchdog and Error PIN.

Q 3 : Can some one confirm me the configuration for SPI done using EBTresos as below is right ? 

> General Configuration

SpiChannelBuffersAllowed : 0 ( IB )
SpiEnableLoopBackApi : 0
SpiLevelDelivered : 0
SpiSupportConcurrentSyncTransmit : 1
SpiSyncTransmitTimeoutDuration : 0xFFFF
SpiHwStatusApi :0 

SpiInterruptibleSequence : Disable

> Channel Configuration 

SpiChannelId : 0 
SpiChannelType : IB ( Internal Buffer Type )
SpiDataWidth : 15
SpiIbNBuffers : 10
SpiTransferStart : MSB

> Device Configuration 

SpiBaudrate : 5000000
SpiCsIdentifier : Channel 0
SpiCsPolarity : LOW
SpiDataShiftEdge : TRAILING
SpiEnableCs : 1
SpiHwUnit : QSPI0
SpiAutoCalcBaudParams : 1
SpiShiftClockIdleLevel : LOW
SpiParitySupport : EVEN
SpiCsSelection  : CS_VIA_PERIPHERAL_ENGINE
SpiDelayParamTrailPre : 2
SpiDelayParamTrailLength : 5
SpiDelayParamIdlePre : 0
SpiDelayParamIdleLength : 1
SpiDelayParamLeadPre : 0
SpiDelayParamLeadLength : 7

> PORT Configuration 

General

PortNumber 22
PortNumberOfPortPins 12


PortPin4

PortPinDirection PORT_PIN_OUT
PortPinInitialMode ALT4
PortPinLevelValue PORT_PIN_LEVEL_HIGH
PortPinOutputPadDriveStrength PORT_PIN_DEFAULT_DRIVER
PortPinOutputPinDriveMode PORT_PIN_OUT_PUSHPULL
PortPinMode PortPinMode PORT_PIN_MODE_ALL

PortPin_5

PortPinDirection PORT_PIN_OUT
PortPinInitialMode ALT4
PortPinLevelValue PORT_PIN_LEVEL_HIGH
PortPinOutputPadDriveStrength PORT_PIN_DEFAULT_DRIVER
PortPinOutputPinDriveMode PORT_PIN_OUT_PUSHPULL
PortPinMode PortPinMode PORT_PIN_MODE_ALL

PortPin_6

PortPinDirection PORT_PIN_IN
PortPinInputPullResistor PORT_PIN_IN_PULL_DOWN
PortPinInputPadLevel PORT_INPUT_LEVEL_CMOS_AUTOMOTIVE
PortPinMode PortPinMode PORT_PIN_MODE_ALL

PortPin_7

PortPinDirection PORT_PIN_OUT
PortPinInitialMode ALT4
PortPinLevelValue PORT_PIN_LEVEL_LOW
PortPinOutputPadDriveStrength PORT_PIN_DEFAULT_DRIVER
PortPinOutputPinDriveMode PORT_PIN_OUT_PUSHPULL

 

Q 4 : Interrupts for SPI are disabled. SPI Autosar module provides read and write API which are used. Interrupts are not mandatory is my understanding. Is it right ?

0 Likes
Pranava_YN
Moderator
Moderator
Moderator
100 likes received 500 replies posted 250 solutions authored

Hi,

Sorry for the delay in responding,

Yes, both SPI configuration and your understanding on SPI interrupts are correct.

Best regards,
Pranava
0 Likes