参数资料
型号: DV164101
厂商: Microchip Technology
文件页数: 57/76页
文件大小: 0K
描述: KIT DEV PICKIT1 FLASH 8/14PIN
产品培训模块: Asynchronous Stimulus
标准包装: 1
系列: PICkit™ 1
类型: MCU
适用于相关产品: Microchip 8-14 引脚闪存微控制器
所含物品: PIC 套件 1 电路板、光盘、USB 接口缆线和手册
产品目录页面: 659 (CN2011-ZH PDF)
配用: AC164122-ND - BOARD DAUGHT PICTAIL SD/MMC CARD
AC164120-ND - BOARD SIGNAL ANALYSIS PICKIT
其它名称: DV164101R
DV164101R-ND
C.5
LESSON 3 – INTERRUPTS
This program demonstrates how to use the Timer0 and pin change interrupts onboard
the PIC12F6XX. In addition, the program illustrates how the PIC12F6XX is multiplexing
the LED's fast enough to give the visual representation that the LED's are all on at the
same time when in fact the LED's are lit individually. Finally, this program uses the
interrupt on-pin change to detect and debounce a button push which changes the rate
at which the LEDs are flashed.
This lesson covers the following topics:
?
?
?
?
?
How to flash LEDs on the PICkit 1 Flash Starter Kit board
How to use Timer0 and pin change interrupts on the PIC12F6XX
How to turn a source code file into a library file for easy reuse
Useful applications that can use the concepts presented in this lesson
Files needed to customize the source code for the application
C.5.1
Design
One of the challenges of using an 8-pin PIC microcontroller is having enough pins for
a robust application. The PICkit 1 Flash Starter Kit utilizes design tips and tricks to get
the most out of the 8/14-pin PIC microcontroller devices. In particular, a 12-LED array
is implemented on the PICkit 1 Flash Starter Kit by using only 4 pins. In this lesson, only
8 LED's are implemented. See Table C-1 for LED multiplexing. Also, see “TIP #2
Input/Output Multiplexing”, in the “Microchip Tips 'n Tricks 8-pin Flash PIC ? Micro-
controller” booklet (DS44040) for more details on LED multiplexing.
TABLE C-1:
LED MULTIPLEXING TRUTH TABLE
PIN
D0
D1
D2
D3
D4
D5
D6
D7
D8
D9
D10
D11
GP4
GP5
GP2
GP1
HI LOW HI LOW Z Z Z Z Z Z HI LOW
LOW HI Z Z HI LOW Z Z HI LOW Z Z
Z Z LOW HI LOW HI HI LOW Z Z Z Z
Z Z Z Z Z Z LOW HI LOW HI LOW HI
Legend: HI => Logic 1, LOW => Logic 0 and Z => TRISIO = 1
C.5.2
Implementation
The lesson utilizes interrupts to make the LED operation transparent to the main
program. The main program writes the value 0xFF to the LEDREGISTER. This flashes
8 LEDs on the PICkit 1 Flash Starter Kit board. In order to flash 4 LEDs, for example,
write 0x0F into the LEDREGISTER. The interrupt service routine uses a Timer0
interrupt for updating the LED array. A GP3 pin change interrupt detects a button push.
The Timer0 prescaler is adjusted and changes the amount of time it takes for a Timer0
interrupt to happen. This gives the visual representation that the LEDs are all on at the
same time, or sequencing.
This lesson introduces the intlib library. The intlib library contains the core functions for
flashing the LEDs and debouncing the GP3 push button. The intlib library contains the
functions Display and Debounce. The library also contains the general purpose
register, LEDREGISTER, to flash LEDs. See Section C.9.5, “Modifying the Source
Code”, for more information on the required files needed to build this project in MPLAB
IDE. Also, see the source code files for additional comments on the implementation.
For a high-level flowchart, see Figure C-10.
? 2004 Microchip Technology Inc.
DS40051D-page 53
相关PDF资料
PDF描述
DV164120 KIT STARTER PICKIT 2
DV164121 KIT PICKIT 2 DEBUG EXPRESS
DV164122 ANALYZER SRL PICKIT W/DEMO BOARD
DV164131 KIT STARTER PICKIT 3
DV164132 KIT EVAL F1 FOR PIC12F1/PIC16F1
相关代理商/技术参数
参数描述
DV164101 制造商:Microchip Technology Inc 功能描述:TOOLS: FLASH MICROCONTROLLER (
DV164102 功能描述:开发板和工具包 - 无线 rfPICkit RoHS:否 制造商:Arduino 产品:Evaluation Boards 工具用于评估:AT32UC3L 核心:AVR32 频率: 接口类型:USB 工作电源电压:5 V
DV164120 功能描述:电路内置调试器 PICkit 2 8/14/20P Flash RoHS:否 制造商:Microchip Technology 产品:In-Circuit Debugger Kits 工具用于评估:PIC MCUs, dsPIC DSCs 用于:07-00024, AC164113 核心:dsPIC, PIC 接口类型:USB 工作电源电压:3 V to 5 V
DV164121 功能描述:电路内置调试器 PICkit 2 Debug Express RoHS:否 制造商:Microchip Technology 产品:In-Circuit Debugger Kits 工具用于评估:PIC MCUs, dsPIC DSCs 用于:07-00024, AC164113 核心:dsPIC, PIC 接口类型:USB 工作电源电压:3 V to 5 V
DV164121 制造商:Microchip Technology Inc 功能描述:ICPICKIT2 PROGRAMMER/DEBUGGER ((NW))