Other Parts Discussed in Thread: MSP430G2553
hi, I'm new in area of msp430..maybe my english is not good but ı will try explain what is my problem...ı need your help...
I have a graduation project..ıwant to make this project with msp430g2553...
In this project , I have two time delay...
#include "io430.h"
#include "in430.h"
void main( void )
{
WDTCTL = WDTPW + WDTHOLD;
DCOCTL=CALDCO_1MHZ;
BCSCTL1=CALBC1_1MHZ;
__delay_cycles(500000);
P1DIR = 0xFF;
P1OUT= 0x00;
P1SEL_bit.P0 = 1;
P2DIR = 0x00;
P2OUT = 0x00;
TA0CCR0=30000; // first time delay 30 sn
TA0CCTL0=CCIE;
TA0CTL=TASSEL_2 + MC_1 + TAIE;
_BIS_SR(GIE);
while(1){
if(P1OUT_bit.P1 == 1){
TA0CCR1=15000; // second time delay 15 sn
TA0CCTL1=CCIE;
TA0CTL=TASSEL_2 + MC_1 + TAIE;}
else {P1OUT_bit.P3 = 1;}
}}
pragma vector=TIMER0_A0_VECTOR
__interrupt void Timer_A0 (void)
{
i++;
if(i==1000)
{
P1OUT_bit.P1 = 1;
i=0;}
TACTL_bit.TAIFG = 0;}
#pragma vector=TIMER0_A1_VECTOR
__interrupt void Timer_A1 (void)
{
switch (__even_in_range(TAIV, 10))
{
case 2: {i++;
if(i==1000)
{
P1OUT_bit.P2 = 1;
i=0;}
TACTL_bit.TAIFG = 0;}
break;
}}
problem is that first delay is working but second is not working...Why ? How can ı chang this code??
Or How can I get two different time delay....But ı want second will start after first time delay...
Also the other question? first delay will occur after 6. high to low position of clock signal..
second will control the 15 second time delay...
Thank you for helping...