[12月26日更新]关于Keil 创建LM4F120 新工程的问题
TA的每日心情 | 奋斗 2012-11-12 10:50 |
|---|
签到天数: 1 天 连续签到: 1 天 [LV.1]初来乍到
进士
- 积分
- 1181
|
11#
lxc115
发表于 2013-1-15 13:45:52
|
只看该作者
cn_x 发表于 2013-1-14 12:45 ![]()
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|
SYSCTL_OSC_ ...
找到什么原因了么,我看着也不知道哪里出错 |
|
|
|
|
|
|
|
|
TA的每日心情 | 无聊 2018-3-6 09:47 |
|---|
签到天数: 51 天 连续签到: 1 天 [LV.5]常住居民I
秀才
- 积分
- 480
|
我找到答案了
I think you may be running into the max flash read speed. The flash can only read at 40 Mhz. We have a pre-fetch buffer mechanism to fetch 2 words instead of one when running faster than 40 mhz. In a tight loop like the SysCtlDelay you may find that the the pre-fetch cannot do it's job well due to the jumping in the loop.
Some things to try that might verify this is true.
Change SYSCTL_SYSDIV_2_5 to SYSCTL_SYSDIV_5. See if the delay is exactly twice as long or if you are hitting the read time limit then the delay will be the same.
A second test would be to try using ROM_SysCtlDelay() with the rest of your software the same as shown. The ROM can run at the full 80Mhz and will not be slowed down.
Dexter
链接
http://e2e.ti.com/support/microc ... f/471/t/143842.aspx |
|
|
|
|
|
|
|
|
TA的每日心情 | 奋斗 2012-11-12 10:50 |
|---|
签到天数: 1 天 连续签到: 1 天 [LV.1]初来乍到
进士
- 积分
- 1181
|
13#
lxc115
发表于 2013-1-16 19:44:05
|
只看该作者
cn_x 发表于 2013-1-15 14:24 ![]()
我找到答案了
I think you may be running into the max flash read speed. The flash can only read at 4 ...
原来是flash和rom的读取速度的限制啊? |
|
|
|
|
|
|
|
|
TA的每日心情 | 奋斗 2012-11-12 10:50 |
|---|
签到天数: 1 天 连续签到: 1 天 [LV.1]初来乍到
进士
- 积分
- 1181
|
14#
lxc115
发表于 2013-1-17 10:06:28
|
只看该作者
cn_x 发表于 2013-1-15 14:24 ![]()
我找到答案了
I think you may be running into the max flash read speed. The flash can only read at 4 ...
已验证。
ROM_SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ|SYSCTL_OSC_MAIN;
ROM_SysCtlDelay(SysCtlClockGet()/3);
延时1s,说明没有达到ROM的读取速度限制。
SysCtlClockSet(SYSCTL_SYSDIV_4|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ| SYSCTL_OSC_MAIN);
SysCtlDelay(SysCtlClockGet()/3);
延时2s,超过Flash读取速度上限,如果改为:
SysCtlClockSet(SYSCTL_SYSDIV_5|SYSCTL_USE_PLL|SYSCTL_XTAL_16MHZ| SYSCTL_OSC_MAIN);
SysCtlDelay(SysCtlClockGet()/3);
是系统运行在40MHz,延时仍然是1s。 |
|
|
|
|
|
|
|
|