Thanks Arnd-Hendrik.
Your mention of the ISR helped me out.
i looked at the service routines for timers...
and wrote something similar to that for Port2.
it works fine now.
thanks,
karan
On Mon, 2004-10-04 at 10:41, Arnd-Hendrik Mathias wrote:
> Hi Karan,
> can you post the code of your ISR?
> Regards
>
> Arnd-Hendrik
>
> karan wrote:
>
> > hi,
> >
> > i really need this problem solved.
> > its holding up a lot of my work.
> > could any of you guys please help me out??
> >
> > thanks
> > karan
> >
> > On Sat, 2004-10-02 at 11:08, karan wrote:
> >
> >> /how do i detect a gpio interrupt??
> >>
> >> i am using the msp430 stk2 kit from olimex which has the msp430449.
> >>
> >> there is a sender msp430 which is intermittently
> >> setting bit4 on the P2 port, which is on the EXT connector.
> >>
> >> there is a receiver msp430 which should detect when a transition has
> >> taken place
> >> on the P2.BIT4 through the EXT connector.
> >>
> >> this is my code for the receiver:
> >>
> >> # include <io.h>
> >> # include <signal.h>
> >>
> >> int main(void)
> >> {
> >> WDTCTL = WDTPW + WDTHOLD; // Stop WDT
> >>
> >> _EINT(); // Enable interrupts
> >>
> >> P2DIR &= ~BIT4; // input direction
> >> P2SEL &= 0x00; // select gpio function
> >>
> >> P2IES &= ~BIT4; // set p2bit4 for low-to-high transition
> >> P2IE |= BIT4; // enable interrupt on bit4 of port2
> >>
> >> while(1)
> >> {
> >> if ((P2IFG & BIT4) == BIT4) // has interrupt flag been set
> >> for bit4?
> >> {
> >> // do something here
> >> P2IFG &= ~BIT4; // unset interrupt flag
> >> }
> >> }
> >>
> >> return 0;
> >> }
> >>
> >> but this is not happening.
> >> the receiver does not detect this interrupt.
> >>
> >> am i doing something wrong?
> >>
> >> thanks
> >> karan/
> >> CM II
> >> Resolution Systems Inc.
> >>
> > CM II
> > Resolution Systems Inc.
> >
> >
> >
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
> Use IT products in your business? Tell us what you think of them. Give us
> Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
> http://productguide.itmanagersjournal.com/guidepromo.tmpl
> _______________________________________________
> Mspgcc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
CM II
Resolution Systems Inc.