亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? example_2833xepwmtripzone.c

?? TI最新DSP28335的例子
?? C
字號:
// TI File $Revision: /main/7 $
// Checkin $Date: August 10, 2007   09:04:48 $
//###########################################################################
//
// FILE:    Example_2833xEpwmTripZone.c
//
// TITLE:   Check PWM Trip Zone Test
//
// ASSUMPTIONS:
//
//    This program requires the DSP2833x header files.  
//
//    Initially tie TZ1 (GPIO12) and TZ2 (GPIO13) high. 
//
//    During the test, monitor ePWM1 or ePWM2 outputs 
//    on a scope Pull TZ1 or TZ2 low to see the effect. 
//
//       EPWM1A is on GPIO0
//       EPWM1B is on GPIO1
//       EPWM2A is on GPIO2
//       EPWM2B is on GPIO3
//
//    ePWM1 will react as a 1 shot trip
// 
//    ePWM2 will react as a cycle by cycle trip and will be
//    cleared if TZ1 and TZ2 are both pulled back high. 
//
//
//    As supplied, this project is configured for "boot to SARAM" 
//    operation.  The 2833x Boot Mode table is shown below.  
//    For information on configuring the boot mode of an eZdsp, 
//    please refer to the documentation included with the eZdsp,  
//
//       $Boot_Table:
//
//         GPIO87   GPIO86     GPIO85   GPIO84
//          XA15     XA14       XA13     XA12
//           PU       PU         PU       PU
//        ==========================================
//            1        1          1        1    Jump to Flash
//            1        1          1        0    SCI-A boot
//            1        1          0        1    SPI-A boot
//            1        1          0        0    I2C-A boot
//            1        0          1        1    eCAN-A boot
//            1        0          1        0    McBSP-A boot
//            1        0          0        1    Jump to XINTF x16
//            1        0          0        0    Jump to XINTF x32
//            0        1          1        1    Jump to OTP
//            0        1          1        0    Parallel GPIO I/O boot
//            0        1          0        1    Parallel XINTF boot
//            0        1          0        0    Jump to SARAM	    <- "boot to SARAM"
//            0        0          1        1    Branch to check boot mode
//            0        0          1        0    Boot to flash, bypass ADC cal
//            0        0          0        1    Boot to SARAM, bypass ADC cal
//            0        0          0        0    Boot to SCI-A, bypass ADC cal
//                                              Boot_Table_End$
//
// DESCRIPTION:
//
//    This example configures ePWM1 and ePWM2 
// 
//    2 Examples are included:
//    * ePWM1 has TZ1 and TZ2 as one shot trip sources
//    * ePWM2 has TZ1 and TZ2 as cycle by cycle trip sources  
//
//    Each ePWM is configured to interrupt on the 3rd zero event
//    when this happens the deadband is modified such that
//    0 <= DB <= DB_MAX.  That is, the deadband will move up and
//    down between 0 and the maximum value. 
//
//
//    View the EPWM1A/B, EPWM2A/B waveforms 
//    via an oscilloscope to see the effect of TZ1 and TZ2
//
//
//###########################################################################
// $TI Release: DSP2833x Header Files V1.03 $
// $Release Date: December 3, 2007 $
//###########################################################################

#include "DSP2833x_Device.h"     // DSP2833x Headerfile Include File
#include "DSP2833x_Examples.h"   // DSP2833x Examples Include File

// Prototype statements for functions found within this file.
void InitEPwm1Example(void);
void InitEPwm2Example(void);
interrupt void epwm1_tzint_isr(void);
interrupt void epwm2_tzint_isr(void);


// Global variables used in this example
Uint32  EPwm1TZIntCount;
Uint32  EPwm2TZIntCount;

