![]() | ![]() | ![]() |
| | |||||||
| Micro Controllers Discuss all aspects of micro controllers - building them, coding them, etc. All controllers are welcome - PIC, BASIC, Z8 Encore!, etc. |
| | LinkBack | Thread Tools | Display Modes |
| | (permalink) |
| hey guys, I am having trouble trying to get the internal oscillator of the 16F819 to actually work. Do I need any commands in the program to calibrate or startup the oscilator? I'm using IC-Prog for now and it gives me the option of :LS, HS, XT,EXT Clock, IntRC, IntRC Clockout, ExtRC and ExtRC Clockout. -I know I should use either IntRC or IntRC Clockout. But whats the difference between the 2 and which one do I need??? I also have the options of using fuses: watch dog timer power up timer Master clear Brown out Debugger and CCP1 selection -Can anyone give me a brief description of these fuses, particurly "brown out"??? -So how do i get my internal oscillator working??? (well how did you guys get your working) plz help me guys, i'm totally stumped on this problem :? | |
| |
| | (permalink) |
| The two IntRC options both use the internal oscillator, but the second one outputs itself on one of the PIC pins - if you don't require this (and most applications won't) chose the plain IntRC. I've not used a 16F819, but the 'brown out' option affects the reset capability of the chip - if the HT supply to the chip drops it can corrupt the running program, the 'brown out' option causes the chip to do a hardware reset if the HT drops sufficiently. If you read the datasheet they will all be explained, mostly you tend to set them the same once you've decided on how you want them - only altering them when you have a particular need. If you set the 'watch dog timer' you need to place 'CLRWDT' instructions throughout your program - if one of these doesn't appear before the timer runs out the PIC is reset - it's intended to rescue a program stuck in an endless loop. | |
| |
| | (permalink) | |||||||
| Quote:
Quote:
Quote:
Quote:
With master clear switched to internal you can no longer reset the pic from outside (of course, if you turn the pic off and back on it is also reset) but the MCLR pin can now be used as a digital input pin. Quote:
Quote:
Quote:
| ||||||||
| |
| | (permalink) |
| hehe, you have to type pretty fast to beat nigel :lol: | |
| |
| | (permalink) | |
| Quote:
| ||
| |
| | (permalink) |
| wow, you guys are fast eh?? Exo, what software programmer are you running?? IC-Prog doesn't have a fuse called INTOSC RC. maybe i have have an old version of IC-Prog. If I enabled "debugger", would i need an LCD to display whats happening inside the PIC or would i use my computer?? thanx for your quick replies.
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
| | (permalink) |
| I'm using both Winpicprog and IC-prog. In IC-Prog 1.05C it's called "IntRC" at oscillator settings. But you should add the config settings in your code. When you are programming your assembler file you should add a command to the top of your code __CONFIG number (thats 2 underscores _ ) In MPLAB IDE (a free pic development program available from microchips website) you can generate the number you need. this way the settings are incorporated into your code itself and you don't need to set it in ic-prog. debugger option is for an In-circuit debugger. This is a device connected to the PC. | |
| |
| | (permalink) |
| How would I write that in BASIC?? Sorry i'm not familiar assembler. But either way they should work right?? Otherwise i think my 4 brand new 819's are dead and useless :x
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
| | (permalink) |
| Picbasic normally sets the configuration settings for you. just change the oscillator to IntRC in IC-prog. Leave the other settings, they should be set right by basic | |
| |
| | (permalink) |
| Thanks for your input guys, I found (I think) the problem. The problem was the programmer or programmer software. verify ocassionally works, and when it does it shows that the chip was programmed to use an LP oscillator. I'm pointing the finger at the software most likely. :evil: When verify doesn't work it is because IC-Prog has automatically set the fuse Code Protect on.
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
| | (permalink) |
| What programmer hardware do you use ? Are you using long and/or unshielded cables between pc/programmer and programmer/Pic. this tends to give 'occasional' problems. | |
| |
| | (permalink) |
| I'm using a JDM based programmer. Yeh the cable is shielded, and its 1.5 metres long. funny, the programmer wasn't playing up last night. I just did some more experimenting. The oscillator works, but at a very low speed. I programmed this into it last night when the programmer was working. Code: Poke trisB, 0 'configure portb to output only Test: poke portB, 1 'turn RB0 high poke portb, 0 'turn RB0 low goto test 'repeat for ever I can program other chips succesfully (16F84a) but not the 819. Sounds like i've killed the chips.
__________________ www.winpicprog.co.uk - Great PIC language tutorials. | |
| |
| | (permalink) |
| If it runs then the pic is probabely not defective. Some oscillator setting will still be wrong or something. I would try to write a little assembly program and see how it acts. could also be the basic acting up. | |
| |