Comment #2 on issue 157 by [email protected]: Loading OSCCAL with
the value provided by the manufacturer
http://code.google.com/p/jallib/issues/detail?id=157
Oscillator calibration for PICs with an OSCCAL register.
The smarter solution for me is to put it in the user program.
They are two solution depending of the memory size of the PIC:
Sorry those solutions are ASM statements, I'm not an expert to build them
in JAL but for so few instruction(s) and so few PIC it doesn't really pay
for.
For 512 bytes memory or less PiC like the 12f508, 10f20x, 10f22x
Just put at the very first line of your JAL program even before directives
declaration even before the" include PIC...." this statement: asm MOVWF
0x0005.
It will appear at the first statement of the "main" in the ASM listing and
will be executed first, loading the calibration value in OSCCAL register.
For 1024 bytes memory PiC like the 12f509,510, 16f505,506,
12f629,675,16f630,676, 16f526
Insert the following statement before your main
assembler
page call 0x3FF
bank movwf OSCCAL
end assembler
--
You received this message because you are subscribed to the Google Groups
"jallib" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/jallib?hl=en.