Eur van Andel wrote:
> Another thing: if we use 4 MHZ as clock, we should set IOSCS as well!
>
>> -- This program assumes the internal oscillator
>> -- is used with a frequency of 4 MHz.
>> pragma target clock 4_000_000 -- oscillator frequency
>> pragma target WDT disabled
>> pragma target IOFSCS _4_MHz
>> --
>
> Since 8 MHz is the default value. This is only for PIC10F22X:
>
>> G5-fiwihex:~/jalv2/jallib/unvalidated/include/device eur$ grep
>> IOFSCS *.jal
>> 10f220.jal:pragma fuse_def IOFSCS 0x1 {
>> 10f222.jal:pragma fuse_def IOFSCS 0x1 {
>
>
> I noticed the LED blinking twice as fast.
You openened another can or Microchip worms.....
In the 10F220/222 _datasheet_ this bit is called IOSCFS, but in the .dev
files it is called IOFSCS. The latter will be a typo, because the bit is
called Interternal OSCillator Frequency Select bit.
When you grep for IOSCFS you'll find a couple of other PICS with this
bit, and with the same meaning.
I think I'll 'repair' the .dev file for the 10F220/222 and add the bit
to the blink program for all chips with the IOSCFS bit.
I need also to 'harmonize' the IOSCFS parameter values to F4MHZ and
F8MHZ (these must start with a non-numeric char).
> There is also the matter of the OSSCAL trim value, programmed at the
> last memory location, but this is too complicated for a blink-a-LED
> program.
OSCCAL, another PITA...
PICs with OSCCAL in the last word of program memory have that address as
reset vector. The instruction there is movlw and the next program
instruction is at address 0x0000. The program is supposed to store W in
OSCCAL as first instruction (at address 0). Well, that seems a task for
the compiler! I don't see how an application programmer could handle
this with the current JalV2 compiler.
Regards, Rob.
--
Rob Hamerling, Vianen, NL (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
-~----------~----~----~----~------~----~------~--~---