SPWM_INT - Multiple Software PWM Question


Closed Thread
Results 1 to 20 of 20

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default Re: SPWM_INT - Multiple Software PWM Question

    Those warnings aren't coming from the section you posted.

    You are trying to use a value of 500 with byte sized EEPROM locations.

    But I'm pretty sure you really want WORD sized EEPROM locations.
    Change this ...
    Code:
    ' ***************************************************************
    ' EEPROM Variables
    ' ***************************************************************
    
    MotorRPM_Default   CON  500 ; half speed if max is 1000
    EE_MotorRPM        DATA MotorRPM_Default
    MotorRPM           VAR  BYTE
    READ EE_MotorRPM, MotorRPM
    
    PortEngDir_Default CON  0
    EE_PortEngDir      DATA PortEngDir_Default
    PortEngDir         VAR  BYTE
    READ EE_PortEngDir, PortEngDir
    ... to this ...
    Code:
    ' ***************************************************************
    ' EEPROM Variables
    ' ***************************************************************
    
    MotorRPM_Default   CON  500 ; half speed if max is 1000
    EE_MotorRPM        DATA WORD MotorRPM_Default
    MotorRPM           VAR  WORD
    READ EE_MotorRPM, WORD MotorRPM
    
    PortEngDir_Default CON  0
    EE_PortEngDir      DATA WORD PortEngDir_Default
    PortEngDir         VAR  WORD
    READ EE_PortEngDir, WORD PortEngDir
    There are a few other WRITE statements in your program that need to be changed too.
    DT

  2. #2


    Did you find this post helpful? Yes | No

    Default Re: SPWM_INT - Multiple Software PWM Question

    You're a life saver, Darrel - thanks. Updated the corresponding WRITE statements and all compiles fine (I didn't change the 'PortEngDir' stuff as that has only 2 values: 0 & 1)

    Was there anything in the warning message which told you where to look?'
    Last edited by RossWaddell; - 21st January 2013 at 02:24.

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


    Did you find this post helpful? Yes | No

    Default Re: SPWM_INT - Multiple Software PWM Question

    Woops, I changed too much.

    When I can't tell were an error is comming from, I go to the .LST file and search for the error or warning.
    Ususally, the first error found in that file is the most important one.

    It helps being able to read assembly language though.
    DT

  4. #4


    Did you find this post helpful? Yes | No

    Default Re: SPWM_INT - Multiple Software PWM Question

    Being able to read assembly language would be helpful - I'm going to have to add that to the list of 'to-dos'.

Similar Threads

  1. Darrel's Multiple Software PWM
    By passion1 in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 15th October 2013, 16:21
  2. Replies: 1
    Last Post: - 4th March 2013, 22:57
  3. DT Multiple Software PWM and 18F2321 issue
    By microuser in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 20th December 2012, 09:23
  4. General Question About Multiple Interrupts
    By grzeh666 in forum mel PIC BASIC Pro
    Replies: 4
    Last Post: - 31st August 2008, 18:09
  5. Multiple HPWM question
    By Johan in forum mel PIC BASIC Pro
    Replies: 2
    Last Post: - 17th October 2007, 14:00

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