21.01.2014 Views

3.22EjemploDRM007 Co..

3.22EjemploDRM007 Co..

3.22EjemploDRM007 Co..

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Source <strong>Co</strong>de<br />

Source <strong>Co</strong>de Files<br />

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

* void string_LCD(UBYTE *msgLCD): A function that displays a string in the LCD*<br />

* at current cursor position. If a '&' cha- *<br />

* racter is present in the string, a new line<br />

*<br />

* is commanded in the LCD. the function send *<br />

* all the bytes in the string until a presense*<br />

* of a EndOfString, EOS or 0x00 byte. *<br />

* *<br />

* Parameters: *msgLCD. Pointer to the string to be displayed in the LCD<br />

*<br />

* *<br />

* Return: None. *<br />

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

void StringLCD(UBYTE *msgLCD)<br />

{<br />

while(*msgLCD != EOS)<br />

{<br />

}<br />

}<br />

return;<br />

if(*msgLCD == EOL) MovCursorLCD(29,RIGHT);<br />

else DataLCD(*msgLCD);<br />

msgLCD++;<br />

// new line<br />

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

* void wait_ms(UBYTE milis): Delay routine that waits for a number of milli- *<br />

* seconds send in the parameter milis. the delay *<br />

* is calculated for a 8 MHz Fbus operation. *<br />

* *<br />

* Parameters: milis. A 8 bit value representing the number of milliseconds the*<br />

* delay will wait. *<br />

* *<br />

* Return: None. *<br />

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

void WaitMs(UBYTE milis)<br />

{<br />

UBYTE wait40us<strong>Co</strong>unt = 0;<br />

// used for counting wait40us delay<br />

}<br />

do{<br />

for(wait40us<strong>Co</strong>unt = 0; wait40us<strong>Co</strong>unt < 24; wait40us<strong>Co</strong>unt++)<br />

Wait40us();<br />

}while((--milis) != 0);<br />

return;<br />

BLDC Motor <strong>Co</strong>ntrol Board for Industrial and Appliance Applications<br />

DRM007<br />

MOTOROLA Source <strong>Co</strong>de 149

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

Saved successfully!

Ooh no, something went wrong!