Searching \ for 'PIC 16X84' in subject line. ()
Make payments with PayPal - it's fast, free and secure! Help us get a faster server
FAQ page: techref.massmind.org/techref/microchip/devices.htm?key=pic
Search entire site for: 'PIC 16X84'.

Truncated match.
PICList Thread
'PIC 16X84'
1998\04\16@035250 by Andrejus Stavickis

flavicon
face
part 0 635 bytes
in configuration i have used XT oscillator and in hardware ceramic 10 MHz
oscillator:

+----------------------------------o clkin
|
+--------------||------+
|                      |
|                      -
+----+
    |
    -
    o
    -
    |
+----+                 -
|                      |
+--------------||------+
|
+----------------------------------o clkout

and in after this on 5 pin i have got sometnig like:

+----+    +
|    |    |
|    |    |
|    |____|
:         :
:         :
freq something like 1.25 MHz. Is it normally or i have missed somenthing ?

       any help will be greatefully apprecated

--Andrejus

1998\04\16@041609 by Andrew Warren

face
flavicon
face
Andrejus Stavickis <spam_OUTPICLISTTakeThisOuTspamMITVMA.MIT.EDU> wrote:

> i have made some hardware, but pic is not running fast enought:
> ........
>         bsf     PORTB,5
>         bcf     PORTB,5
> ........
>
> in configuration i have used XT oscillator and in hardware ceramic
> 10 MHz oscillator
> ....
> and in after this on 5 pin i have got sometnig like:
>
> +----+    +
> |    |    |
> |    |    |
> |    |____|
> :         :
> :         :
> freq something like 1.25 MHz. Is it normally or i have missed
> somenthing ?

Andrejus:

This is exactly normal; each PIC instruction cycle takes 4 clock
cycles, so your "BSF" and "BCF" instructions each take 0.4
microseconds.

-Andy

=== Andrew Warren - .....fastfwdKILLspamspam@spam@ix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\04\16@054831 by Andrejus Stavickis

flavicon
face
part 0 1073 bytes
----------
From:   Andrew Warren
Sent:   1998 m. Balandis 16 d. 12:14
To:     PICLISTspamKILLspamMITVMA.MIT.EDU
Subject:        Re: PIC 16X84

Andrejus Stavickis <.....PICLISTKILLspamspam.....MITVMA.MIT.EDU> wrote:

{Quote hidden}

Andrejus:

This is exactly normal; each PIC instruction cycle takes 4 clock
cycles, so your "BSF" and "BCF" instructions each take 0.4

ok, but why when ceramic oscillator is 10MHz, i have got 1.25MHz, as i
understand it shoul be something like 10/4 EQ 2.5 ...

microseconds.

-Andy

=== Andrew Warren - EraseMEfastfwdspam_OUTspamTakeThisOuTix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

--Andrejus


1998\04\16@062537 by Marco DI LEO

flavicon
face
Andrejus Stavickis wrote:
> ok, but why when ceramic oscillator is 10MHz, i have got 1.25MHz, as i
>  understand it shoul be something like 10/4 EQ 2.5 ...

No. At 10MHz you have an instruction rate of 10/4=2.5MHz that gives you
1/2.5=0.4uS per instruction cycle.
Consider the following code:

loop    bsf     PORTB,5      ;1 cycle
       bcf     PORTB,5      ;1 cycle
       goto    loop         ;2 cycle

So you have your output pin ON for 1 cycle and OFF for 3 cycle giving a
total of (1+3)*0.4=1.6uS or 625KHz with 25% duty cycle. (Actually I
don't know how do you get 1.25 MHz...)

To get a symmetric wave try this:

       movlw   1<<5         ;Compute the bitmask for the output pin
loop    xorwf   PORTB, F     ;Invert the output pin value
       goto    loop

This gives you a 3 cycle ON, 3 cycle OFF wave on pin 5 of port B.

----
Marco DI LEO                  email: m.dileospamspam_OUTsistinf.it
Sistemi Informativi S.p.A.    tel:   +39 6 50292 300
V. Elio Vittorini, 129        fax:   +39 6 5015991
I-00144 Roma
Italy

1998\04\16@062951 by Andrew Warren

face
flavicon
face
Andrejus Stavickis <@spam@PICLISTKILLspamspamMITVMA.MIT.EDU> wrote:

> > each PIC instruction cycle takes 4 clock cycles, so your "BSF"
> > and "BCF" instructions each take 0.4 microseconds.
>
> ok, but why when ceramic oscillator is 10MHz, i have got 1.25MHz,
> as i understand it shoul be something like 10/4 EQ 2.5 ...
> microseconds.

Andrejus:

No; the BSF takes 0.4 microseconds and the BCF takes another 0.4
microseconds, so the total period is 0.8 microseconds.  Therefore,
the frequency is:

          1
   ---------------- = 1.25 MHz.
   0.8 microseconds

-Andy

=== Andrew Warren - KILLspamfastfwdKILLspamspamix.netcom.com
=== Fast Forward Engineering - Vista, California
=== http://www.geocities.com/SiliconValley/2499

1998\04\16@070441 by H.P. de Vries

flavicon
face
In message Thu, 16 Apr 1998 11:46:47 +-300,
 Andrejus Stavickis <RemoveMEandrejTakeThisOuTspamWRITEME.COM>  writes:

{Quote hidden}

Hi,

Calculation is like this:

freq = 10 Mhz, so each cycle is 10/4  = 2.5 Mhz
Your code is 2 cycles, so the frequency on the output is 2.5 / 2 = 1.125 MHz

Hans

1998\04\16@175942 by Russell McMahon

picon face
Andy's explanation is correct but a little more explanation
may help.

A BSF and BCF instruction both implement their actions(a set
and a clear respectively)  at the same point in the cycle.
As BCF & BSF are 1 cycle instructions and the clock is 10MHz
and the clock is divided by 4, each cycle is 4 x 100nS =
400nS. In this case as the instructions are implemented one
after the other there is a 1 cycle delay between the rise
and the fall. The width of the high pulse is therefore 400
nanoseconds  as expected. If you implement a series of these
you get an overall cycle (one high pulse and one low pulse)
of 800 nS = 1.25 MHz.

The biggest confusion MAY come from the fact that the 10 MHz
clock is divided by 4 to produce one basic PIC cycle.

{Original Message removed}

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