2
CCS :: View topic - INT_EXT interrupting in enable http://ccsinfo.com/forum/viewtopic.php?t=27783&highlight=inte ... 1 от 2 01.3.2007 г. 10:29 FAQ Forum Help Official CCS Support Search Register Profile Log in to check your private messages Log in INT_EXT interrupting in enable CCS Forum Index -> General CCS C Discussion View previous topic :: View next topic Author Message Breno Joined: 20 Jul 2006 Posts: 5 Location: Belo Horizonte, Brazil INT_EXT interrupting in enable Posted: Mon Jul 31, 2006 4:47 pm I am having a problem with interrupts: when I enable INT_EXT, it imediatly goes to the interrupt routine, no matter what border it was configured. I am simulating this in proteus so there is no bouncing problem. This initialize the interrupt: Code: ext_int_edge(H_TO_L); enable_interrupts(INT_EXT); enable_interrupts(GLOBAL); This is the interrupt routine: Code: #INT_EXT void int_isr(void) { c=spi_read(0); lcd_putc(c); } What should I do so the interrupt routine will only be accessed when the PIN_B0 gets low? Thanks. Breno Last edited by Breno on Mon Jul 31, 2006 5:01 pm; edited 1 time in total PCM programmer Joined: 06 Sep 2003 Posts: 6775 Posted: Mon Jul 31, 2006 4:55 pm Quote: When I enable INT_EXT, it immediately goes to the interrupt routine. Add the line shown below. It may help. Code:

CCS _ View topic - INT_EXT interrupting in enable

Embed Size (px)

Citation preview

Page 1: CCS _ View topic - INT_EXT interrupting in enable

CCS :: View topic - INT_EXT interrupting in enable http://ccsinfo.com/forum/viewtopic.php?t=27783&highlight=inte...

1 от 2 01.3.2007 г. 10:29

FAQ Forum Help Official CCS Support Search Register

Profile Log in to check your private messages Log in

INT_EXT interrupting in enable

CCS Forum Index -> General CCS C Discussion

View previous topic :: View next topic

Author Message

Breno

Joined: 20 Jul 2006Posts: 5Location: Belo Horizonte, Brazil

INT_EXT interrupting in enablePosted: Mon Jul 31, 2006 4:47 pm

I am having a problem with interrupts: when I enable INT_EXT, it imediatly goes to the

interrupt routine, no matter what border it was configured. I am simulating this in proteus so there is no bouncing problem.

This initialize the interrupt:

Code:

ext_int_edge(H_TO_L); enable_interrupts(INT_EXT); enable_interrupts(GLOBAL);

This is the interrupt routine:

Code:

#INT_EXT void int_isr(void) { c=spi_read(0); lcd_putc(c); }

What should I do so the interrupt routine will only be accessed when the PIN_B0 gets low?

Thanks.

Breno

Last edited by Breno on Mon Jul 31, 2006 5:01 pm; edited 1 time in total

PCM programmer

Joined: 06 Sep 2003Posts: 6775

Posted: Mon Jul 31, 2006 4:55 pm

Quote:

When I enable INT_EXT, it immediately goes to the interrupt routine.

Add the line shown below. It may help.

Code:

Page 2: CCS _ View topic - INT_EXT interrupting in enable

CCS :: View topic - INT_EXT interrupting in enable http://ccsinfo.com/forum/viewtopic.php?t=27783&highlight=inte...

2 от 2 01.3.2007 г. 10:29

ext_int_edge(H_TO_L); enable_interrupts(INT_EXT); clear_interrupt(INT_EXT); // Add this line enable_interrupts(GLOBAL);

Breno

Joined: 20 Jul 2006Posts: 5Location: Belo Horizonte, Brazil

Posted: Mon Jul 31, 2006 5:11 pm

Thanks man, this has fixed the problem.

But I also tried something that worked: configuring the portb directions after the

enable_interrupts.

Display posts from previous: All PostsAll Posts Oldest FirstOldest First Go

CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours

Page 1 of 1

Jump to: General CCS C DiscussionGeneral CCS C Discussion Go

You can post new topics in this forumYou can reply to topics in this forum

You cannot edit your posts in this forumYou cannot delete your posts in this forum

You cannot vote in polls in this forum

Powered by phpBB © 2001, 2005 phpBB Group