CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Disabling Interrupts required ??

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

Disabling Interrupts required ??
PostPosted: Fri Jul 18, 2003 7:05 am     Reply with quote

Hello All,

I am using the PIC 16F877 mcu, and the CCS PCM compiler.

I would like to know if it is necessary to call the disable_interrupts() function, before servicing an interrupt ?.

Also is it necessary to shut down all interrupt (by using the disable_interrupts() function) before writing to /reading the internal EEPROM using the write_eeprom() / read_eeprom() functions ??.

thanks
arun
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516137
Sirio
Guest







Re: Disabling Interrupts required ??
PostPosted: Fri Jul 18, 2003 9:31 am     Reply with quote

:=Hello All,

Hi

:=I am using the PIC 16F877 mcu, and the CCS PCM compiler.
:=
:=I would like to know if it is necessary to call the disable_interrupts() function, before servicing an interrupt ?.

No.

:=Also is it necessary to shut down all interrupt (by using the disable_interrupts() function) before writing to /reading the internal EEPROM using the write_eeprom() / read_eeprom() functions ??.
:=

Don't think so.

:=thanks

np

:=arun
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516148
Felix Althaus



Joined: 09 Sep 2003
Posts: 67
Location: Winterthur, Switzerland

View user's profile Send private message

Re: Disabling Interrupts required ??
PostPosted: Fri Jul 18, 2003 12:17 pm     Reply with quote

Hi

From the PIC16F84A datasheet (but this is similar on the 16F87x):

"When an interrupt is responded to, the GIE bit is cleared to disable any further interrupt, [...]"

So, the PIC disables all interrupts for you. After the ISR, the chip turns the interrupts on again (exactly: the chip re-sets the GIE bit)

mfg
Felix
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516157
arunb



Joined: 08 Sep 2003
Posts: 492
Location: India

View user's profile Send private message Send e-mail

Re: Disabling Interrupts required ??
PostPosted: Fri Jul 18, 2003 9:44 pm     Reply with quote

:=:=Hello All,
:=
:=Hi
:=
:=:=I am using the PIC 16F877 mcu, and the CCS PCM compiler.
:=:=
:=:=I would like to know if it is necessary to call the disable_interrupts() function, before servicing an interrupt ?.
:=
:=No.
:=
:=:=Also is it necessary to shut down all interrupt (by using the disable_interrupts() function) before writing to /reading the internal EEPROM using the write_eeprom() / read_eeprom() functions ??.
:=:=
:=
:=Don't think so.
:=
:=:=thanks
:=
:=np
:=
:=:=arun


Hi,

thanks for the reply.

I find that the mcu sometimes writes garbage to the EEPROM. I felt that disabling interrupts was required, because in the datasheets it is recommended to turn off all interrupts, does the isr routine for any isr does this automatically ???

thanks
arun
___________________________
This message was ported from CCS's old forum
Original Post ID: 144516169
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group