PDA

View Full Version : Writing internal calibration value



ruijc
- 13th January 2008, 20:36
Hi all,

In all 12F675 pics the internal oscilator calibration value is written inside the pic and every time we save a new program ( with IC-prog for example ) we have to choose NOT to overwrite it's value.

I know that this value is different for each pic but when testing new code we have to re-program the same pic over and over again.

My question:

Is it possible ( and how ) to include in pbp's code the value so that IC-prog ( or any other ) adds the cal value ?

.

mackrackit
- 13th January 2008, 21:22
I think this may be what you are looking for.

http://www.picbasic.co.uk/forum/showthread.php?t=832&highlight=OSCCAL+register

ruijc
- 14th January 2008, 20:04
Thanks mackrackit,

With the link i found that i need to use the line:

POKECODE @$3FF, $78 ( where $78 should be replaced with my setting )

When using this with my pbp i get alot of error lines like :
[218] Address limit of 3FFh Exceeded

Did i miss something ?

mackrackit
- 14th January 2008, 20:55
Thanks mackrackit,

With the link i found that i need to use the line:

POKECODE @$3FF, $78 ( where $78 should be replaced with my setting )

When using this with my pbp i get alot of error lines like :
[218] Address limit of 3FFh Exceeded

Did i miss something ?
That should work.
What value do you have when you read 3FF?

ruijc
- 14th January 2008, 23:13
the pic's original value is 74.

Bruce
- 15th January 2008, 00:32
POKECODE @$3FF, $74 has to be the very last line of code. If you try placing this before
anything else PBP thinks you're out of code space.

ruijc
- 15th January 2008, 10:48
Thanks Bruce,

I believe you are right !

It makes perfect sense ! :)

This line should be the last line ( i did actually placed on top next with the settings :( ).

Will try this when i get home.

Thanks