Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
April 19, 2024, 03:20:44 15:20


Login with username, password and session length


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

Posts: 684

Thank You
-Given: 1752
-Receive: 2601


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: 151
-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: 188

Thank You
-Given: 807
-Receive: 939


« 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: 684

Thank You
-Given: 1752
-Receive: 2601


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: 188

Thank You
-Given: 807
-Receive: 939


« 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: 151
-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: 188

Thank You
-Given: 807
-Receive: 939


« 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
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