11.07.2015 Views

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

PICBASIC PLUS LITE Manual - Profe Saul

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

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

<strong>PICBASIC</strong> <strong>PLUS</strong> Compiler5.18. DELAYUSSyntax :Overview :Operators :DELAYUS LengthDelay execution for length x microseconds (us). Delays may be up to65535us (65.535 milliseconds) long.Length can be a constant, variable, or expression.Example : DECLARE XTAL 20DIM Var as BYTEDIM Wrd as WORDVar = 50Wrd = 1000DELAYUS 1DELAYUS 100DELAYUS VarDELAYUS WrdDELAYUS Wrd + 10‘ Delay for 1us‘ Delay for 100us‘ Delay for 50us‘ Delay for 1000us‘ Delay for 1010usNotes :DELAYUS is oscillator independent, as long as you inform the compilerof the crystal frequency to use, using the DECLARE directive.If a constant is used as length, then delays down to 1us can beachieved, however, if a variable is used as length, then there’s a minimumdelay time depending on the frequency of the crystal used: -CRYSTAL FREQ4MHz8MHz10MHz16MHz20MHzMINIMUM DELAY24us12us8us5us2usSee also :DECLARE, DELAYMS, SLEEP, SNOOZE51Copyright Crownhill 2001

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

Saved successfully!

Ooh no, something went wrong!