void main(void)
{
// Step 1. Initialize System Control:
// PLL, WatchDog, enable Peripheral Clocks
// This example function is found in the DSP2833x_SysCtrl.c file.
   InitSysCtrl();

// Step 2. Initalize GPIO: 
// This example function is found in the DSP2833x_Gpio.c file and
// illustrates how to set the GPIO to it's default state.
// InitGpio();  // Skipped for this example  

// For this case just init GPIO pins for ePWM1, ePWM2, and TZ pins
   InitEPwm1Gpio();
   InitEPwm2Gpio();
   InitTzGpio();
   
// Step 3. Clear all interrupts and initialize PIE vector table:
// Disable CPU interrupts 
   DINT;

// Initialize the PIE control registers to their default state.
// The default state is all PIE interrupts disabled and flags
// are cleared.  
// This function is found in the DSP2833x_PieCtrl.c file.
   InitPieCtrl();
   
// Disable CPU interrupts and clear all CPU interrupt flags:
   IER = 0x0000;
   IFR = 0x0000;

// Initialize the PIE vector table with pointers to the shell Interrupt 
// Service Routines (ISR).  
// This will populate the entire table, even if the interrupt
// is not used in this example.  This is useful for debug purposes.
// The shell ISR routines are found in DSP2833x_DefaultIsr.c.
// This function is found in DSP2833x_PieVect.c.
   InitPieVectTable();

// Interrupts that are used in this example are re-mapped to
// ISR functions found within this file.  
   EALLOW;  // This is needed to write to EALLOW protected registers
   PieVectTable.EPWM1_TZINT = &epwm1_tzint_isr;
   PieVectTable.EPWM2_TZINT = &epwm2_tzint_isr;
   EDIS;    // This is needed to disable write to EALLOW protected registers

// Step 4. Initialize all the Device Peripherals:
// This function is found in DSP2833x_InitPeripherals.c
// InitPeripherals();  // Not required for this example


   EALLOW;
   SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 0;
   EDIS;

   InitEPwm1Example();    
   InitEPwm2Example();

   EALLOW;
   SysCtrlRegs.PCLKCR0.bit.TBCLKSYNC = 1;
   EDIS;
   
// Step 5. User specific code, enable interrupts
// Initalize counters:   
   EPwm1TZIntCount = 0;
   EPwm2TZIntCount = 0;
   
// Enable CPU INT3 which is connected to EPWM1-3 INT:
   IER |= M_INT2;

// Enable EPWM INTn in the PIE: Group 2 interrupt 1-3
   PieCtrlRegs.PIEIER2.bit.INTx1 = 1;
   PieCtrlRegs.PIEIER2.bit.INTx2 = 1;

// Enable global Interrupts and higher priority real-time debug events:
   EINT;   // Enable Global interrupt INTM
   ERTM;   // Enable Global realtime interrupt DBGM



// Step 6. IDLE loop. Just sit and loop forever (optional):
   for(;;)
   {
       asm("          NOP");
   }

} 

interrupt void epwm1_tzint_isr(void)
{
   EPwm1TZIntCount++;

// Leave these flags set so we only take this
// interrupt once
//
// EALLOW;
// EPwm1Regs.TZCLR.bit.OST = 1;
// EPwm1Regs.TZCLR.bit.INT = 1;
// EDIS;

   // Acknowledge this interrupt to receive more interrupts from group 2
   PieCtrlRegs.PIEACK.all = PIEACK_GROUP2;

}

interrupt void epwm2_tzint_isr(void)
{

   EPwm2TZIntCount++;

// Clear the flags - we will continue to take
// this interrupt until the TZ pin goes high
//
   EALLOW;
   EPwm2Regs.TZCLR.bit.CBC = 1;   
   EPwm2Regs.TZCLR.bit.INT = 1;
   EDIS;

   // Acknowledge this interrupt to receive more interrupts from group 2
   PieCtrlRegs.PIEACK.all = PIEACK_GROUP2;

}


void InitEPwm1Example()
{
   // Enable TZ1 and TZ2 as one shot trip sources
   EALLOW;
   EPwm1Regs.TZSEL.bit.OSHT1 = 1;
   EPwm1Regs.TZSEL.bit.OSHT2 = 1;
   
   // What do we want the TZ1 and TZ2 to do?
   EPwm1Regs.TZCTL.bit.TZA = TZ_FORCE_HI;
   EPwm1Regs.TZCTL.bit.TZB = TZ_FORCE_LO;
   
   // Enable TZ interrupt
   EPwm1Regs.TZEINT.bit.OST = 1;
   EDIS;
   
   EPwm1Regs.TBPRD = 6000;                         // Set timer period
   EPwm1Regs.TBPHS.half.TBPHS = 0x0000;            // Phase is 0
   EPwm1Regs.TBCTR = 0x0000;                       // Clear counter

   // Setup TBCLK
   EPwm1Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up
   EPwm1Regs.TBCTL.bit.PHSEN = TB_DISABLE;        // Disable phase loading
   EPwm1Regs.TBCTL.bit.HSPCLKDIV = TB_DIV4;       // Clock ratio to SYSCLKOUT
   EPwm1Regs.TBCTL.bit.CLKDIV = TB_DIV4;

   EPwm1Regs.CMPCTL.bit.SHDWAMODE = CC_SHADOW;    // Load registers every ZERO
   EPwm1Regs.CMPCTL.bit.SHDWBMODE = CC_SHADOW;
   EPwm1Regs.CMPCTL.bit.LOADAMODE = CC_CTR_ZERO;
   EPwm1Regs.CMPCTL.bit.LOADBMODE = CC_CTR_ZERO;   

   // Setup compare 
   EPwm1Regs.CMPA.half.CMPA = 3000;

   // Set actions
   EPwm1Regs.AQCTLA.bit.CAU = AQ_SET;             // Set PWM1A on Zero
   EPwm1Regs.AQCTLA.bit.CAD = AQ_CLEAR;
   

   EPwm1Regs.AQCTLB.bit.CAU = AQ_CLEAR;          // Set PWM1A on Zero
   EPwm1Regs.AQCTLB.bit.CAD = AQ_SET;

}


