HPWM on 16F88


Closed Thread
Results 1 to 8 of 8

Thread: HPWM on 16F88

Hybrid View

  1. #1
    Join Date
    Jul 2003
    Location
    Colorado Springs
    Posts
    4,959


    Did you find this post helpful? Yes | No

    Default Re: HPWM on 16F88

    If you are using MPASM for the assembler, defines need to be all uppercase.

    Code:
        define CCP1_REG PORTB
        DEFINE CCP1_bit 0
    DT

  2. #2
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    116


    Did you find this post helpful? Yes | No

    Default Re: HPWM on 16F88

    Hello Darrel,

    nice you took a look at my childish problem.

    The config files you mentioned were in the upper part of the program
    do I have to put them in the .inc file? Iīm confused.

    And i was so frustrated I wrote code that used Portb.0 as switch
    inside my simple program because I feared the chip was blown but it works.

    it is just: I canīt get portb.0 as HPWM output AND the normal LCDout application at once. The LCD is the reason I canīt switch the port. got the boards already.

    sream, howl, and so on

  3. #3
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Re: HPWM on 16F88

    Try to set your fuse like this:
    Code:
    @ DEVICE PIC16F88, CCPMX_OFF
    where:
    0 = "ON" CCP1 on RB3
    1 = "OFF" CCP1 on RB0



    You also need to set a register:
    Code:
    CCP1CON = %00001100 'Select PWM Mode
    HTH
    Roger

  4. #4
    Join Date
    Aug 2006
    Location
    SWITZERLAND (french speaking)
    Posts
    938


    Did you find this post helpful? Yes | No

    Default Use PWM instead

    Instead of using HPWM, try this:
    Code:
    PWM PORTB.0,speed,1000
    You won't need to declare/define T2CON, CCP1CON, PR2 and CCPR1L.

    PS: I'm using MCS
    Roger

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