PDA

View Full Version : Help, PBPL and DIV 32.



Rogerio
- 16th March 2010, 08:48
Hello. I have a code that uses DIV 32, because of code lenght I am switching to PIC18F4620, and since I have the extra space I want to add more functions that could be more easily done using PBPL. BUT when I try to compile in PBPL it says "ERROR: Macro DIV32?CW not found in macro file."
I don't want to rewrite the DIV32 routine it works just fine as it is, is there any way to use DIV32 in PBPL? Can you use both Macro files at once? Or can the 18L macro file be edited in some way to include DIV32?

Thanks!

Rogerio

Darrel Taylor
- 16th March 2010, 09:35
With PBPL, you don't need DIV32 anymore.
Just do the division ...



Dummy = A * B
Result = DIV32 C


Becomes ...



Result = (A * B) / C

Rogerio
- 16th March 2010, 09:54
Thanks Darrel! That was a fast change and it's working OK.
Now I need to find out how to display a number bigger than a Word using LCDOUT, any ideas?

Thanks!

Rogerio

Darrel Taylor
- 16th March 2010, 10:00
Use LONG variables.

Then you can go up to ...

LCDOUT DEC10 MyLong
or simply DEC will display however many digits there are.
<br>

Rogerio
- 16th March 2010, 10:06
I was using Long variables but trying to display with #Variable, thought it was the same as DEC. Working great now.

Thanks again Darrel!

Rogerio

Acetronics2
- 16th March 2010, 10:09
Hi, Darrel

While you're here ...

A question I have for long time ... linked to the subject.

Is it possible to do something like conditionnal assembly with PBP ??? never saw anything about that ...
and Google doesn't return anything nor ...

Alain

Darrel Taylor
- 16th March 2010, 10:31
Is it possible to do something like conditionnal assembly with PBP ???At the PBP level ... NO.
At the ASM level ... YES.

In other words, you can not conditionally compile variables, array sizes or anything that PBP needs to know before passing it on to the assembler.

Once it's at the assembler, you can conditionally remove any part of the PBP "Code" that you wish.

But only the code.
Not the variables, defines or any variables/defines in other include files.

All you do is put if/endif's around what you want or don't want...


DEFINE MyOption 1

@ if (MyOption == 1)
LCDOUT "Option 1 HardCoded"
@ endif

<br>

Acetronics2
- 16th March 2010, 10:37
Re,

Ok, that's more than nice to me ....

just looked for " embedding " PBP commands ...

Thanks, Darrel

Alain