PWM on a 16f628a


Closed Thread
Results 1 to 3 of 3
  1. #1
    BlackNoir's Avatar
    BlackNoir Guest

    Default PWM on a 16f628a

    Would anyone happen to have a little sample code that does PWM on a 16f628a? I'm new to the PWM concept so I'm trying to find something to get me started.

    Thanks,
    BlackNoir

  2. #2
    Join Date
    Jul 2003
    Posts
    2,358


    Did you find this post helpful? Yes | No

    Default

    Have you seen the HPWM and PWM commands in the PBP manual? examples included theirin.

  3. #3
    BlackNoir's Avatar
    BlackNoir Guest


    Did you find this post helpful? Yes | No

    Default

    Actually, I think I found something. I believe this will work:

    Duty VAR BYTE
    Freq VAR Word
    LED VAR PortB.3

    ' changing the value for "Duty" will change the brightness
    Duty=127 ' about 50% Brightness

    Freq=1000 '1 kHz


    HPWM LED,Duty,Freq

Similar Threads

  1. Half-bridge PWM with a 16F684 ?
    By Byte_Butcher in forum General
    Replies: 7
    Last Post: - 17th January 2010, 22:18
  2. Variable PWM PIC18F2431
    By trr1985 in forum mel PIC BASIC Pro
    Replies: 7
    Last Post: - 12th June 2009, 06:03
  3. PWM: Vernacular/Function (Newbee)
    By TerryN in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 3rd July 2008, 16:58
  4. PWM setting PIC16F887
    By Gevo in forum mel PIC BASIC Pro
    Replies: 6
    Last Post: - 12th June 2008, 07:24
  5. Tidying Up PWM Routine
    By Tissy in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 21st February 2005, 00:26

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