Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

12F629 Bandgap calibration bits

Status
Not open for further replies.

kybert

New Member
Hi,

I've read the datasheet and th eprogramming specs for the 12F629 device, and i cannot work out what the bandgap bits in the config should be.

There are 2 options:
highest bandgap voltage (11)
or
lowest bandgap voltage (00)


What is "bandgap" and what should i use???
 
kybert said:
Hi,

I've read the datasheet and th eprogramming specs for the 12F629 device, and i cannot work out what the bandgap bits in the config should be.

There are 2 options:
highest bandgap voltage (11)
or
lowest bandgap voltage (00)


What is "bandgap" and what should i use???

Actually there are four options, 00, 01, 10, 11, not just two.

You use the value that it's set to when it comes from MicroChip, part of the programming specification is that it should copy and restore the bandgap bits (and the oscillator calibration byte as well). See note 1. on page 52 of the datasheet, section 9.1 Configuration Bits.

It doesn't really tell you much about them in the datasheet, except that they are associated with the BOD (Brown Out Detector) and POR (Power On Reset) - presumably it sets the exact level of their thresholds?.
 
OK, i just hope my programmer does that then!


so do you know exactly what they do? I've emailed microchip asking them, but im not gonna hold my breath for a responce.
 
kybert said:
OK, i just hope my programmer does that then!


so do you know exactly what they do? I've emailed microchip asking them, but im not gonna hold my breath for a responce.

I've no idea, only what I assumed above from the datasheet - but if you're not using the BOD or POR it's not likely to matter anyway.
 
kybert said:
Im using both! It is possible that my power supply may die (batteries) so i need them both.

What does it currently read?, erasing a PIC makes all bits '1', so if it's been erased both should read '1'.

What programmer software are you using?.
 
Yes the device has already been erased, the programmer did it automaticly...

Im using this programmer:

**broken link removed**
 
kybert said:
Yes the device has already been erased, the programmer did it automaticly...

Im using this programmer:

**broken link removed**

I'm not familiar with that one, and (in any case) the actual programming is performed by a processor on the board - rather than on the PC. The PC software simply transfers the data over a serial link, the on-board processor does everything else. So what's actually happening is fairly 'invisible'.

What do your bandgap bits currently read?.

I've got a number of 12F675's, I can check what mine read?.
 
Mine (i only have one) is reading '11'.

I need to set the bits to an applicable state in the HEX file config word, so i need to know what they do and what they should be. I dont have the option in the config word to "leave as they are".
 
kybert said:
Mine (i only have one) is reading '11'.

I need to set the bits to an applicable state in the HEX file config word, so i need to know what they do and what they should be. I dont have the option in the config word to "leave as they are".

Looking at the 12F629 include file, there are no options for the bandgap bits, so there's no requirement to include them in your config line. If you want to, the easiest way is probably just to include a config word like this:
Code:
__config 0x3D18

Simply work out the value manually, personally I find that a lot easier than typing a great long stream of words to do it.

As for the value, it's measured at the factory, so there's no "correct value", apart from the one which was stored in this chip originally - which, presumably, you've no way of measuring (and neither has anyone else).

Are you sure that '11' isn't the original value?, there's only four options, so there's a 25% chance it's the correct one. With only four options, it's obviously very easy to try all four possibilities, the problem is spotting any difference!.
 
That's how i am including the config word.

these is no config option to say "leave it alone" -- dam it... why do microchip do stupid things like add un-documented features to their devices! :twisted:
 
kybert said:
That's how i am including the config word.

these is no config option to say "leave it alone" -- dam it... why do microchip do stupid things like add un-documented features to their devices! :twisted:

It's fully documented, but not easy to spot :lol:

But your programmer software is supposed to take care of it, if it doesn't, it's the fault of the programmer software - not meeting the published specifications.

Anyway, I'm home from work now, so I've just checked the four 12F675's I have. Three read '00', and one reads '01'.
 
:shock:

Right, i have ordered 4 new devices from crownhill.co.uk (80p/each cheep for the 12F629 ?)

Will see what they read when they arrive - and i'll play with the programmer to see if its doing what its suposed to do.


Joe
 
the programmer software had a bug in it, whereby it would not copy the existing bandgap (calibration) bits.

This caused my devices to be rendered useless as there are too many variables to the factory set defaults, so i can do one of 2 things:

Send the devices back to microchip for re-calibration;
or
Chuck them out and buy a cupple more.


I have chosen the latter. It appears that these bits are factory set and once this data has been lost, it cannot be recovered!
 
kybert said:
the programmer software had a bug in it, whereby it would not copy the existing bandgap (calibration) bits.

This caused my devices to be rendered useless as there are too many variables to the factory set defaults, so i can do one of 2 things:

Send the devices back to microchip for re-calibration;
or
Chuck them out and buy a cupple more.


I have chosen the latter. It appears that these bits are factory set and once this data has been lost, it cannot be recovered!

It's only two bits, so there are only four possible variations - so it's hardly a massive job to try them all.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top