This corrected issued an error message. As LFINTOSC is not explicitly declared. Which is correct as it is not in the latest library. This needs to resolved. Did you get this message?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This corrected issued an error message. As LFINTOSC is not explicitly declared. Which is correct as it is not in the latest library. This needs to resolved. Did you get this message?
I don't use #options explicit (it drives me crazy when I'm trying to quickly try some changes, etc) so I didn't get the message. I'll try to remember this in the future if I have problems.
Last edit: Jim giordano 2019-04-27
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I have been trying to get timer1 to use the internal 32768 oscillator on chip 16lf18324.
I used:
InitTimer1 LFINTOSC,0
but it wasn't working, it was using the FOSC or FOSC4 oscillator for timer 1.
After screwing around for several hours, I found that I had to manually set
tmr1cs0=1
tmr1cs1=1
to get it to work.
This is probably a problem with the remainder of this class of microprocessor.
Perhaps this is a chipdata problem?
Last edit: Jim giordano 2019-04-25
Correction. LFINTOSC is not 32768, it's a 31K oscillator.
@Jim.
Just catching up on this as i have been away.
I tested with this code.
This corrected issued an error message. As LFINTOSC is not explicitly declared. Which is correct as it is not in the latest library. This needs to resolved. Did you get this message?
@Jim. Please test the attached.
I have added LFINTOSC support within Timer1 support.
Yes! It works. Thanks Evan :)
( But don't forget timer3 and timer5 )
I don't use #options explicit (it drives me crazy when I'm trying to quickly try some changes, etc) so I didn't get the message. I'll try to remember this in the future if I have problems.
Last edit: Jim giordano 2019-04-27
@Jim. Ok. I will adapt and move to t3 and t5. Will you retest?
Always use #option explicit. It is the safe way.
yes, of course :)
Please try this - added T3 and T5.
https://sourceforge.net/p/gcbasic/code/HEAD/tree/GCBASIC/trunk/include/lowlevel/timer.h?format=raw
Looks good. Here's the program I used to test.
Excellent.
Looks good.
Please use that going forward. I will include in the next release.