void InitEPwm2Example()
{

   // Enable TZ1 and TZ2 as one cycle-by-cycle trip sources
   EALLOW;
   EPwm2Regs.TZSEL.bit.CBC1 = 1;
   EPwm2Regs.TZSEL.bit.CBC2 = 1;
   
   // What do we want the TZ1 and TZ2 to do?
   EPwm2Regs.TZCTL.bit.TZA = TZ_FORCE_HI;
   EPwm2Regs.TZCTL.bit.TZB = TZ_FORCE_LO;
   
   // Enable TZ interrupt
   EPwm2Regs.TZEINT.bit.CBC = 1;
   EDIS;

   EPwm2Regs.TBPRD = 6000;                        // Set timer period
   EPwm2Regs.TBPHS.half.TBPHS = 0x0000;           // Phase is 0
   EPwm2Regs.TBCTR = 0x0000;                      // Clear counter
   
   // Setup TBCLK
   EPwm2Regs.TBCTL.bit.CTRMODE = TB_COUNT_UPDOWN; // Count up
   EPwm2Regs.TBCTL.bit.PHSEN = TB_DISABLE;        // Disable phase loading
   EPwm2Regs.TBCTL.bit.HSPCLKDIV = TB_DIV4;       // Clock ratio to SYSCLKOUT
   EPwm2Regs.TBCTL.bit.CLKDIV = TB_DIV4;          // Slow just to observe on the scope

   // Setup compare 
   EPwm2Regs.CMPA.half.CMPA = 3000;

   // Set actions
   EPwm2Regs.AQCTLA.bit.CAU = AQ_SET;             // Set PWM2A on Zero
   EPwm2Regs.AQCTLA.bit.CAD = AQ_CLEAR;
   

   EPwm2Regs.AQCTLB.bit.CAU = AQ_CLEAR;           // Set PWM2A on Zero
   EPwm2Regs.AQCTLB.bit.CAD = AQ_SET;
}




