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 6th April 2007, 03:50 PM   (permalink)
Default PIC clock/4 output -- why ?

If for example you set _INTRC_OSC_CLKOUT in the configuration word then you typically end up with a clk/4 signal from the CLKOUT pin. In what sort of real-world circumstances is this useful ?

regards..
tiny2 is offline  
Old 6th April 2007, 04:58 PM   (permalink)
Default

Is it divided by four?, I've never looked at the internal oscillator operation for this, but one use for it is to use one crystal for two PIC's, with the output from one feeding the input on the other.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 6th April 2007, 05:55 PM   (permalink)
Default

It's divided by 4 only when it's a clock out (not osc drive)
__________________
Bill
Smart Kits build Smart People

http://www.blueroomelectronics.com
blueroomelectronics is offline  
Old 7th April 2007, 03:12 AM   (permalink)
Default

That's my biggest gripe with PIC's and why I love the AVR architecture so much. AVR's run at the clock speed, no divider. The instruction pipeline is paralleled, which means it can be 4 times faster for a given clock rate.

It would be useful for a PIC if you needed to time an external circuit to occur at the same clock cycle as the instruction pipeline, not the native clock. I'm sure the external clock is generated during a specific cycle of the Instruction clock for the pic, perhaps to allow high precision timeing with an external circuit.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."

Last edited by Sceadwian; 7th April 2007 at 03:17 AM.
Sceadwian is offline  
Old 7th April 2007, 07:47 AM   (permalink)
Default

Quote:
Originally Posted by Sceadwian
That's my biggest gripe with PIC's and why I love the AVR architecture so much. AVR's run at the clock speed, no divider. The instruction pipeline is paralleled, which means it can be 4 times faster for a given clock rate.
Presumably the AVR uses a clock multiplier?, like the 18F series does, which runs at the external clock rate as well.

How long are AVR instructions?, and how many instruction cycles do they take?, 16F PIC ones all single word, and almost all take only a single instruction cycle. The 18F gets more complicated, with some double word instructions.
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 7th April 2007, 09:03 AM   (permalink)
Default

The AVRs are quite impressive, typically running at 20MHz and with instruction times of 1 cycle. I haven't used them yet but am thinking of getting a dev kit to have a play. Have a look at the ATtiny13 an 8 pin 20MIPS chip with 10bit ADC.

Mike.
Pommie is online now  
Old 8th April 2007, 12:55 AM   (permalink)
Default

No Nigel, the processors architecture is such that it is fetching the next instruction while the current one is executing, so it's instructions are executed at the clock speed. Word and multiplication instructions take 2 cycles. Jumps go from 2-4 clocks. Most memory instructions are 2 cycle. It's greatest advantage over PIC's is in basic arithmetic operations and I/O instructions are all single cycle. Go to Atmel's site and grab the Instruction Set summary if you want, it tells the length of each instruction.
Optimized AVR code can be up to 4 times faster or 4 times the resolution of PIC code.
Actually AVR's typically run at 16mhz, 20mhz is not as common. I've heard some reports of moderate over clocking success but at that point the flash read times hold it back.
There are a few AVR's that have PLL modules for high speed PWM (100khz 8 bit duty cycle) basically for motor control or buck/boost applications.
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."

Last edited by Sceadwian; 8th April 2007 at 12:57 AM.
Sceadwian is offline  
Old 8th April 2007, 01:06 PM   (permalink)
Default

[quote=Sceadwian]No Nigel, the processors architecture is such that it is fetching the next instruction while the current one is executingQUOTE]

Don't most processors do that anyway?, I'm pretty sure the PIC does?, and the ancient 6502 certainly did.

However, pre-fetching the next instruction doesn't mean the processor runs at the external clock speed, processors which don't do it tend to require a MUCH faster external clock than those that did (such as Z80 vs 6502).
__________________
PIC programmer software, and PIC Tutorials at:
http://www.winpicprog.co.uk
Nigel Goodwin is offline  
Old 8th April 2007, 08:06 PM   (permalink)
Default

Then it's just the way the instruction cycle is pipelined, though there are options for running a prescaler if you need to slow the chip down (to reduce power), and the ones with the high speed PLL can run from a divided high speed PLL clock. It's one of the things they pride their chips on (1MIPS per Mhz)
__________________
"Because I be what I be. I would tell you what you want to know if I
could, mum, but I be a cat, and no cat anywhere ever gave anyone a
straight answer, har har."
Sceadwian is offline  
Reply

Bookmarks

Thread Tools
Display Modes



Similar Threads
Title Starter Forum Replies Latest
PIC 12F629 to PIC 12F683 e.chain Micro Controllers 11 28th February 2007 01:05 AM
PIC Project advice - doubling frequency coze Micro Controllers 8 26th February 2007 08:05 PM
Newcomers, please read! (PIC regarded) Upd. 0xD Jay.slovak Micro Controllers 0 17th April 2005 02:05 PM
Output going high on power up?!?! 2camjohn Micro Controllers 5 23rd March 2004 07:49 PM
How to design such output stage eeglp Electronic Projects Design/Ideas/Reviews 4 8th April 2003 07:01 PM



All times are GMT. The time now is 07:30 AM.


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

eXTReMe Tracker