Remove Text Formatting
Loading...

+ Reply to Thread
Results 1 to 6 of 6
  1. #1
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    99

    Default Long ago thre was a variable named "long"

    Hello out there!

    ten years ago there existet a variable called "Long" which made it easier to caculate more precise without usung floating point tools. Im counting distances in 8 bit which lowers my precision to about 2-3% of the distance.
    What happened to "Long" ?
    is there a simple cure?

  2. #2
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    77

    Default Re: Long ago thre was a variable named "long"

    It is available on PIC18F processors. To enable it, click on "View" in your PBP header, then select "Compile & Program Options...". In the pop-up window select the checkbox "Use Compiler Long Words (18 Series MCU Only)"

    Once activated, it is on all the time (until you turn it back off). If you try to work with a PIC16F processor, you will get compiler errors because of the Long. In other words, turn it on when you need it, and turn it back off when you're done.

  3. #3
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    99

    Default Re: Long ago thre was a variable named "long"

    Thank you quite a bundle, man!

  4. #4
    Join Date
    Jan 2008
    Location
    Selm, Germany
    Posts
    99

    Default Re: Long ago thre was a variable named "long"

    In my PBP Version this option doesnt exist, i can simply write X VAR LONG and compile it. Micro code Studio 3.0.0.5

  5. #5
    Join Date
    Apr 2014
    Location
    Northeast
    Posts
    77

    Default Re: Long ago thre was a variable named "long"

    First, it's only available on PIC18F devices. Go to "View/Compile and Program Options". A pop-up will appear. Check the top check box which reads, "Use Compiler Long Words (18 Series MCU Only)"

    Your MicroCode Studio version and your PBP version are different. My MicroStudio is Version 5.0.0.5 while my PBP is Version 3.1.0.4. Not sure if you're confusing them.

  6. #6

    Default Re: Long ago thre was a variable named "long"

    What about the Word variable size (16 bits I think).
    "w0 VAR word"
    Tim Barr

Similar Threads

  1. How to do the "SerIN" and "SerOut " for the usb ?
    By vicce67 in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 13th March 2015, 03:01
  2. Replies: 0
    Last Post: - 14th November 2013, 04:32
  3. Replies: 3
    Last Post: - 15th October 2012, 08:06
  4. AN Question for "word" variable read The serial port
    By redfoen in forum mel PIC BASIC Pro
    Replies: 1
    Last Post: - 14th December 2007, 18:39
  5. Replies: 1
    Last Post: - 16th February 2005, 21:05

Members who have read this thread : 29

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