I have writting a program than does something for x amount of time. on MPLAB, it runs perfectly. I just burned the chip today, and my program works , but i noticed that my operation run for about 5% longer than designed.
what is the range that the internal clock is suppose to run? I didn't see anything in the data sheet.
I have writting a program than does something for x amount of time. on MPLAB, it runs perfectly. I just burned the chip today, and my program works , but i noticed that my operation run for about 5% longer than designed.
what is the range that the internal clock is suppose to run? I didn't see anything in the data sheet.
Are you installing the calibration value, the 4MHz oscillator is only free running (so will drift with temperature somewhat) but the calibration byte allows you to adjust it.
The first line of your code should be:
MOVWF OSCCAL ; Store the factory osc. calibration value
The reset vector of a 12C50x isn't 0x000, it's the highest byte of available memory - which is where the calibration byte is stored. On a reset this last word is executed, it consists of MOVLW ??, where the ?? is the actual oscillator calibration data. The address counter than rolls over, moving to 0x000 where you store the contents of W in the required register.
It's very commonly overlooked, you wouldn't believe how many people erase their UV 12C508's without making a note of the calibration value :lol:
I've tried to make my programming software more user friendly, giving warnings if you try to erase it, or overwrite it with another value, or even try to write to a chip with a blank calibration value. For the 12F675, an 8 pin FLASH chip, which also has a calibration byte, my software automatically reads and restores the calibration byte whenever you erase or write the chip.
I presume you are using brand new blank 12C508's?, they are OTP (One Time Progammable) so if you've written to them already you can't use them again. A better choice now is probably the 12F675, an 8 pin FLASH chip.
well, i tried to burn a 16f84A and it worked....was thinking there was a problem with the software, or my computer.... so i tried to burn another 12c508A chip, but it got farther, and then stopped. now i figured it could be something weird with my computer. i then booted to dos so i could use the dos version of my programmer, and i tried to reburn the last chip that got screwed up and it worked. not sure why. the other two wouldn't even try to burn.
put the newly burned chip in my circuit, and the time is much better now.... Thanks for your help with the osccal!!