Searching \ for 'Generating clock signal' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page:
Search entire site for: 'Generating clock signal'.

Truncated match.
PICList Thread
'Generating clock signal'
1999\07\22@013445 by Graham, Peter

part 0 636 bytes
The ADC needs an external clock signal to do the conversion which at the
moment is generated in software on a normal output pin. My problem is that
because the signal is generated in software I can't do anything during that
time and I would also like to increase the frequency of the signal to reduce
the conversion time.

The AD7890 has a max frequency of 2.5Mhz and the oscillator driving the PIC
is at 4.9152Mhz, so I can't use the osc. directly.

I would like to have a freq of at least 1Mhz. Am I dreaming or is this
possible preferably without external components as there is no room on the
existing board design.

Peter Graham

1999\07\22@015000 by Sean H. Breheny

face picon face
Hi Peter,

What about using the 16C63's CCP module to generate 50% duty cycle PWM at
as high a frequency as possible? I am not familiar with the CCP modules, so
I took a quick look at the datasheet. It wasn't obvious to me what the
maximum frequency is because I can't see where it tells you the minimum
allowed resolution. It would be great if you could set it to 2 bit
resolution (and give it either 25% or 75% duty,it might work) or 3 bit
resolution (and give it 50%). I looks to me as if you could get a few
100kHz that way.


At 03:31 PM 7/22/99 +1000, you wrote:
{Quote hidden}

access\winba\eudora\attach\Generating clock signal"
| Sean Breheny
| Amateur Radio Callsign: KA3YXM
| Electrical Engineering Student
Save lives, please look at
Personal page: ICQ #: 3329174
NetZero - We believe in a FREE Internet.  Shouldn't you?
Get your FREE Internet Access and Email at

1999\07\22@024125 by Graham, Peter

I also looked at the CCP module and to generate approx 1Mhz  the resolution
would be 2 bits and the PR2 value would be 0 which I am not sure if it is
allowed. The datasheets on the PWM section are as clear as mud when trying
to generate high frequencies.

Maybe someone else could shed some light on this area please.


Peter Graham

> {Original Message removed}

1999\07\22@101619 by Barry King

>I would like to have a freq of at least 1Mhz. Am I dreaming or is
>this possible preferably without external components as there is no
>room the existing board design.

I think the fastest PWM is OSC/4, 50% duty cycle.  I use it to drive
charge pumps this way.  Set the period to 00000000 10
and set the duty cycle reg to zero:

;this is for a 16C76, other chips with CCP are similar.
;Capture / Compare / Pwm 1 CONtrol bits: Set up as constant freq out:
;CCP1CON<7:6> are not implemented, leave at 0. CCP1CON<7:6> =00
;Duty Cycle 1 Bit 1:Bit0 = 10                  CCP1CON<5:4> =10
;CCP1 Mode: PWM mode, CCP1M<3:0> = 11xx     CCP1CON<3:0> = 1100
;CCP1CON = 00101100b = H'2C'
CCP1PWM    EQU    H'2C'   ;to write to CCP1CON

;Init CCP1 to run at 50% duty cycle:
;TRIS RC2 to output
          BCF     TRISC,2             ;let CCP1 drive pin 13
;Timer 2 is running at Tosc / 4, prescaler 1:1 so LSB of PWM is osc.

          MOVLW   0
          MOVWF   PR2                 ;Timer 2 period register
          BCF     STATUS, RP0         ;bank 0 for control regs
          MOVLW   0
          MOVWF   CCPR1L              ;PWM period MSB = 00000000
;two Tosc high time
          MOVLW   CCP1PWM             ;PWM period = 00000000 10
          MOVWF   CCP1CON

Barry King, KA1NLH
Engineering Manager
NRG Systems "Measuring the Wind's Energy"
Hinesburg, Vermont, USA

1999\07\22@203605 by Thomas Brandon

picon face
I am currently doing (very) preliminary investigations on a similar project
(PIC->ADC0804). The ADC0804 handles up to about 1MHz but really wants
640kHz. Currently i'm looking at driving it off an RC network (as shown in
specs). This would only need a couple of components and no chips so should
be fairly space efficient (not sure if an RC is up to 1MHz tho). As the ADC
interrupts on data ready the timing doesn't matter I just wait for the
interrupt (it takes a variable no. of cycles as it's succesive approx. so
knowing timing is no help).

The specs for the ADC also give a way of wiring it up in a free running
mode. I believe you tie the interrupt to the "Start Conversion" line so it
continuously samples. If you only need to monitor 1 line this could work.
You could just leave the ADC running and che check it's output whenever you
want. In that way you only need 8 pins (for ADC0804) and timing is not an
issue. You could still recieve the interrupt (9 pins) and thus only sample
data when it was new but this isn't really neccesary IMHO. Just keep
monitoring when you have a handful of spare cycles and if it's changed
resend it.

Another option would be to do what the PIC does (in external hardware) and
get a 1/4 speed clock from the osc. and drive the ADC of this. This should
give you a ~1.25MHz clock. Sorry but I'm pretty new to PICs so can't
remember the circuit. It takes something like 3 Flip Flops to do it so one
quad FF chip should do it.

Hope that helps,
{Original Message removed}

More... (looser matching)
- Last day of these posts
- In 1999 , 2000 only
- Today
- New search...