Menu

strange behavior

Help
Florin T
2016-10-21
2016-10-25
  • Florin T

    Florin T - 2016-10-21

    I have a small problem. After installing version v.0.95.007 I recompile with new compiler the source files. The receive files that do not behave properly. If sources are compile in V 0.94 04/02/2015 files obtained are accurate.I uninstalled all traces v.0.95.007 cleaned and reinstalled. It still does not work. A little help please .

    Attach files: two files with the same content and files generated by the two compilers.

     
  • Florin T

    Florin T - 2016-10-21

    files

     
  • Anobium

    Anobium - 2016-10-22

    I have to ask what does not work?

    I do not know what to look for. Compile error? LCD not working? sorry, we need more infomation.

    And, may I strongly recommend we get you on the latest build as this has 100's of improvements over the older versions.

     
  • Florin T

    Florin T - 2016-10-22

    Port port C2 drive a transistor that is connected lcd screen. HPWM order 1, 40, 90 not determine the proper function PWM. The same file compiled with the older version works correctly

     
  • Florin T

    Florin T - 2016-10-22

    does not matter what value put in HPWM 1, 40, 90 if compiled with the new version, the fill factor is not changed and is very small. With the old version correct results are obtained. I checked with oscilloscope

     
  • Anobium

    Anobium - 2016-10-22

    Recommend we get you onto v0.95.010 code. PWM has been revised to provide better backwards compatibility support.

     
  • Anobium

    Anobium - 2016-10-25

    These issues are resolved in v0.95.010.

    Fix 285 resolves this issue.
    '#285 Fix pwm.h Fixed legacy PWM command. BIT tests were executing the incorrect ASM.

    Testing shows that PWMON and HWPWM for this chip architecture is operating as expected. The screenshot below shows HPPWM on channel 1 and PWMON (using the defines) on channel two.

    Testing PWM.

    The code is changing the duty so the duty % is therefore correct.

    The test program below was used. This is now part of the demo suite.

    '''A demonstration program for GCGB and GCB.
    '''--------------------------------------------------------------------------------------------------------------------------------
    '''This program ia a demonstration of Hardare PWM, but, this also shows how to use PWMON.
    '''The PWM is set to be on CCP1 and CCP2.
    ''':
    '''@author  EvanV
    '''@licence GPL
    '''@version 1.0a
    '''@date    24.10.2016
    '''********************************************************************************
    
    ; ----- Configuration
        #chip 16f886,8
        #config LVP_OFF, BOR_OFF, MCLRE_Off,HS_OSC
        #option explicit
    
        'Define the ports
        #define CCP1Port portc.2
        #define CCP2Port portc.1
    
        'Ensure the ports are outputs
        dir CCP1Port  out
        dir CCP2Port  out
    
        'Set two variables to the spefic values we want
        Dim FrequencyValue, DutyPercentValue as byte
        DutyPercentValue = 204   'this equate to 80%.  204 is 80% of 255. 255 is 100%
        FrequencyValue = 76      'starting frequency
    
        HPWM 2, FrequencyValue, DutyPercentValue
    
        #define PWM_Freq 76    'Set frequency in KHz
        #define PWM_Duty 80    'Set duty cycle to 80 %
        PWMOn                  'Turn on the CCP1/PWM.  This command only operated on CCP1/PWM
    
        wait 5 s               'Show the signals for 5 seconds on an oscilliscope
    
        do Forever
            for DutyPercentValue = 0 to 250 step 10
              HPWM 2, FrequencyValue, DutyPercentValue      ' cycle thru the duty
              wait 100 ms
            Next
            PWMOff                                          'stop CCP1/PWM
            wait 1 s
            PWMOn                                           'star CCP1/PWM again
        Loop
    
    
        ''' GCB Optimisations
    
        'Optmise PWM.h
            #define USE_HPWMCCP1 false
            #define USE_HPWMCCP2 true    'we are only using PWM/CCP2 
            #define USE_HPWMCCP3 false
            #define USE_HPWMCCP4 false
            #define USE_HPWMCCP5 false
    
     

    Last edit: Anobium 2016-10-25

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.