a delay() or sleep() function on MC56F8037

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

a delay() or sleep() function on MC56F8037

3,551 Views
GraphConfigTool
Contributor I

Hello,

 

I'm workin' on MC56F8037 and i need to stop excutiing my code for 30 µs each time on my "while", so i need to call some sleep function (or delay) to do that. It's coz i have an LCD..

well, the problem is that there is no lib or a header file containing such a function :/

 

so, i need your help people to tell me what to do, specially that i am a beginner :/

 

(version 5.6.1)

 

thanks a lot !

Labels (1)
Tags (1)
0 Kudos
Reply
1 Reply

489 Views
trytohelp
NXP Employee
NXP Employee

Hi,

 

Delay and sleep are not Ansi.

The libraries don't include them.

Processor Expert includes this function:

 Delay100US - This method realizes software delay. The length of delay is at least 100 microsecond multiply input parameter us100. As the delay implementation is not based on real clock, the delay time may be increased by interrupt service routines processed during the delay. Adding read wait states for external program memory can cause delay extension as well. The method is independent on selected speed mode.


  • ANSIC prototype: asm void Delay100US(word us100)
  • us100:word - Number of 100 us delay repetitions.

 

Without Processor Expert you must use nop instruction in a loop.

 

Regards

Pascal

0 Kudos
Reply