OSCTRIM = Optional on QY4A

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

OSCTRIM = Optional on QY4A

1,301件の閲覧回数
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
ラベル(1)
0 件の賞賛
返信
1 返信

362件の閲覧回数
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 件の賞賛
返信