The Godfather talking
You can run, but you can't hide.
Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
November 23, 2024, 08:12:29 08:12


Login with username, password and session length


Pages: [1]
Print
Author Topic: how to protect oscillator calibration value  (Read 5621 times)
0 Members and 1 Guest are viewing this topic.
sadman
Hero Member
*****
Offline Offline

Posts: 709

Thank You
-Given: 1828
-Receive: 2889


Sow The Seeds of Love


« on: February 20, 2013, 07:53:43 07:53 »

is there any command in Mikro c compiler to protect oscillator calibration being changed during programing

sadman
Logged
Gallymimu
Hero Member
*****
Offline Offline

Posts: 704

Thank You
-Given: 152
-Receive: 214


« Reply #1 on: February 21, 2013, 06:54:18 18:54 »

what oscillator calibration are you talking about.  Are you talking about the OSCTUN bits in PIC processors?
Logged
piccolo
Active Member
***
Offline Offline

Posts: 190

Thank You
-Given: 823
-Receive: 957


« Reply #2 on: February 21, 2013, 08:01:40 20:01 »

is there any command in Mikro c compiler to protect oscillator calibration being changed during programing

sadman

If you use mikroProg suite for PIC, click on the button "config" and select the box "OSCCAL Values Protect."

If you use another programmer, looks for a similar menu item.

There is no way through mikroC compiler.
Logged
sadman
Hero Member
*****
Offline Offline

Posts: 709

Thank You
-Given: 1828
-Receive: 2889


Sow The Seeds of Love


« Reply #3 on: February 22, 2013, 04:29:15 04:29 »

what oscillator calibration are you talking about.  Are you talking about the OSCTUN bits in PIC processors?

yes osctun or osccal bit, yes i know it can be done in Mikroprog but if i have used different programmer then it can be configure in code to protect it,

it can easily done in proton plus compiler

sadam
Logged
piccolo
Active Member
***
Offline Offline

Posts: 190

Thank You
-Given: 823
-Receive: 957


« Reply #4 on: February 22, 2013, 05:27:49 17:27 »

yes osctun or osccal bit, yes i know it can be done in Mikroprog but if i have used different programmer then it can be configure in code to protect it,
it can easily done in proton plus compiler

sadam

Yes, however you must read the value of osccal before writing it.
Every single chip has its value of osccal.
For example, in the pic16F675, the value of osccal is situated in the last location of memory program.
I don't use proton and I don't know how it inserts the value of osccal, but you can try to read the value of osccal before programming the chip and then insert it in your mikroC program to be rewritten in his own location of memory program.
I have never tried but, maybe it works.
For info, you can see the document "memory programming specification" for your device, from the Microchip site.
Logged
Gallymimu
Hero Member
*****
Offline Offline

Posts: 704

Thank You
-Given: 152
-Receive: 214


« Reply #5 on: February 22, 2013, 05:30:02 17:30 »

I could be wrong but I THOUGHT, that typically programmers didn't overwrite those factory oscillator calibrations unless told to do so.  I don't often use other tools besides microchip's though.
Logged
piccolo
Active Member
***
Offline Offline

Posts: 190

Thank You
-Given: 823
-Receive: 957


« Reply #6 on: February 22, 2013, 05:41:34 17:41 »

I could be wrong but I THOUGHT, that typically programmers didn't overwrite those factory oscillator calibrations unless told to do so.  I don't often use other tools besides microchip's though.

If you totally erase the device, the value of osccal is also erased.
Then it will need to write it again, but it needs to write the correct value.
Logged
ron
Newbie
*
Offline Offline

Posts: 26

Thank You
-Given: 12
-Receive: 17


« Reply #7 on: June 17, 2024, 08:20:49 08:20 »

Posted this question before but cant find the post right now.
If I am using an external crystal oscillator does the OSCCAL value really matter.
My understanding is that its only important if your using the internal oscillator.
Logged
Sideshow Bob
Cracking Team
Hero Member
****
Online Online

Posts: 1001

Thank You
-Given: 231
-Receive: 983



« Reply #8 on: June 17, 2024, 07:39:53 19:39 »

Posted this question before but cant find the post right now.
If I am using an external crystal oscillator does the OSCCAL value really matter.
My understanding is that its only important if your using the internal oscillator.
That is also my impression. The internal oscillator is a RC oscillator. And hence it is not as accurate as a crystal oscillator. But it will be repetitive "wrong" so it can be tuned. If you use a crystal the accuracy will be determined by the crystal. So the OSCCAL value will not be used at at all. If your goal is accuracy do not use the internal oscillator. But for most hobbyist application it will work just fine if tuned. And I also believe they are tuned from factory.
So to sum it up For internal oscillator use OSCCAL value will be used. Any other clock source it will NOT be used       
Logged

I have come here to chew bubblegum and kick ass... and I'm all out of bubblegum
Pages: [1]
Print
Jump to:  


DISCLAIMER
WE DONT HOST ANY ILLEGAL FILES ON THE SERVER
USE CONTACT US TO REPORT ILLEGAL FILES
ADMINISTRATORS CANNOT BE HELD RESPONSIBLE FOR USERS POSTS AND LINKS

... Copyright © 2003-2999 Sonsivri.to ...
Powered by SMF 1.1.18 | SMF © 2006-2009, Simple Machines LLC | HarzeM Dilber MC