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 support@ccsinfo.com

Keeping track of interrupts

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







Keeping track of interrupts
PostPosted: Tue Jun 05, 2007 10:02 am     Reply with quote

hi,
I am starting to work on PIC uc and am a novice. I have an issue while coding.I gotta write a program which wakes up at particular intervals adc convert and record the data on the eeprom. I am able to achive it by using ADC interupts and sleep_ulpwu() function. But the issue is that i am not able to track the interrupts to update the rom address so that in gets written in next next address and not on the same address. How do i keep track how many interrupts have occured.

thanks
kender



Joined: 09 Aug 2004
Posts: 768
Location: Silicon Valley

View user's profile Send private message Send e-mail Visit poster's website Yahoo Messenger

PostPosted: Tue Jun 05, 2007 10:20 am     Reply with quote

May I ask some questions:
- Do you miss the interrupts?
- How often do you sample?
- How much data do you need to write to EEPROM?
_________________
Read the label, before opening a can of worms.
Ttelmah
Guest







PostPosted: Tue Jun 05, 2007 10:21 am     Reply with quote

You don't want to use ADC interrupts for this. ADC_interrupts, signfy when an ADC conversion has _completed_, and you have nothing to signal the start of such a conversion. Don't get so complex. Just use the sleep_ulpwu function, and when you awaken, perform a normal ADC conversion, write this to the EEPROM, increment a counter, and loop back to the sleep. The counter will tell you where to write the value. The memories inside the PIC, are static during the sleep, and hold their values.
Beware also though, of how quickly the EEPROM 'life' can be used by this type of operation. Though improved by changing the location each time, after only a few cycles (depending on the size of the EEPROM, and how many bytes you write each time), you will be back to writing the same locaion, and unless you sleep for a relatively very long time, it can be suprising how quickly the life gets used.....

Best Wishes
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