PIC16F819 HPWM CCP1 clariffication


Closed Thread
Results 1 to 3 of 3
  1. #1
    Join Date
    Jan 2007
    Location
    Houston, TX
    Posts
    96

    Default PIC16F819 HPWM CCP1 clariffication

    I think I should just change my login ID to "confused" sometimes....or is that already taken?
    Anyway I am currently using a 16f819 for an electric scooter control board overhaul. I currenly am using HPWM on PORTB.3/ CCP1 with no problems.

    'short clip from my code
    main:
    adcin 1,B0 'Pot value is stored in B0 variable
    hpwm 1,B0,1000 'B0 is fetched from ADC as an 8-bit value 0-255
    'return
    IF PORTB.7 = 0 Then blinkleft
    IF PORTB.6 = 0 Then blinkright
    IF PORTB.5 = 0 Then headlight
    IF PORTB.4 = 0 Then brakelight
    IF PORTA.3 = 0 THEN BEEP
    return
    goto main


    What I am confused about is why there are (2) CCP1 pins (PORTB.2 & PORTB.3)? Why are they not labled CCP1 & CCP2 in the pin diagram? Even though I have in my code to use channel 1, I still am given the option to choose my CCP1 bit/channel under fuses with a drop down menu. After reading section 5.29 in the PBP manual I can only guess there are alternate pins for HPWM and they are just labeled the same in the pin diagram....?

    Probably a dumb question but I really would like an answer.

    thanks ahead of time.
    Padawan-78

  2. #2
    skimask's Avatar
    skimask Guest


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by earltyso View Post
    I think I should just change my login ID to "confused" sometimes....or is that already taken?
    Nope...it's open!

    What I am confused about is why there are (2) CCP1 pins (PORTB.2 & PORTB.3)?
    As you've already figured out, there's only one channel on this PIC.
    Yes, they are alternate pins for the same function.
    If my reading is right, you can have it one of a few ways:
    1 - No CCP module, hardware serial data out, and low voltage programming
    2 - Use the CCP module, don't use hardware serial data out, and keep low voltage programming
    3 - Use the CCP module, keep the low voltage programming, but lose the hardware serial data output.
    I guess it's all about the options...
    (check the PIC24 and PIC32 and their use of the whole 'assignable pin function' deal. It's slick)

  3. #3
    Join Date
    Jan 2007
    Location
    Houston, TX
    Posts
    96


    Did you find this post helpful? Yes | No

    Talking thanks

    thanks!
    I just need HPWM, no serial, so I will keep it as I have it!
    Padawan-78

Similar Threads

  1. 16 bit PWM using CCP1
    By Normnet in forum mel PIC BASIC Pro
    Replies: 60
    Last Post: - 27th August 2014, 08:13
  2. need help on hpwm
    By helmut in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 28th August 2007, 15:49
  3. HPWM of the port of two HPWM
    By ja2rqk in forum mel PIC BASIC Pro
    Replies: 3
    Last Post: - 25th April 2007, 15:05
  4. sound command & music
    By trying in forum mel PIC BASIC Pro
    Replies: 14
    Last Post: - 26th May 2006, 14:14
  5. 3 HPWM channels
    By docwisdom in forum mel PIC BASIC Pro
    Replies: 9
    Last Post: - 4th April 2006, 02:43

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