LPC1788 and FLASHTIM value for 120MHz

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

LPC1788 and FLASHTIM value for 120MHz

658 次查看
giusloq
Contributor III

I want to run LPC1788 at 120MHz with IRC and PLL. From User Manual I read that I need to set PBOOST=3 and FLASHTIM=4 or 5. Of course, I can write:

 

Chip_SYSCTL_EnableBoost();
Chip_SYSCTL_SetFLASHAccess(4 or 5);

 

Those functions are defined as:

 

STATIC INLINE void Chip_SYSCTL_EnableBoost(void)
{
	LPC_SYSCTL->PBOOST = 0x3;
}

STATIC INLINE void Chip_SYSCTL_SetFLASHAccess(FMC_FLASHTIM_T clks)
{
	uint32_t tmp = LPC_SYSCTL->FLASHCFG & 0xFFF;

	/* Don't alter lower bits */
	LPC_SYSCTL->FLASHCFG = tmp | (clks << 12);
}

 

 

However LPCOpen defines FMC_FLASHTIM_T as:

 

typedef enum {
FLASHTIM_20MHZ_CPU = 0, /*!< Flash accesses use 1 CPU clocks. Use for up to 20 MHz CPU clock */
FLASHTIM_40MHZ_CPU = 1, /*!< Flash accesses use 2 CPU clocks. Use for up to 40 MHz CPU clock */
FLASHTIM_60MHZ_CPU = 2, /*!< Flash accesses use 3 CPU clocks. Use for up to 60 MHz CPU clock */
FLASHTIM_80MHZ_CPU = 3, /*!< Flash accesses use 4 CPU clocks. Use for up to 80 MHz CPU clock */
FLASHTIM_100MHZ_CPU = 4, /*!< Flash accesses use 5 CPU clocks. Use for up to 100 MHz CPU clock */
#if defined(CHIP_LPC177X_8X) || defined(CHIP_LPC40XX)
FLASHTIM_120MHZ_CPU = 3, /*!< Flash accesses use 4 CPU clocks. Use for up to 120 MHz CPU clock with power boot on*/
#else
FLASHTIM_120MHZ_CPU = 4, /*!< Flash accesses use 5 CPU clocks. Use for up to 120 Mhz for LPC1759 and LPC1769 only.*/
#endif
FLASHTIM_SAFE_SETTING = 5, /*!< Flash accesses use 6 CPU clocks. Safe setting for any allowed conditions */
} FMC_FLASHTIM_T;

 

It seems to me that definition of FLASHTIM_120MHZ_CPU is faulty, because it is defined as 3 for CHIP_LPC177X_8X and CHIP_LPC40XX, instead of 4.

What is the right value to set FLASHTIM for 120MHz and power boost?

0 项奖励
回复
1 回复

613 次查看
Alice_Yang
NXP TechSupport
NXP TechSupport

Hello @giusloq 

Please follow the UM. As the UM mentioned, FLASHTIM should be 0100 for operation from 100 to 120 MHz operation with power boost on.

 

BR

Alice

0 项奖励
回复