PIC编程应用笔记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.
- 1草快分割机cad图纸
- 24.消防应急灯具(GB_17945-2000)
- 3JB/T 5381-2014 透射式投影器画面畸变测试版技术条件
- 41栋标准层平面CAD图
- 5关于电缆桥架洞口封堵解释
- 6GB 317-2006 白砂糖
- 740t锅炉结构制图
- 8JB/T 5452.2-1991 仪器仪表电子元器件产品规范 步进电机专用控制电路SJ0303CP(SJ0303CD)
- 9最新建设项目业主规范管理与操作实务全书
- 10广东品茗二代资料软件2011v3.1+++
- 11科迈罗3D打印SolidWorks设计
- 12减速器!JSC-500套装形式的CAD图纸
- 13TB/T 3128-2006 内燃铁路起重机改造技术条件
- 14最新水利水电工程施工质量验收评定表及填表说明(水利部2015版)
- 15IphoneX苹果手机模型step/stp格式