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

cross mob
Jayanth
Level 1
Level 1
5 questions asked 10 sign-ins First reply posted

I am trying to configure SCLK in SAK-TC233LP evaluation board, when I connect the oscilloscope to that pin (PORT 20.11), I am not able to see any clock signals. Please let me know if there are any other configurations to be done. The code is as below : 


#include "Ifx_Types.h"
#include "IfxCpu.h"
#include "IfxScuWdt.h"
#include "IfxQspi_reg.h"
#include "IfxQspi_bf.h"
#include "IfxStm_reg.h"

void Spi_Init(void)
{
/* initialize PORT pins for QSPI0 */
/* initialize I/O function */
P20_IOCR12.B.PC13 = 0x13; /* SLSO P20.13 */
P20_IOCR8.B.PC11 = 0x13; /* SCLK P20.11 */
P20_IOCR12.B.PC14 = 0x13; /* MTSR P20.14 */
P20_IOCR12.B.PC12 = 0x02; /* MRTS P20.12 */

/* Initialize speed grade */
P20_PDR1.B.PD13 = 0x02; /* medium */
P20_PDR1.B.PD11 = 0x01; /* strong, medium edge */
P20_PDR1.B.PD14 = 0x01; /* strong, medium edge */
P20_PDR1.B.PD12 = 0x00; /* default speed grade */

/* Initialize output */
P20_OUT.B.P13 = 0x01;
P20_OUT.B.P11 = 0x01;
P20_OUT.B.P14 = 0x01;
P20_OUT.B.P12 = 0x00;

/* enable QSPI device */
QSPI0_CLC.U = (unsigned long int)0x00000000;

/* set input line selection for MRST pin (PISEL.MRIS) */
QSPI0_PISEL.U = (unsigned long int) 0;

/* Enable Chip Select */
QSPI0_SSOC.U = 0x00040000;

/* set timing characteristics/profile for channel */
QSPI0_ECON2.U = 0x00000844;

/* set up spi device hardware */
QSPI0_GLOBALCON.U = 0x21000000;
QSPI0_GLOBALCON1.U = 0x11050400;

// clear any error flags that might get set during init process
QSPI0_FLAGSCLEAR.U = 0x1ffu;
}


int core0_main(void)
{

uint16 password = IfxScuWdt_getCpuWatchdogPassword();
IfxScuWdt_clearCpuEndinit(password);
Spi_Init();
IfxScuWdt_setCpuEndinit(password);
while(1)
{
}
return (1);
}

0 Likes
1 Solution
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi @Jayanth ,

 

Can you please confirm if you are sending any data using QSPI or just initializing it, because from the code you provided it seems that you are just configuring and initializing QSPI0 but not sending any data. without sending any data the SCLK would be in IDLE state which is configured by GLOBALCON.CPOL, as per the code you provided CPOL = 0 in your case, so the SCLK line would be low during the IDLE state and that's why you might not able to see any clock signals.

 

Best Regards,

Meet.

View solution in original post

1 Reply
Meet_T
Moderator
Moderator
Moderator
25 likes received 50 solutions authored 100 replies posted

Hi @Jayanth ,

 

Can you please confirm if you are sending any data using QSPI or just initializing it, because from the code you provided it seems that you are just configuring and initializing QSPI0 but not sending any data. without sending any data the SCLK would be in IDLE state which is configured by GLOBALCON.CPOL, as per the code you provided CPOL = 0 in your case, so the SCLK line would be low during the IDLE state and that's why you might not able to see any clock signals.

 

Best Regards,

Meet.