16F18855 - HPWM and some ports with troubles


+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Junior Member
    Join Date
    Mar 2020
    Posts
    4
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    19.05 MB

    0 Not allowed!

    Default 16F18855 - HPWM and some ports with troubles

    Hi to all,

    I don't know to set HPWM2 and HPWM4 on PIC 16F18855 . I'm sure that issues are somewere in PPS register . Can somebody help me, please ?

    Thank you

    Device = 16F18855


    Config1 FEXTOSC_OFF , RSTOSC_HFINT32 ,CLKOUTEN_OFF ,CSWEN_OFF,FCMEN_OFF
    Config2 MCLRE_OFF ,PWRTE_OFF ,LPBOREN_OFF ,BOREN_OFF ,BORV_LO ,ZCD_OFF ,PPS1WAY_OFF ,STVREN_ON ,DEBUG_OFF
    Config3 WDTCPS_WDTCPS_11 ,WDTE_OFF ,WDTCWS_WDTCWS_7 ,WDTCCS_LFINTOSC
    Config4 WRT_ON ,SCANE_available ,LVP_OFF
    Config5 CP_ON ,CPD_OFF


    Declare Xtal = 4
    OSCFRQ = %00000010 'set 4MHz ; RSTOSC = HFINT32


    Declare Adin_Res = 10 '10 bit
    Declare Adin_Tad = FRC 'RC oscillator chosen for the ADC
    Declare Adin_Stime = 50 'Allow 50us sample time


    'RA4PPS = %00000100
    'RC2PPS = %00001100


    Declare CCP4_Pin = PORTB.0
    Declare CCP2_Pin = PORTC.1


    ADCON0 = %00000000
    ADCON1 = %10000000 ' left shift


    TRISA = %00000110
    ANSELA = %00000110
    TRISB = %00000110
    ANSELB = %00000000
    PORTB = %00000110
    WPUB = %00000110
    TRISC = %00000000
    ANSELC = %00000000
    PORTC = %00000000
    LATC = %00000000


    PORTA = 0
    PORTB = 0
    PORTC = 0


    main:
    HPWM 2, 125, 2000
    HPWM 4, 125, 2000
    GoTo main
    End

  2. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  3. #2
    Junior Member
    Join Date
    Mar 2020
    Posts
    4
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    19.05 MB

    0 Not allowed!

    Default Re: 16F18855 - HPWM and some ports with troubles

    The compiler error is : " ERROR : Device does not contain any suitable CCP channels for the HPWM command! "

  4. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  5. #3
    Senior Member Stephen Moss's Avatar
    Join Date
    Jan 2006
    Posts
    534
    Thumbs Up
    Received: 31
    Given: 7
    Total Downloaded
    3.87 GB

    0 Not allowed!

    Default Re: 16F18855 - HPWM and some ports with troubles

    Maybe you need to declare the pin before you can use them, see the HPWM declares section on page 401 of the manual.
    However, the the HPWM channel setting in the PPI file is set to a value indicating that HPWM it is not suitable for the compiler. Only Les would know if for certain if that is an error in the PPI file or due to some new strange way Microchip set them up which the compiler does not currently support.

  6. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  7. #4
    Junior Member
    Join Date
    Mar 2020
    Posts
    4
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    19.05 MB

    0 Not allowed!

    Default Re: 16F18855 - HPWM and some ports with troubles

    Now I tested with PIC 16F18323 and no errors appeared .
    With 16F18855 say device does not contain CCP channels ... (really have 5 x CCP) .
    May be it's a error in PPI file , so we must waiting for update....

    Thank you Stephen for answer!

  8. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  9. #5
    Fanatical Contributor top204's Avatar
    Join Date
    Feb 2002
    Posts
    3,515
    Thumbs Up
    Received: 319
    Given: 152
    Total Downloaded
    1.99 GB

    0 Not allowed!

    Default Re: 16F18855 - HPWM and some ports with troubles

    Open the device's PPI file in Notepad and change the line:

    HPWM=0xFF ; Amount of PWM channels, 0xFF = Unsuitable for the compiler

    to

    HPWM=5 ; Amount of PWM channels, 0xFF = Unsuitable for the compiler

    Only use Notepad and not a word processor or wordpad.

    The PPI files can be found on the drive here:

    C:\Program Files (x86)\ProtonIDE\PDS\Includes\PPI

    I don't have a 16F18855 device to test it, but it does compile and the asm looks OK. Some of the newer devices have very different methods of using the PWM peripherals now, and they change from device to device, so I simply do not have the time or the money to buy all devices and read all the datasheets and write the code and test them, so the 0xFF in the PPI file means it is not suitable for the compiler (at this moment).

    However, now the compiler has procedures, there is nothing stopping a user from creating an HPWM library for some of the newer, stranger, devices for others to use. Creating libraries for every strange device is not feasible for me because of the logistics involved for a single person. i.e. Me alone, and for no funding!
    Last edited by top204; 23rd March 2020 at 19:57.

  10. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

  11. #6
    Junior Member
    Join Date
    Mar 2020
    Posts
    4
    Thumbs Up
    Received: 0
    Given: 0
    Total Downloaded
    19.05 MB

    0 Not allowed!

    Default Re: 16F18855 - HPWM and some ports with troubles

    Thank you very much for patience and explanations!

    I changed the amount PWM channels in PPI file . Now the compile is right, without errors , but something is wrong . When I use HPWM , don't work , and ( PORT B2 to B6 ) , (PORT C4) and (PORT C7) are always ON .

  12. Attention

    This valuable resource relies upon the very small amount of revenue generated by displaying online advertisements to our visitors.

    The advertisements we display are relevant to this web site and your browsing history

    Please consider supporting us by disabling your ad blocker.


    Note: Some users have reported issues related to ad-blockers rendering parts of this wesite unusable,
    where possible we will rectify the issues to enable you to use this resource with adblocking enabled.

    If you can, please report issues in the forum area WebSite / Forum Issues


    Thank you for your attention.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

     

Similar Threads

  1. Getbit troubles
    By charliecoultas in forum Proton 24
    Replies: 6
    Last Post: 7th September 2017, 08:48
  2. 16F18855 support
    By towlerg in forum Proton Plus Compiler v3
    Replies: 9
    Last Post: 12th October 2016, 15:26
  3. Les has just uploaded PPI and Def files for 16F18855!
    By top204 in forum Proton Users File Server
    Replies: 0
    Last Post: 10th October 2016, 17:24
  4. Les has just uploaded PPI and Def file for a 16F18855 device!
    By top204 in forum Proton Users File Server
    Replies: 0
    Last Post: 4th July 2016, 07:54
  5. [SOLVED !] 16F506 Troubles
    By Gary Brooks in forum Proton Plus Compiler v3
    Replies: 9
    Last Post: 10th July 2007, 19:46

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts