Electronic Projects, forums and more.

Go Back   Electronic Circuits Projects Diagrams Free > Electronics Categories > Micro Controllers


Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc.

Reply
 
LinkBack Thread Tools Display Modes
Old 23rd December 2003, 11:50 AM   (permalink)
Default 12F675 Calibration?

I did something stupid today. I bought a 12F675, and without reading the datasheet i erased it the first thing i did. Very stupid!

Now the OSC calibration values are gone, aren't they? How can i get them back? The datasheet says something about that it is possible to get them form Microchip.

Help!!!

How shall i do?


Is the value uniqe for every single PIC, or is it the same for all of them?
brodin is offline  
Old 23rd December 2003, 01:01 PM   (permalink)
Default Re: 12F675 Calibration?

Quote:
Originally Posted by brodin
I did something stupid today. I bought a 12F675, and without reading the datasheet i erased it the first thing i did. Very stupid!

Now the OSC calibration values are gone, aren't they? How can i get them back? The datasheet says something about that it is possible to get them form Microchip.

Help!!!

How shall i do?


Is the value uniqe for every single PIC, or is it the same for all of them?
It's unique for each one, although those from the same production batch may well be the same (or similar).

I wouldn't have thought MicroChip could tell you what it might be, they would need to be able to recognise that exact chip to do so.

I've got some at home, I'll check what their calibration bytes are and let you know later (unless someone does it first?).

Apart from that you will have to measure it - write a program to output a frequency on one of the pins and measure the frequency. Run the same program on a known correct chip (even a 4MHz 16F84 will do) and compare the frequencies. Adjust the calibration byte in the 12F675 until it runs at as close a frequency as possible.

If you have access to an oscilloscope you could compare them side by side with one feeding the X input and the other the Y input.

Although it's not much help to you, the current working version of WinPicProg (which will be the next released version) reads the calibration byte before erasing or programming - and writes it back for you :lol:

I haven't been caught out (yet!), but I made sure my software made it difficult to be caught out.
Nigel Goodwin is offline  
Old 23rd December 2003, 09:32 PM   (permalink)
Default

Ok, yeah i have an oscilloscope. It would be great if you could send me your bytes, so i have something to start from!
brodin is offline  
Old 24th December 2003, 07:37 PM   (permalink)
Default

Quote:
Originally Posted by brodin
Ok, yeah i have an oscilloscope. It would be great if you could send me your bytes, so i have something to start from!
I've got four 12F675's, their calibration bytes are:

$347C
$3478
$3478
$3470
Nigel Goodwin is offline  
Old 24th December 2003, 07:39 PM   (permalink)
Default

I tested 3 of 'em

3478h for 2 of 'em
347Bh for the other one
Exo is offline  
Old 24th December 2003, 10:58 PM   (permalink)
Default

Okay, thanx! Now i have something to start on!
brodin is offline  
Old 25th December 2003, 12:09 PM   (permalink)
Default

How do i set the value in the code?

I am using PicBasic Plus 2.13

I tried this:

DEVICE 12F675
SET_OSCCAL
OSCCAL = $3478

But then the compiler says:
*** Value will overflow a BYTE size variable! ***


How do i do it in ASM?
brodin is offline  
Old 25th December 2003, 06:26 PM   (permalink)
Default

Quote:
Originally Posted by brodin
How do i do it in ASM?
In assembler just add the lines:
Code:
            ORG     0x03FF
            RETLW   0x78
Where '0x78' is the last half of the hexadecimal word (the RETLW is the first half), address 0x3FF is where it's stored.
Nigel Goodwin is offline  
Reply

Bookmarks

Thread Tools
Display Modes





All times are GMT. The time now is 04:21 AM.


Electronic Circuits  |  Learning Electronics
Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.

eXTReMe Tracker