12.07.2015 Views

MPLAB® C18 C 编译器函数库

MPLAB® C18 C 编译器函数库

MPLAB® C18 C 编译器函数库

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.

通 用 软 件 函 数 库4.5 延 时 函 数延 时 函 数 执 行 需 要 若 干 个 处 理 器 指 令 周 期 的 代 码 。 对 于 基 于 时 间 的 延 时 , 必 须 考 虑 处理 器 的 工 作 频 率 。 具 体 函 数 见 下 表 :表 4-4:函 数延 时 函 数描 述Delay1TCY 延 时 一 个 指 令 周 期 。Delay10TCYx 延 时 10 的 整 数 倍 个 指 令 周 期 。Delay100TCYx 延 时 100 的 整 数 倍 个 指 令 周 期 。Delay1KTCYx 延 时 1,000 的 整 数 倍 个 指 令 周 期 。Delay10KTCYx 延 时 10,000 的 整 数 倍 个 指 令 周 期 。4.5.1 函 数 描 述Delay1TCY功 能 :延 时 1 个 指 令 周 期 (Tcy)。包 含 头 文 件 : delays.h原 型 : void Delay1TCY( void );说 明 :该 函 数 实 际 上 是 用 #define 定 义 的 NOP() 指 令 。 当 在 源 代 码 中 遇 到 该函 数 时 , 编 译 器 会 仅 仅 插 入 一 条 NOP() 指 令 。文 件 名 :delays.hDelay10TCYx功 能 :延 时 10 的 整 数 倍 个 指 令 周 期 (Tcy)。包 含 头 文 件 : delays.h原 型 : void Delay10TCYx( unsigned char unit );参 数 :unitunit 的 值 可 以 为 任 何 8 位 值 。 对 [1,255] 范 围 内 的 值 , 将 会 延 时 (unit *10) 个 周 期 。 值 为 0 时 则 延 时 2,560 个 周 期 。说 明 : 该 函 数 延 时 10 的 整 数 倍 个 指 令 周 期 。文 件 名 :d10tcyx.asmDelay100TCYx功 能 :延 时 100 的 整 数 倍 个 指 令 周 期 (Tcy)。包 含 头 文 件 : delays.h原 型 : void Delay100TCYx( unsigned char unit );参 数 :unitunit 的 值 可 以 为 任 何 8 位 值 。 对 [1,255] 范 围 内 的 值 , 将 会 延 时 (unit *100) 个 周 期 。 值 为 0 时 延 时 25,600 个 周 期 。说 明 : 该 函 数 延 时 100 的 整 数 倍 个 指 令 周 期 。文 件 名 :d100tcyx.asm© 2004 Microchip Technology Inc. DS51297C_CN 第 129 页

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

Saved successfully!

Ooh no, something went wrong!