Go to Post Maybe someday soon the quote will be, "As American as baseball and FIRST robotics!" - KathieK [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 08-01-2008, 19:01
JohnC's Avatar
JohnC JohnC is offline
my other name is nigel
FRC #0360 (360 Revolution)
Team Role: Programmer
 
Join Date: Mar 2005
Rookie Year: 2005
Location: user_routines.c
Posts: 100
JohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the rough
Send a message via AIM to JohnC
Interrupts in the C18 3.0 software

I'm reading interrupts.c and I notice that Initialize_Int_N() sets a register (I think it's a register) to 0, which the comment says disables the interrupt.

Why is this done? Should I change that to a 1? If so, it seems like it would make more sense to have a Set_Interrupt_N(int) function so that the interrupts can be turned on and off.

Anyway, why isn't this defaulted to 1 since users have to uncomment the ENABLE_INT_N macros for the function to "exist" in the first place? Maybe I'm just confused?
__________________
What place are we at? ... TODAI!
  #2   Spotlight this post!  
Unread 09-01-2008, 22:27
interfect interfect is offline
Registered User
FRC #2022
 
Join Date: Jan 2007
Location: Illinois
Posts: 18
interfect will become famous soon enough
Re: Interrupts in the C18 3.0 software

Could it be that the register being 1 disables the interrupt, and the register being 0 would thus enable it? I haven't seen the code, so I don't really know what I'm talking about, but that would make sense.

Or maybe you're supposed to enable it later.
  #3   Spotlight this post!  
Unread 10-01-2008, 02:58
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Interrupts in the C18 3.0 software

Quote:
Originally Posted by JohnC View Post
Why is this done?
Leaving it at zero allows you to use the interrupt hardware in polled mode, which is nice because you don't need to write an interrupt service routine.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #4   Spotlight this post!  
Unread 10-01-2008, 03:18
JohnC's Avatar
JohnC JohnC is offline
my other name is nigel
FRC #0360 (360 Revolution)
Team Role: Programmer
 
Join Date: Mar 2005
Rookie Year: 2005
Location: user_routines.c
Posts: 100
JohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the rough
Send a message via AIM to JohnC
Re: Interrupts in the C18 3.0 software

Quote:
Originally Posted by Kevin Watson View Post
Leaving it at zero allows you to use the interrupt hardware in polled mode, which is nice because you don't need to write an interrupt service routine.

-Kevin
I'm confused. How does that accomplish anything? How do you do something with the interrupt without an ISR?
__________________
What place are we at? ... TODAI!

Last edited by JohnC : 10-01-2008 at 09:41.
  #5   Spotlight this post!  
Unread 10-01-2008, 13:02
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Cañada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Cañada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Interrupts in the C18 3.0 software

Quote:
Originally Posted by JohnC View Post
I'm confused. How does that accomplish anything? How do you do something with the interrupt without an ISR?
You poll the interrupt flag bit and wait for it to change.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
where can i download the mplab c18 compiler v2.40 amirjpl Programming 5 27-03-2007 20:37
Does the camera code suits to all versions of MPLAB and C18? razer Programming 3 04-01-2007 14:50
Problem with interrupts on the PIC Mike Betts Programming 7 16-12-2003 21:26
Hints for the Edu Interrupts JimWright949 Programming 0 02-12-2003 02:01
Interrupts on the EDU-RC? Andrew Programming 3 13-11-2003 23:16


All times are GMT -5. The time now is 09:17.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi