Remove Text Formatting
Loading...

+ Reply to Thread
Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    83

    Talking PIC18F1320 HPWM on 2 pins

    Hello Folks,

    iīm trying to get my favorite PIC18F1320 to give out two different HPWM duty cycles with the same frequencies . The Duty cyles differ wildly and are not correspondent. I read the data sheet and couldnīt figure out which pin relates to which HPWM Channel. I searched through the forum
    and was more confused than before.

    I ran one single HPWM channel successful on a PIC16F88 but two on a PIC18F1320 seem way more complicated.

    DEFINE CCP2_REG PORTB
    DEFINE CCP2_BIT 3

    that should be PortB.3

    Is there a CCP1_REG PORTB ?

    I Know with 40 MHz minimum frequency is 2442 Hz and
    CCP1CON=1

    Thats the end of my knowledge about HPWM configs.

    Iīm dreaming of:

    HPWM 1,duty1,2442
    HPWM 2,duty2,2442

    regards
    Mugelpower

  2. #2
    Join Date
    Apr 2014
    Posts
    60

    Default Re: PIC18F1320 HPWM on 2 pins

    The PIC18F1320 only has one CCP Module, CCP1. Whereas the Data Sheet claims 1, 2, or 4 outputs, they are all Half- Full-Bridge complimentary outputs of the CCP1 Frequency & Duty Cycle. To achieve your goals, you need a processor with at least 2 CCP Functions. I'm not sure if your project requires an 18F part, but there are several 16F parts with 14/20 pins that incorporate 2+ CCP Modules. Here are some:

    PIC16F1507_8_9 (have 4 CCP Modules)
    PIC16F1615_9 (have 2)
    PIC16F1704_5_8_9 (2)
    PIC16F1713_6-9 (2)

    The list goes on and on. Sometimes you just have to move into the newer processors to achieve your goals.

  3. #3
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    83

    Default Re: PIC18F1320 HPWM on 2 pins

    Hello Mpgmike,

    you are right. I did a HPWM single channel with a 16F88 and it worked great. So I guess its waaaay easier to use two
    PICs than to scramble everything in just one.
    In my experience the use of multiple IF...THEN slows my 40 MHz PIC down to pure uselessness...
    I got the 18F1320 to measure speed and calculate fuel pump speed so I will go for a second PIC to measure temperature and control water pump speed. And show that on an LCD of course. Iīll have to get into hserout , baud rate and such strange things.

  4. #4
    Join Date
    May 2013
    Location
    australia
    Posts
    1,202

    Default Re: PIC18F1320 HPWM on 2 pins

    In my experience the use of multiple IF...THEN slows my 40 MHz PIC down to pure uselessness...
    you can't be doing it the right way

Similar Threads

  1. PIC18F1320 Config Help
    By iw2fvo in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 8th June 2013, 06:31
  2. Timer 3 config for HPWM using remappable pins
    By jimbostlawrence in forum General
    Replies: 1
    Last Post: - 5th December 2012, 15:26
  3. PIC - 8 Pins - 6 Output Pins ?
    By DanPBP in forum Off Topic
    Replies: 0
    Last Post: - 22nd October 2007, 00:23
  4. Setting up 5 HPWM pins on 18F4680
    By tcbcats in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 2nd August 2006, 05:54
  5. Compiling error with PIC18F1320
    By mazlan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 26th November 2004, 02:01

Members who have read this thread : 19

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