On 2011/04/21 18:37, Karin Willers wrote:
There is a section in 'devicefiles.html' about how to use the
calibration word in high memory (of some PICs) and the danger when
that word is not a RETLW instruction (anymore).
I don't remember when I last updated this OSCCAL section, so you may
have to download that file to get the latest state.
Maybe this section needs further instructions?
The sequence for the 10fxxx devices differs, which would be worth documenting.
The instruction at 0xff or 0x1ff has to be valid, since it is executed
after reset on the 10fxxx family. PicKit 2 has also an option to
regenerate the calibration value, if it gets lost somehow.
Indeed, I overlooked that the 10Fs and other PICs with 12 bits core like
12f508/9/10, 16f505/506 have a MOVLW in the upper memory word!
Of course the technique of 'calling' the upper memory word works only
when that word contains a RETLW (and devicefiles.html contains a warning).
This issue affects all 10fxxx devices. In my opinion, the include
files should be changed accordingly.
No! By design a Jallib device file 'does' nothing (does not change
any register by itself), the user program may suppose it gets the PIC
in the state as after a reset.
But the device file generates code, via the initialization of the shadow
registers with default values, which overwrites w - this is the issue.
As mentioned, the setting of OSCCAL on the 10fxxx devices has to be the
first thing, before any user- or compiler-generated code overwrites the
value.
Calibration of the internal oscillator is optional. So it would have to
be an option of the compiler or the device file.
Setting OSCCAL by the device file would violate a design rule of Jallib,
or must be accepted as exception to the rules.
Regards, Rob.
--
R. Hamerling, Netherlands --- http://www.robh.nl
--
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.