OSCTRIM = Optional on QY4A

取消
显示结果 
显示  仅  | 搜索替代 
您的意思是: 

OSCTRIM = Optional on QY4A

1,597 次查看
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 回复

658 次查看
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 项奖励
回复