| View previous topic :: View next topic |
| Author |
Message |
deperkin
Joined: 04 Feb 2009 Posts: 83 Location: PA
|
| RC |
Posted: Thu Jul 14, 2011 2:39 pm |
|
|
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: 20159
|
|
Posted: Fri Jul 15, 2011 1:58 am |
|
|
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
|
| derp |
Posted: Fri Jul 15, 2011 10:19 am |
|
|
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
|
| follow-up |
Posted: Tue Sep 27, 2011 7:31 am |
|
|
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? |
|
 |
|