Greetings from Newbie and a question


Closed Thread
Results 1 to 10 of 10

Hybrid View

  1. #1
    Join Date
    Jul 2006
    Posts
    36


    Did you find this post helpful? Yes | No

    Default

    I did NOT know that. That's fantastic. I don't use the PWM command to access it?

    I suppose I should look at the datasheet, but if you feel inclined to point me the right direction, it's appreciated.

    I was actually able to make a very nice square wave with an adjustable period/duty cycle by using pin on, pin off, and pauses. I won't need to make any duty cycle changes on-the-fly, but I may want to be able to turn it on and off at will.

    Thanks.

  2. #2
    Join Date
    Feb 2005
    Location
    Essex, UK
    Posts
    94


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by ChrisHelvey
    I suppose I should look at the datasheet, but if you feel inclined to point me the right direction, it's appreciated.
    This is a small portion of code that I wrote recently and may help you although it was written for a 16F628A:
    Code:
    INTCON = %11000000     ' These 2 lines set the Timer 1 to be
    PIE1 = %00000001         ' utilised by enabling Global and Peripheral interrupts
    
    T2CON = %00000111           ' Timer 2 is needed by HPWM command
    
    CCP1CON = %00001100        ' This is needed also for HPWM command
    
    ....................
    
        HPWM 1, 127, 0          ' Make sure the jets are off
    
    pause 1000
    
    frequency = 2510                ' Set frequency at start -15Hz for Hotspring. - FREQUENCY WAS A VARIABLE I ASSIGNED!
    
    hpwm 1, 127, frequency        ' Output start frequency of 2510Hz
    The best thing to do is to read the datasheet for that particular PIC though as you quite rightly said. Also refer to the Pic Basic Pro manual - extremely helpful!!

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