//===========================================================================
// No more.
//===========================================================================

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区啦啦啦在线观看| 亚洲三级久久久| 国产麻豆精品视频| 久久精品一区二区三区不卡牛牛| 国产一区二区毛片| 国产精品久久久一本精品 | 国产亚洲精品bt天堂精选| 国产精品一卡二| 亚洲欧美视频一区| 在线视频欧美精品| 日本不卡高清视频| 国产亚洲一二三区| 国产激情一区二区三区桃花岛亚洲| 中文字幕成人网| 欧美伊人久久久久久久久影院| 美女一区二区三区| 国产精品久久久一区麻豆最新章节| 91豆麻精品91久久久久久| 日本色综合中文字幕| 国产亚洲精品aa| 欧美日韩中文一区| 国产精品一区二区久久不卡| 亚洲免费观看在线视频| 欧美本精品男人aⅴ天堂| 成年人午夜久久久| 午夜精品久久久久久| 国产色婷婷亚洲99精品小说| 欧美日韩中文精品| 风间由美中文字幕在线看视频国产欧美 | 亚洲男人的天堂av| 日韩精品一区二区三区视频| heyzo一本久久综合| 日本欧美在线观看| 日韩一区中文字幕| 欧美成人精品高清在线播放| 91原创在线视频| 精品一区二区三区久久| 一区二区三区免费网站| 国产校园另类小说区| 欧美日韩视频不卡| 91影院在线免费观看| 久久成人羞羞网站| 五月天视频一区| 中文字幕一区二区三区视频| 日韩精品在线一区| 欧美三级在线视频| av电影在线观看完整版一区二区| 午夜久久久久久| 亚洲人成网站在线| 久久亚洲私人国产精品va媚药| 欧美理论片在线| 日本电影亚洲天堂一区| 丁香网亚洲国际| 国内精品伊人久久久久av一坑| 亚洲午夜一区二区三区| 国产精品久久久久久久久久久免费看| 日韩三级精品电影久久久 | 国产jizzjizz一区二区| 麻豆91精品视频| 水蜜桃久久夜色精品一区的特点 | 国产精品1区2区3区在线观看| 日本在线不卡视频| 亚洲成在人线在线播放| 亚洲一级二级在线| 一区二区高清免费观看影视大全| 欧美国产日韩精品免费观看| 久久久精品免费免费| 久久综合99re88久久爱| 日韩精品一区二区三区在线播放 | 91福利精品第一导航| 99这里只有久久精品视频| 成人手机电影网| 成人午夜视频免费看| 丁香网亚洲国际| 成人免费高清视频在线观看| 成人18精品视频| 99国产一区二区三精品乱码| 色综合中文字幕国产| 91在线一区二区三区| 91免费在线播放| 在线观看视频一区二区 | 欧美日韩国产乱码电影| 欧美午夜在线观看| 欧美日韩国产一区| 欧美电影一区二区| 欧美大片拔萝卜| 久久久精品中文字幕麻豆发布| 久久伊99综合婷婷久久伊| 久久久久国产精品免费免费搜索| 久久精品夜夜夜夜久久| 国产精品免费视频网站| 亚洲色图欧洲色图婷婷| 亚洲v日本v欧美v久久精品| 丝袜诱惑亚洲看片 | 成人亚洲精品久久久久软件| 成人av动漫网站| 91猫先生在线| 666欧美在线视频| 久久综合九色综合欧美就去吻| 久久只精品国产| 亚洲视频一区二区免费在线观看| 亚洲视频精选在线| 日韩精品亚洲一区| 韩国成人精品a∨在线观看| 成人av资源在线| 欧美日韩激情一区二区三区| 欧美精品一区二区三区视频| 国产精品嫩草久久久久| 婷婷久久综合九色综合伊人色| 久久激情五月激情| 95精品视频在线| 日韩三级高清在线| 亚洲色图制服诱惑| 蜜臀久久99精品久久久久久9| 成人免费高清视频在线观看| 欧美日韩国产a| 欧美韩国日本不卡| 天天色天天操综合| 北条麻妃国产九九精品视频| 51精品秘密在线观看| 国产亚洲欧美色| 午夜激情一区二区| www.在线成人| 精品成人在线观看| 亚洲一二三四区| 成人听书哪个软件好| 欧美一区二区三区四区五区| 日本一区二区三级电影在线观看| 午夜精品福利在线| 91香蕉视频黄| 久久先锋影音av鲁色资源| 亚洲影视在线播放| 国产99久久久国产精品免费看| 欧美精品在线视频| 亚洲色图欧美激情| 国产精品一区二区久激情瑜伽| 欧美日韩国产在线播放网站| 国产精品人妖ts系列视频| 美女视频网站久久| 欧美日韩不卡一区| 有坂深雪av一区二区精品| 国产不卡高清在线观看视频| 日韩欧美国产成人一区二区| 亚洲成人自拍一区| 91麻豆国产精品久久| 国产三级欧美三级日产三级99 | 国产一区二区视频在线播放| 欧美优质美女网站| 亚洲欧美日本在线| 成人三级伦理片| 久久精品视频在线免费观看| 蜜桃免费网站一区二区三区| 欧美老年两性高潮| 亚洲成人免费av| 欧美午夜理伦三级在线观看| 亚洲激情网站免费观看| 色综合久久88色综合天天6| 国产精品三级视频| 成人晚上爱看视频| 国产精品萝li| 丁香婷婷深情五月亚洲| 国产精品视频在线看| 成人一级黄色片| 国产精品久久久久四虎| 成人午夜av影视| 国产精品三级久久久久三级| 成人免费福利片| 中文字幕一区二区三| 91视频一区二区三区| 亚洲欧美影音先锋| 色视频欧美一区二区三区| 一区二区三区在线视频免费 | 欧美一级一区二区| 美女网站一区二区| 久久蜜桃一区二区| 99久久免费国产| 亚洲综合男人的天堂| 欧美日韩高清影院| 久久精品国产亚洲aⅴ| 欧美哺乳videos| 国产成人小视频| 亚洲视频综合在线| 欧美日韩不卡一区二区| 激情深爱一区二区| 国产精品青草久久| 91国模大尺度私拍在线视频| 亚洲午夜av在线| 精品国产自在久精品国产| 国产精品911| 亚洲综合网站在线观看| 欧美高清视频一二三区 | 亚洲妇熟xx妇色黄| 精品国产电影一区二区| 成人一区在线看| 亚洲成a人在线观看| 欧美α欧美αv大片| 91影院在线观看| 毛片一区二区三区| 中文字幕在线观看不卡| 欧美日韩国产bt|