OSCTRIM = Optional on QY4A

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

OSCTRIM = Optional on QY4A

1,299 Views
jag
Contributor IV
Hi,
I'm using Codewarrior 3.1 and the Cyclone to program a QY4A micro.

I've "problem" setting the OSCTRIM. With the QY2 (and QY4)  trimming the oscillator with OSCTRIM = Optional (wich copy the value stored in the address 0xFFC0 in the OSCTRIM register) works fine.
With the QY4A there is an error (well maybe is done correctly, and it's me that has misunderstanded) in the mc68hc908qy4a.c and mc68hc908qy4a.h files.
In the qy4a.h there is:

extern const volatile OptionalSTR _Optional @0x0000FFC0;
#define Optional                        _Optional.Byte

but in the qy4.h there is

extern volatile OptionalSTR _Optional @0x0000FFC0;
#define Optional _Optional.Byte

and in the qy4a.c

the line declaring OptionalSTR _Optional is commented, and when I compile of course the linker can't find Optional.

It's this right? or I can eliminate the const and uncomment the line in the .c like for the QY4?

Thanks Bye Jack
Labels (1)
0 Kudos
Reply
1 Reply

360 Views
jag
Contributor IV
Ok, I did some tests.

Modifying the qy4a.h and qy4a.c to match the qy4.c/.h all seem to work flawlessy. This means eliminating the const in the .h and uncommenting the lines in the .c.

The cyclone now calcultate the trim value and store it in 0xFFC0 like it's supposed to do.


Bye Jack
0 Kudos
Reply