Operation speed of MCU is different.

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

Operation speed of MCU is different.

1,039 次查看
HungNguyenDQ
Contributor I

I use Keil C V5 to upload code to MCU LPC2368. Firstly, I upload code to MCU LPC2368(1). Then I replace MCU LPC2368(1) on board by MCU LPC2368(2) . I upload code(the same as before) to MCU LPC2368(2). But MCU LPC2368(1) and MCU LPC2368(2) are different in running. Speed of running is defferent.

Note: MCU LPC2368(2) were uploaded other code before.

Please help me reply question below:

1. Code (be uploaded before) effect to speed of MCU?

2. When I upload new code, all setting of previous code will be erase?

3. Why are speed of running defferent?

Please help me!!

标记 (1)
0 项奖励
回复
1 回复

1,031 次查看
xiangjun_rong
NXP TechSupport
NXP TechSupport

Hi,

First of all, when you upload new application code to flash, the previous code are erased and updated with new code.

Regarding your code, it appears that the delay function is ambiguous, pls try to use the following code:

void msdelay(unsigned int time)
{
unsigned int i,j;
for(i=0; i<time; i++) {}
for(j=0;j <6002; j++) {}
}

or


void msdelay1(unsigned int time)
{
unsigned int i,j;
for(i=0; i<time; i++)
{
for(j=0;j <6002; j++)
{
__asm("nop");
}
}
}

do you know that MCU runs in different speed by observing the GPIO toggling in different frequency with the same code?

BR

XiangJun Rong

0 项奖励
回复