fx2lp delay macro

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

cross mob
gean_3054931
Level 5
Level 5
10 likes given 5 likes given First like received

Hello,

why should we use below macro?

#define _IFREQ  24000            // IFCLK constant for Synchronization Delay

#define _CFREQ  48000            // CLKOUT constant for Synchronization Delay

in my application project,

IFCLK is 27mhz,should i use #define _IFREQ  27000  ?

and

i am not using clock out pin ,can i ignore this?

regards,

geetha.

0 Likes
1 Solution
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello Geetha,

These macro definitions are used for the calculation of the SYNCDELAY. You can refer to the syncdly.h file in the project folder where these values are used in the computation of the SYNCDELAY.

#define _SCYCL ( 3*(_CFREQ) + 5*(_IFREQ) - 1 ) / ( 2*(_IFREQ) )

#if( _SCYCL == 1 )

#define SYNCDELAY _nop_( )

#endif

#if( _SCYCL == 2 )

#define SYNCDELAY _nop_( ); \

                  _nop_( )

#endif

#if( _SCYCL == 3 )

#define SYNCDELAY _nop_( ); \

                  _nop_( ); \

                  _nop_( )

#endif

This macro definition does not affect the IFCLK/ CLKOUT frequency.

Best regards,

Srinath S

View solution in original post

0 Likes
5 Replies
SrinathS_16
Moderator
Moderator
Moderator
1000 replies posted 750 replies posted 500 replies posted

Hello Geetha,

These macro definitions are used for the calculation of the SYNCDELAY. You can refer to the syncdly.h file in the project folder where these values are used in the computation of the SYNCDELAY.

#define _SCYCL ( 3*(_CFREQ) + 5*(_IFREQ) - 1 ) / ( 2*(_IFREQ) )

#if( _SCYCL == 1 )

#define SYNCDELAY _nop_( )

#endif

#if( _SCYCL == 2 )

#define SYNCDELAY _nop_( ); \

                  _nop_( )

#endif

#if( _SCYCL == 3 )

#define SYNCDELAY _nop_( ); \

                  _nop_( ); \

                  _nop_( )

#endif

This macro definition does not affect the IFCLK/ CLKOUT frequency.

Best regards,

Srinath S

0 Likes

Hello shrinath,

I am asking you about syncdelay calculation.

in my project ,i am using 27MHZ IFCLK,

do i need to change these macros?that will effect syncdelay?

regards,

geetha

0 Likes

Hello Geetha,

Yes, modifying these macros will affect the SYNCDELAY if you are using the same syncdly.h header file.

Best regards,

Srinath S

0 Likes

Hello shrinath,

I am using 27mhz IFCLK,at this condition,can i use #define _IFREQ  48000 ?

or is it should be at #define _IFREQ  27000 ?

regards,

geetha.

0 Likes

Hello Geetha,

It is not mandatory that the macro definition should be matching with the actual IFCLK frequency. The macro definition is only used for computing the SYNCDELAY. It would be logical if the _IFREQ macro definition matches the IFCLK but is not a mandatory condition.

Best regards,

Srinath S