19.08.2013 Views

AN2120: Connecting an M68HC08 Family Microcontroller to an ...

AN2120: Connecting an M68HC08 Family Microcontroller to an ...

AN2120: Connecting an M68HC08 Family Microcontroller to an ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Application Note<br />

Delay.C<br />

Source Code of Variable Delay() Function<br />

/******************************************************************************<br />

File Name : Delay.c<br />

Author : Rene Trenado<br />

Location : Mo<strong>to</strong>rola Applications Lab, Baja California<br />

Date Created : July 2000<br />

Current Revision : 0.0<br />

Notes : This file contains the code for a variable Delay function<br />

*******************************************************************************/<br />

#include "delay.h"<br />

BYTE delayCounter;<br />

/***********************************************************************<br />

Function : Delay<br />

Parameters : A Byte containing the number of times __Delay will be<br />

called<br />

Date : July 2000<br />

Desc : This function blocks the CPU in multiples of _Delay times<br />

***********************************************************************/<br />

void Delay (register BYTE times) {<br />

_Delay();<br />

}<br />

/***********************************************************************<br />

Assembly Function : __1msDelay<br />

Parameters : None<br />

Date : July 2000<br />

Desc : This function blocks the CPU in multiples of 1.3mSecs<br />

delayCount specifies the time base<br />

__1msDelay = delayCounter x 1.3 mSec<br />

***********************************************************************/<br />

#asm<br />

xref.b _delayCounter<br />

xdef __Delay<br />

<strong>AN2120</strong><br />

88 MOTOROLA

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!