Pulsout Pic16F630 @16Mhz problem


Closed Thread
Results 1 to 19 of 19

Hybrid View

  1. #1
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Pulsout Pic16F630 @16Mhz problem

    The pulses delivered are 240msec for a command "PULSOUT PORTC.3, 100"!?
    by 240mS do you mean 240 micro seconds. a more likely result


    What is my mistake or oversight?
    not reading the manual

    5.59 PULSOUT
    PULSOUT Pin, Period
    Generates a pulse on Pin of specified Period. The pulse is generated by toggling the pin twice, thus the initial state of the pin determines the polarity of the pulse. Pin is automatically made an output. Pin may be a constant, 0 - 15, or a variable that contains a number 0 - 15 (e.g. B0) or a pin name (e.g. PORTA.0).
    The resolution of PULSOUT is dependent upon the oscillator frequency. If a 4MHz oscillator is used, the Period of the generated pulse will be in 10us increments. If a 20MHz oscillator is used, Period will have a 2us resolution. Defining an OSC value has no effect on PULSOUT. The resolution always changes with the actual oscillator speed.
    ' Send a pulse 1mSec long (at 4MHz) to Pin5
    PULSOUT PORTB.5,100
    PULSOUT is a legacy command that is included for compatibility with other languages.
    Warning I'm not a teacher

  2. #2
    Join Date
    Feb 2022
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: Pulsout Pic16F630 @16Mhz problem

    @ Mpgmike,
    Now you're confusing me
    (I already don't know English very well, thanks to the automatic translators).
    Well, actually I was an amateur user of the BS2x BasicStamp and I try to pour some programs into one or the other PIC.
    The registers of the PICs and the commands other than the pure Basic of the Stamp, I don't know too much!
    So, isn't declaring the High Speed fuse then sufficient for PicBAsicPro Compiler, as I wrote in my program?
    So I don't understand your sentence "as if you were at 16 MHz using your external resonator, when in reality you are using the internal 4 MHz clock."
    --> So does it work in 4Mhz or 16Mhz?

    @Richard
    (Yes, 240µsec!)
    You say that setting OSC has no effect on PULSOUT but that the resolution depends on the crystal used.
    What is the point of defining OSC?
    And considering what Mpgmike said above, at what frequency does my Pic equipped with a 16Mhz resonator and high speed fuse indication work?

    Here are the pulses I read on a logic analyser:

    WITHOUT indicating Define OSC 16 :
    PAUSE 200 = 50 msec (Isn't the resolution at 4Mhz 10µsec??)
    PULSOUT 100 = 240µsec

    Isn't the resolution at 4Mhz 10µsec?

    WITH Define OSC 16 :
    PAUSE 200 =200 msec
    PULSOUT 100 = 240 µsec also

    (Theoretical resolution at 16Mhz should be 2.5 µsec I think).
    So the PIC would work well here at 16Mhz!

    I have to admit that I'm getting confused here with the Pause and Pulsout resolutions and I'm trying to understand

  3. #3
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Pulsout Pic16F630 @16Mhz problem

    So, isn't declaring the High Speed fuse then sufficient for PicBAsicPro Compiler, as I wrote in my program?
    for this chip yes
    You say that setting OSC has no effect on PULSOUT but that the resolution depends on the crystal used.
    ?
    its a legacy [old ] command, it does not use the OSC define in its operation


    What is the point of defining OSC
    non legacy commands do use the OSC define in their operations

    And considering what Mpgmike said above
    is incorrect and out of context for that chip



    (Theoretical resolution at 16Mhz should be 2.5 µsec I think).
    So the PIC would work well here at 16Mhz
    thats it
    Warning I'm not a teacher

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Pulsout Pic16F630 @16Mhz problem

    looks like the forum is broken. cannot edit last post

    I have to admit that I'm getting confused here with the Pause and Pulsout resolutions and I'm trying to understand
    pause uses OSC define to calculate TIME , Pulsout does not
    Warning I'm not a teacher

  5. #5
    Join Date
    Feb 2022
    Posts
    54


    Did you find this post helpful? Yes | No

    Default Re: Pulsout Pic16F630 @16Mhz problem

    I was wondering about the resolutions of the PAUSE command:

    With "DEFINE OSC 16", PAUSE 200 gives a delay of 50 msec
    The resolution here is therefore 250µsec per "unit".

    WITHOUT "DEFINE OSC 16", PAUSE 200 gives a delay of 200 msec
    The resolution here is 1msec per "unit".

    Right?

    --> What are legacy commands, I don't know this term

  6. #6
    Join Date
    May 2013
    Location
    australia
    Posts
    2,643


    Did you find this post helpful? Yes | No

    Default Re: Pulsout Pic16F630 @16Mhz problem

    i'm not sure what ver of pbp you are using but

    @ Device Pic16F630,HS_osc, wdt_off, pwrt_on,protect_off, mclr_off

    is old stuff, and probably case sensitive
    HS_osc looks doubtful
    if this line is incorrect then the actual config fuse you are setting is the pbp default not what you think.
    the default will be most likely use a 4mhz clock

    With "DEFINE OSC 16", PAUSE 200 gives a delay of 50 msec
    means the osc is 4mhz not 16, so your config line is incorrect

    The resolution here is therefore 250µsec per "unit".
    pause is always in mS but the actual osc must march the defined OSC

    What are legacy commands, I don't know this term
    commands that resemble old basicstamp style commands ,they are not as well integrated in the pbp operating environment
    Warning I'm not a teacher

Similar Threads

  1. PAUSEUS Using a 16MHz Oscillator
    By rsocor01 in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 10th October 2013, 22:17
  2. weird pulsout problem
    By peterdeco1 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 30th January 2012, 19:39
  3. LCD works at 4MHz, but not 12 or 16MHz
    By Max Power in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 11th June 2008, 01:23
  4. Encoder Ht6p20b Using Pic16f630 Decoder
    By Lucas de Paula in forum General
    Replies: 1
    Last Post: - 18th April 2007, 05:36
  5. Can anyone help at getting OWIn & OWOut to work @ 16MHz?
    By jessey in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 24th January 2006, 11:08

Members who have read this thread : 0

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

Posting Permissions

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