Location:
Search - __interrupt I
Search list
Description: IAR环境下AT91SAM7S64开发板例程(实现中断功能)-IAR development board under AT91SAM7S64 routine (realized interrupt function)
Platform: |
Size: 461824 |
Author: Vincent |
Hits:
Description: MCU是msp430g2553,用timerA0控制LED的闪烁,闪烁速度由快到慢,循环执行-
#include "msp430g2553.h"
unsigned char J,K
void main( void )
{
//unsigned char i
// Stop watchdog timer to prevent time out reset
WDTCTL = WDTPW+ WDTHOLD
P1DIR |= BIT6
/*BCSCTL1 &= ~BIT7
do
{
IFG1 &= ~OFIFG
for(i=0xff i>0 i--)
}
while(IFG1&OFIFG)
BCSCTL2 |= SELS+ DIVS_3 */
CCTL0 |= CCIE
CCR0=65000
TACTL |= TASSEL_2+ MC_1 //+ ID_3
_EINT()
LPM0
}
#pragma vector=TIMER0_A0_VECTOR
__interrupt void key(void)
{
P1OUT ^= BIT6
J++
if(J==16)
{
J=0
K++
if(K==1)
{
TACTL &=~(ID0+ ID1)
TACTL |= ID_0
}
if(K==2)
{
TACTL &=~(ID0+ ID1)
TACTL |= ID_1
}
if(K==3)
{
TACTL &=~(ID0+ ID1)
TACTL |= ID_2
}
if(K==4)
{
TACTL &=~(ID0+ ID1)
TACTL |= ID_3
K=0
}
}
}
Platform: |
Size: 21504 |
Author: 宣传 |
Hits:
Description: 本文档描述了如何通过按键从待机模式中唤醒设备,并给出了代码示例。-/******************************************************************************
F2MC-8FX Family SOFTUNE C Compiler sample startup routine,
ALL RIGHTS RESERVED, COPYRIGHT (C) FUJITSU LIMITED 2008
LICENSED MATERIAL- PROGRAM PROPERTY OF FUJITSU LIMITED
NAME: MAIN.C
FUNCTION: Change the system clock and lighten three LED
LED flicker frequency different in different clock
******************************************************************************/
#include "mb95200.h"
#define LED2 PDR0_P05
#define LED3 PDR6_P64
#define LED4 PDR6_P63
#define Light 0 /*LED light*/
#define Unlight 1 /*LED unlight*/
/**************** vDelay routine ***********************/
unsigned char vDelay(unsigned int uiCount)
{
int i
while(uiCount--)
{
for(i=0 i<100 i++)
asm("\tNOP")
}
}
/******************************************************************************
NAME: __interrupt void external_int06(void)
FUNCTION:
***********************************************
Platform: |
Size: 44032 |
Author: Shijie |
Hits: