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

12f1822 resetting
Goto page Previous  1, 2
 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
deperkin



Joined: 04 Feb 2009
Posts: 83
Location: PA

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

RC
PostPosted: Thu Jul 14, 2011 2:39 pm     Reply with quote

yep i do have the adc_clock_internal setup.

it is just like the code above only i have changed it to disable the global and enable int_AD before the start... exactly as you have it.


Also, i cannot directly go to a 12f675... but possibly a 12f683 since i would like to have standard pwm module along with eeprom.
Ttelmah



Joined: 11 Mar 2010
Posts: 20160

View user's profile Send private message

PostPosted: Fri Jul 15, 2011 1:58 am     Reply with quote

No.
The code as posted, does _not_ select the internal clock.
You are writing to the ADCON1 register later, and this selects clock/8 as the ADC clock. This is why things are not working for you.
Get rid of your own overrides, and things may start working.....

Best Wishes
deperkin



Joined: 04 Feb 2009
Posts: 83
Location: PA

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

derp
PostPosted: Fri Jul 15, 2011 10:19 am     Reply with quote

you are correct... i forgot to remove this!

Thank you again very much for your time and help.
deperkin



Joined: 04 Feb 2009
Posts: 83
Location: PA

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

follow-up
PostPosted: Tue Sep 27, 2011 7:31 am     Reply with quote

I have the resetting problem solved for this pic now.

Another issue that recently presented itself however:

if you notice in my "set_threshold" function i have the following line:
Code:

if(read_eeprom(INIT_DONE_FLAG_ADDR) != INIT_DONE)
{
.
.
.
}

this has always worked for me in the past. However now I seem to have the PIC start to go through this timely loop more than once.

I have checked the eeprom and my INIT_DONE flag is present, however it 'randomly' either doesnt read the eeprom correctly, or something, causing it to do this loop more than just the first time.

Example:

I started from scratch, let it go through this ~18min loop, logged some data, that re-ran it after letting my sensor cool down. Upon my third time doing so, it entered back into the ~18min loop... I stopped it, checked eeprom and saw my INIT_DONE flag present. repeated it, and it skipped the loop this time... then next trial it went back into the loop.

It is critical with this sensor that I only perform the "set_threshold" function one time in the life of the sensor.

any suggestions?
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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