HOW to write the delay function in mpc5604p?

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

HOW to write the delay function in mpc5604p?

538件の閲覧回数
ananan
Contributor III
I want to make 1 millisecond delay . how to do it except using "for()"cycle?
1 返信

433件の閲覧回数
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