a delay() or sleep() function on MC56F8037

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

a delay() or sleep() function on MC56F8037

4,005件の閲覧回数
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 !

ラベル(1)
タグ(1)
0 件の賞賛
返信
1 返信

943件の閲覧回数
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 件の賞賛
返信