Sonsivri
 
*
Welcome, Guest. Please login or register.
Did you miss your activation email?
December 11, 2016, 03:11:02 03:11


Login with username, password and session length


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

Posts: 231

Thank You
-Given: 718
-Receive: 688



« on: February 20, 2013, 08:53:43 08: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: 579

Thank You
-Given: 101
-Receive: 151


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

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

Posts: 138

Thank You
-Given: 318
-Receive: 548


« Reply #2 on: February 21, 2013, 09:01:40 21: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
Active Member
***
Offline Offline

Posts: 231

Thank You
-Given: 718
-Receive: 688



« Reply #3 on: February 22, 2013, 05:29:15 05: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
V.I.P
Active Member
*****
Offline Offline

Posts: 138

Thank You
-Given: 318
-Receive: 548


« Reply #4 on: February 22, 2013, 06:27:49 18: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: 579

Thank You
-Given: 101
-Receive: 151


« Reply #5 on: February 22, 2013, 06:30:02 18: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
V.I.P
Active Member
*****
Offline Offline

Posts: 138

Thank You
-Given: 318
-Receive: 548


« Reply #6 on: February 22, 2013, 06:41:34 18: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