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
 
Tools
Old 25th April 2004, 12:52 PM   #1
Default icprog - osc settings

I am using pic basic with the pic16f627, at first I couldn't get the int osc to work by messing about with the settings in icprog, and I ended up putting the following in the top of the code

Code:
@ device INTRC_OSC_NOCLKOUT
this worked, but nor I want to use an external 3 pin 20mhz ceramic resonator (the '627 is of the 20mhz variety), none of the setting in icprog which look like they might be right work

does anyone know which setting it should be out of LP, XT, HS, ExtClk, IntRC I/O, IntRC Clockout, ER I/O, ER Clockout, i've tried ExtCLK and ER I/O, or could it be whatever I choose it is not being written, so in which case I'd need a line that goes at the top of the code. at the moment all i've got there is
Code:
define osc 20
Thanks

Adam
Adam is offline  
Old 25th April 2004, 02:05 PM   #2
Default

Use HS for 20Mhz
Exo is offline  
Old 25th April 2004, 02:10 PM   #3
Default

thanks for the info, I will give it a go now, but I am interested to know the logic behind it being HS if you know??
Adam is offline  
Old 25th April 2004, 02:41 PM   #4
Default

It's explained somewhere in the datasheets
LP = Low power crystal/resonator
XT = normal crystal/resonator up to 4Mhz
HS = high speed crystal/resonator 4Mhz +
ExtClk = external clock source on ClkIn
IntRC I/O = internal RC oscillator (only on some pics), oscillator pins can be used as normal IO
IntRC Clockout = internal oscillator, oscillator pins output the clock generated by the internal oscilator

never used ER actually :?
Exo is offline  
Old 25th April 2004, 04:24 PM   #5
Default

ER is an RC oscillator option, using just an external resistor - this allows you to vary the oscillator frequency over a fairly wide range - something you can't do with the internal RC oscillator. However, it does use at least one PIC pin, and could use 2 (if you use the CLKOUT setting).

You should really set all the fuse options in your source code, you don't mention what you are using to write your code, but my tutorials use assembler and set the options with a '__config' statement. It's all explained in the MPASM help file.

Just like Exo, I've never used the ER option either, I've never had the need - but it's always there if needed.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Reply

Tags
icprog, osc, settings

Thread Tools
Display Modes




All times are GMT. The time now is 11:12 PM.


Electronic Circuits  |  Learning Electronics
eXTReMe Tracker