I am using the 18F26K80 because it has a 12bit A/D and i have a tube full of them.
I have been using the internal clock to run the RTC for data logging but it runs a little off.
My hardware runs with a 16F886 plugged in on the external osc on T1 just fine.
But when I try to use the 18F26K80 it bawks! Same program except for chip statement and read AD12 instead of readAD10.
Been trying to understand the 18F26K80 pdf and it talked about waiting for the sosc to start.
'Interrupt HandlersInitTimer1sosc,0HSerprint"after init T1CON = 0x"HSerprinthex(T1CON)HSerprintCRLFHSerprint"OSCCON2 = 0x"HSerprinthex(OSCCON2)HSerprintCRLFStopTimer1settimer1,0x8000' 16bit load bit is set to allow'SOSCSEL1 =1'SOSCSEL0 =1wait50usOnInterruptTimer1OverflowCallRTC'T1CON = 0x8B 'EnableSOSCENexternal32koscStartTimer1
I am using the 18F26K80 because it has a 12bit A/D and i have a tube full of them.
I have been using the internal clock to run the RTC for data logging but it runs a little off.
My hardware runs with a 16F886 plugged in on the external osc on T1 just fine.
But when I try to use the 18F26K80 it bawks! Same program except for chip statement and read AD12 instead of readAD10.
I have searched the Forum and my program is just like the programs in the forum.
I don't know what I am missing?
I have read the data sheet.
I have tried configuring directly.
Please any ideas?
Mike w9ys
I know you usually ask for the .asm file.
here it is
Interesting.
What is the value of T1CON after
InitTimer1 sosc, 0
?And, I have just learnt this!
So, clever!!
Hi Anobium,
Been trying to understand the 18F26K80 pdf and it talked about waiting for the sosc to start.
But the wait did not help.
Looks right
Mike
T1CON should be 0x81.
Set T1CON = 0x81
after theStartTimer 1
This should work.
Didn't work.
Actually starttimer1 give 0x89 which is correct because bit 3 of T1CON is SOSCEN should be 1
I took the HSerPrint statements out because they might be interfering with startup and gave it a 500 us wait before "starttimer1"
Not working!
I am almost to the point of ordering a different chip or putting a external A/D on the I2C of the old 16F886 which works.
73
Mike
It would only be 0x89 if the config was set to SOSC, which it is not.
actually config / init gives it 0x88
and then the starttimer1 adds the '1' giving 0x89
where is "high power"? I need to check that.
Open PICINFO, select SOSCSEL. Take the config, post into source.
It is in the chip file but I can not set it to "HIGH".
I also tried to read "CONFIG1L" which doesn't exist
Where is PICINFO?
From GCODE IDE, press function key <f4>, then type PICINFO, select/press enter.</f4>
SOSCSEL is in the .asm file but no value
If have
#option explicit
and you have setSOSCEL = 'a value'
and it does not have an associated dim the compiler would complain.So, it depends what is in your program. I would need the program to figure out.
Yayhhh! That did it. I would never have found that. SOSCCON was bucking me off. I was there before but couldn't make it work.
It works!
Selecting SOSCCON HIGH and then copying the config into the top of the code did it.
Now to actually work on my project.
Thank you!!!
Mike
Yayhhh! That did it. I would never have found that. SOSCCON was bucking me off. I was there before but couldn't make it work.
It works!
Selecting SOSCCON HIGH and then copying the config into the top of the code did it.
Now to actually work on my project.
Thank you!!!
Mike
Excellent!
There is a huge amount of infomation in PICINFO.....