HOW to write the delay function in mpc5604p?

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

HOW to write the delay function in mpc5604p?

507 Views
ananan
Contributor III
I want to make 1 millisecond delay . how to do it except using "for()"cycle?
1 Reply

402 Views
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