msp430 external interrupt program

Publisher:数据舞者Latest update time:2016-01-12 Source: eefocusKeywords:msp430 Reading articles on mobile phones Scan QR code
Read articles on your mobile phone anytime, anywhere
Interrupts are everywhere in our lives. The 51 microcontroller has only two external interrupts, while the powerful msp430 has many, such as P1 and P2 ports are all

The driver is as follows:

int main( void )
{
 WDTCTL = WDTPW + WDTHOLD;

   
 P2IE |=0x01;            //Falling edge trigger
 P2IES |=0x01;      
 P2IE |=0x02;
 P2IES |=0x02;
 P2IFG &=~0x03;
 _BIS_SR(GIE);
 
}

#pragma vector =PORT2_VECTOR
__interrupt void Port_1(void)
{
 
 if((P2IFG | 0xfe)==0xff)
 {
 
 P2IFG &=~0x03;
 }
 if((P2IFG | 0xfd)==0xff)
 {
 
 P2IFG &=~0x03;
 }
}

Keywords:msp430 Reference address:msp430 external interrupt program

Previous article:A character input problem
Next article:msp430 matrix button driver

Latest Microcontroller Articles
Change More Related Popular Components

EEWorld
subscription
account

EEWorld
service
account

Automotive
development
circle

About Us Customer Service Contact Information Datasheet Sitemap LatestNews


Room 1530, 15th Floor, Building B, No.18 Zhongguancun Street, Haidian District, Beijing, Postal Code: 100190 China Telephone: 008610 8235 0740

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京ICP证060456号 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号