HOW to write the delay function in mpc5604p?

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

HOW to write the delay function in mpc5604p?

1,177 次查看
ananan
Contributor III
I want to make 1 millisecond delay . how to do it except using "for()"cycle?
1 回复

1,072 次查看
petervlna
NXP TechSupport
NXP TechSupport

Hi,

You can use for example halt or wait instruction which will stop core execution.

1. configure 1ms timeout on counter which is capable to trigger interrupt.

2. put core into halt (no execution on core)

2. after timer expire (for example PIT) interrupt will wake up core.

pastedImage_1.png

By using the for() cycle you will even increase power consumption as the core will execute jumps in loop. Therefore I am not recommending usage of for() cycle.

Peter