DIV32 Questions ...


Closed Thread
Results 1 to 6 of 6

Hybrid View

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


    Did you find this post helpful? Yes | No

    Default

    Code:
    	Dummy	 = 2500*3000		'Prédiviseur à 8 !!!
    	Vitesse  = DIV32 Periode2
    The constants are being multiplied at Compile Time. So the system registers don't have the values they would if it were multiplied at Run Time.

    If at least one of the numbers is in a WORD variable, it should work better.
    <br>
    DT

  2. #2
    jpohl's Avatar
    jpohl Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,

    just a question about the use of DIV32 instructions in the same program with your great instant interrupts lib.

    In the documentation one can read the necessary use of disable/enable command before and after the DIV32 instructions.
    Should I use also disable/enable in my program even there is no "On Interrupt" instruction? I use a timer and RBC interrupt via your interrupt interface.

    Thanks in Advance.
    Joerg

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


    Did you find this post helpful? Yes | No

    Default

    Hi Joerg,

    Nope, no need to disable interrupts when using DIV32 with DT_INTS.
    System variables are saved and restored on each Interrupt.

    ON INTERRUPT GOTO doesn't do that, so it has problems.

    Good question though.
    <br>
    DT

  4. #4
    jpohl's Avatar
    jpohl Guest


    Did you find this post helpful? Yes | No

    Default

    Hi Darrel,

    very good, thank you for your very fast reply.

    Best Regards,
    Joerg

  5. #5
    Join Date
    Jul 2006
    Location
    USA
    Posts
    26


    Did you find this post helpful? Yes | No

    Default

    Your code doesn't resemble the code example in the manual:

    b = 500
    c = 1000
    dummy = b * c
    a = DIV32 100

    Your code:

    Periode2 = Periode / 2
    Dummy = 2500*3000
    Vitesse = DIV32 Periode2

    The right numbers are not on the stack when the DIV32 occurs.
    Last edited by Brock; - 10th November 2007 at 00:54.

Similar Threads

  1. Problem with Div32
    By lerameur in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 22nd April 2008, 02:54
  2. RPM - DIV32 Problem
    By davewanna in forum mel PIC BASIC Pro
    Replies: 10
    Last Post: - 11th April 2008, 04:33
  3. Div32
    By Archangel in forum mel PIC BASIC Pro
    Replies: 5
    Last Post: - 2nd February 2007, 20:26
  4. 32-bit Variables and DIV32, Hourmeter 99999.9
    By Darrel Taylor in forum Code Examples
    Replies: 9
    Last Post: - 23rd November 2006, 07:23
  5. Retrieving Div32 Remainder
    By Darrel Taylor in forum Code Examples
    Replies: 4
    Last Post: - 20th August 2003, 03:53

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