參數(shù)資料
型號(hào): DSPIC30F2010
英文描述: dsPIC?Language Tools Getting Started
中文描述: dsPIC數(shù)字信號(hào)?語言工具入門
文件頁數(shù): 29/56頁
文件大小: 2612K
代理商: DSPIC30F2010
dsPIC LANGUAGE TOOLS
GETTING STARTED
2003 Microchip Technology Inc.
DS70094B-page 25
Chapter 3. Tutorial 2 - Real-Time Interrupt
3.1
INTRODUCTION
This next tutorial demonstrates real-time interrupt code implemented using the basic
“template” file that comes with MPLAB
IDE software. Timer 1 on the dsPIC30F6104
will be used to generate a recurring interrupt to measure one-second intervals.
3.2
USING TEMPLATE FILES
Template files are source code files that can serve as a structure to build an application.
They make it easy to start a project for an application since the C constructs and
formats are provided in a simple file where details of an application can be added. The
templates have example C statements for many common features of C30 source code,
including variables and constants, processor-specific include files, interrupt vectors
and associated interrupt code, plus areas to insert application code.
The template has comments to help identify key constructs. In many cases macros are
defined to make some things easier. In the simplest form, here is a “stripped-down”
template without these comments and macros so its basic structure can be seen:
EXAMPLE 3-1:
ELEMENTS OF A TEMPLATE FILE
This template code starts out with the
#include
statement to include the header file
that has the processor-specific special function register definitions for this particular
processor (dsPIC30F6014). Following this is a simple constant definition that can be
modified and copied to make a list of constants for the application.
Two array definitions follow to show how to define an array with various attributes,
specifying its section in memory, and how it is aligned in the memory architecture of the
dsPIC device. The second array definition,
array5
, is a simple array.
Like arrays, variables can be assigned with attributes (
variable1
), or with no
attributes (
variable3
).
A code fragment for
main()
follows. This is where code for the application can be
placed. Following
main()
is the code framework for an interrupt.
#include "p30F6014.h" /* proc specific header */
#define CONSTANT1 10 /* sample constant definition */
int array1[CONSTANT1] __attribute__((__section__(".xbss"), __aligned__(32)));
/* array with dsPIC30F attributes */
int array5[CONSTANT2]; /* simple array */
int variable1 __attribute__((__section__(".xbss")));
/* variable with attributes */
int variable3; /* simple variable */
int main ( void ) /* start of main application code */
{
/* Application code goes here */
}
void __attribute__((__interrupt__(__save__(variable1,variable2)))) _INT0Interrupt(void)
/* interrupt routine code */
{
/* Interrupt Service Routine code goes here */
}
相關(guān)PDF資料
PDF描述
DSR180-12-14 Single output 30W~180W
DSR180-48-24 Single output 30W~180W
DSR30-12-24 Single output 30W~180W
DSR30-12-48 Single output 30W~180W
DSR30-15-24 Single output 30W~180W
相關(guān)代理商/技術(shù)參數(shù)
參數(shù)描述
DSPIC30F2010 DEVELOPMENT BOARD KIT 功能描述:BOARD DEV FOR DSPIC30F2010 RoHS:否 類別:編程器,開發(fā)系統(tǒng) >> 通用嵌入式開發(fā)板和套件(MCU、DSP、FPGA、CPLD等) 系列:- 標(biāo)準(zhǔn)包裝:1 系列:PICDEM™ 類型:MCU 適用于相關(guān)產(chǎn)品:PIC10F206,PIC16F690,PIC16F819 所含物品:板,線纜,元件,CD,PICkit 編程器 產(chǎn)品目錄頁面:659 (CN2011-ZH PDF)
DSPIC30F2010 DEVELOPMENT KIT 功能描述:KIT DEV EMBEDDED C RoHS:否 類別:編程器,開發(fā)系統(tǒng) >> 通用嵌入式開發(fā)板和套件(MCU、DSP、FPGA、CPLD等) 系列:- 標(biāo)準(zhǔn)包裝:1 系列:PICDEM™ 類型:MCU 適用于相關(guān)產(chǎn)品:PIC10F206,PIC16F690,PIC16F819 所含物品:板,線纜,元件,CD,PICkit 編程器 產(chǎn)品目錄頁面:659 (CN2011-ZH PDF)
DSPIC30F2010_08 制造商:MICROCHIP 制造商全稱:Microchip Technology 功能描述:High-Performance, 16-bit Digital Signal Controllers
DSPIC30F2010_11 制造商:MICROCHIP 制造商全稱:Microchip Technology 功能描述:16-bit Digital Signal Controllers
dsPIC30F2010-20E/MM 功能描述:數(shù)字信號(hào)處理器和控制器 - DSP, DSC 16B MCU DSP 28LD 30MIPS 12KB FLASH RoHS:否 制造商:Microchip Technology 核心:dsPIC 數(shù)據(jù)總線寬度:16 bit 程序存儲(chǔ)器大小:16 KB 數(shù)據(jù) RAM 大小:2 KB 最大時(shí)鐘頻率:40 MHz 可編程輸入/輸出端數(shù)量:35 定時(shí)器數(shù)量:3 設(shè)備每秒兆指令數(shù):50 MIPs 工作電源電壓:3.3 V 最大工作溫度:+ 85 C 封裝 / 箱體:TQFP-44 安裝風(fēng)格:SMD/SMT