Can i measure 2 secs with pulsin?


Results 1 to 12 of 12

Threaded View

  1. #9
    Join Date
    Feb 2010
    Posts
    15


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by tenaja View Post
    And what would be the problem with using a 1MHz clock?

    YES--Of COURSE you can use Pulsin for a 2 second pulse! Most PIC's have internal clocks that are capable of it. Heck, if you need a faster clock for other stuff, just slow down (i.e. change osccon) right before the pulsin and put it back after.
    Tenaja there is a problem, when i code this:

    Code:
          OPTION_REG = $07                                                                                                                
          ANSEL      = $00     'para hacer funcionar todas las E/S como digitales
          TRISA      = $07     'Configura PORTA <5:3> salidas y PORTA <2:0> salidas
          TRISC      = $00     'Configura PORTC <5:0> todas salidas
          INTCON     = $00     'Interrupciones deshabilitadas
          OSCCON     = $47     'Oscilador 8MHz
          DEFINE OSC 1         '8MHz
          
    inicio:
          pulsout PORTC.5,25000
          pause 100
          goto inicio
    i get an Error:

    Error c:\picmicro\mcstud~1\pbp246\pbppic14.lib 6152 : [255] Unidefined Sybol 'PAUSEUSL'

    looking in pbppic14.lib it seems that the lowest frecuency that can be handled by PBP is 3.58MHz, but pic16f684 can handle since frecuency from 31KHz.

    But inclusive having that error I sumulate the HEX, and works, my question is, this error will give me headache????




    --EDIT--

    I took away the line

    DEFINE OSC 1 'for 1MHz oscillator

    and code was compiled just fine, the only thing is that PAUSE increments are bigger

    with DEFINE OSC 1

    PAUSE 100 'has a duration of 5mS

    without DEFINE OSC 1

    PAUSE 100 'has a duration of 400mS
    Last edited by lugo.p; - 9th March 2010 at 16:07. Reason: correcting

Similar Threads

  1. Replies: 17
    Last Post: - 12th April 2014, 02:17
  2. Funny PULSIN values: what is going on???
    By xnihilo in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 30th April 2008, 08:02
  3. Microcontroller with 2 way paging application problem
    By oneohthree in forum mel PIC BASIC Pro
    Replies: 30
    Last Post: - 20th April 2007, 17:27
  4. CCP1 and CCP2 to measure 2 frequencies together
    By bobonapoletano in forum mel PIC BASIC Pro
    Replies: 0
    Last Post: - 28th December 2005, 07:34
  5. PULSIN and RCTIME
    By Dwayne in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 4th November 2004, 14:45

Members who have read this thread : 0

You do not have permission to view the list of names.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts