DEBUG DEC DatVar vs DEBUG #DatVar


Closed Thread
Results 1 to 2 of 2
  1. #1

    Default DEBUG DEC DatVar vs DEBUG #DatVar

    Hi Everyone

    I've just discovered that when you send decimal variable over the serial line you can use two different qualifiers DEC or #.
    DEBUG DEC DatVar and DEBUG #DatVar will produce the same result in the Serial Communicator(F4 if you use Microcode Studio). I've noted though that DEC uses 27 words of the code space more than #. The timing doesn't change. http://www.picbasic.co.uk/forum/imag...tor/attach.png
    SEROUT also uses more code space than DEBUG while producing the same result according to the PICBasicpro manual.
    Regards
    Attached Images Attached Images  

  2. #2
    Join Date
    Oct 2005
    Location
    Sweden
    Posts
    3,523


    Did you find this post helpful? Yes | No

    Default Re: DEBUG DEC DatVar vs DEBUG #DatVar

    Hi,
    With the DEC modifier you can specify the number of digits to send and even "print" signed number with SDEC - neither of which you can do with the #-modifier. That extra power/feature comes at a cost.

    DEBUG is "leaner" because its parameters (pin, baudrate and mode) are set at buildtime (by the DEFINEs). This means that the timing is calculated at build time and programmed as constants. When you use SEROUT you can change it and runtime which means that the timings needs to be calculated at runtime, at a cost. SEROUT also supports more modes (open vs driven) than DEBUG does.

    If DEBUG and # provides you with what you need there's absoultely no reason not to use it.

    /Henrik.

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