PDA

View Full Version : Long ago thre was a variable named "long"



Mugelpower
- 10th September 2017, 15:38
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. I´m 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?

mpgmike
- 10th September 2017, 17:18
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.

Mugelpower
- 11th September 2017, 09:15
Thank you quite a bundle, man!

Mugelpower
- 19th November 2017, 19:19
In my PBP Version this option doesn´t exist, i can simply write X VAR LONG and compile it. Micro code Studio 3.0.0.5

mpgmike
- 19th November 2017, 23:35
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.

falingtrea
- 22nd November 2017, 19:42
What about the Word variable size (16 bits I think).
"w0 VAR word"