热门关键词:
位置:首页 > 其他资料

PIC编程应用笔记pdf文档

  • 该文件为pdf格式
  • 文件大小:274.72KB
  • 浏览次数
  • 发布时间:2015-10-31
文件介绍:

本资料包含pdf文件1个,下载需要1积分

PIC编程应用笔记,是有助于PIC单片机开发的经验性资料。
INTRODUCTION
Typical embedded control applications place demands
such as low power consumption, small size, low cost
and reduced component count onto the microcontroller.
This application note implements a 24-hour digital
clock, alarm and 99 minute 59 second count down
timer, yet operates on two AA” batteries. The
PIC16C54A is perfect for this application, due to its
small size, high current I/Os with direct LED drive, low
cost, fast instruction throughput and low frequency/current
operation.
System cost
The objective of this design was to implement the maximum
number of features with the least expensive and
smallest device. The PIC16C54A is Microchips lowest
cost microcontroller and it has 12 I/O lines, each capable
of sinking 25 mA and sourcing 20 mA. High efficiency
common cathode LED displays were chosen for
their 3.5 mA current requirement, eliminating the need
for any external transistors for display drive. A low
impedance direct drive piezo buzzer was chosen and
its tone is generated by the software of the PIC16C54A
to further reduce system cost.
Operating power
In battery powered applications, the operating current
determines the lifetime of the batteries. There are many
ways to reduce the operating current of any application,
including low frequency operation and the use of sleep
mode. Since the clock has to keep track of time, SLEEP
mode could not be used and the processor must be
kept running all of the time. The PIC16C54A supports
the 32.768 kHz watch” crystal and typically consumes
less than 15

mA of current in this configuration. Since
the PIC16C54A executes instructions in one cycle and
its instruction set is very efficient, this application was
able to be implemented using a low frequency crystal.
Another solution to this problem comes with the
PIC16C74/73/65/63 in its Timer1 module. Timer1 will
run when the device is asleep, so it could have been
used to keep track of time, simplifying the software.
Author: John Day
Sr., Field Application Engineer, Boston
Clock system
A 32.768 kHz crystal was chosen for the clock due to
the low power and cost requirements of this design. The
four internal phases of this input clock create an internal
instruction cycle. Therefore, the instruction time is
calculated as follows:
This means that every instruction executes in
122.07

ms or we execute exactly 8,192 instructions per
second.
Display and keypad multiplexing
The display contains four digits with seven segments
each; therefore a multiplexing scheme was used to
reduce the number of I/O lines needed to drive the displays.
There are 4 common cathode display connections
(one for each display digit and connected to
PORTA for convenience so that rotates and moves can
be used) and 7 segments (connected to PORTB for
convenience so that moves can be used) for a total of
11 I/O lines needed for the display. Common Cathode
displays were chosen, since the PIC16C54A can sink 5
mA more current than it can source. The last I/O line
(RB7) was used to drive the buzzer. The three keys for
setting the time are multiplexed onto the LED display
segments to eliminate the need for additional I/O lines.

正在加载...请等待或刷新页面...
发表评论
验证码 验证码加载失败