PDA

View Full Version : 18FXXX = better code efficiency?



thelightbrain
- 2nd November 2004, 19:29
Does PBP take advantage of the 18FXXX's bigger instruction set, and features like direct 8x8 multiplication? So that I will actually tend to have smaller and faster assembly code produced when using those chips?

Or is PBP limited to the mid-range instruction set regardless of the target processor?

I'm getting ready to port over from a 16F648A to a 18F2525 and I can't find any reference in the manual about this. Just curious -I know there are so many other advantages regardless.

Thanks in advance.

Jim

mister_e
- 2nd November 2004, 21:16
Hi Jim,
I don't know if it's mean something but i'm really disapointed about the test i just do. I compile a program use on a 16F877 wich was using 388 word of code space to a 18F452.... now using 722 Bytes of code space.

My assumption, since 18Fserie are 8bits instead of 14bit (16f877) is that PBP will still use 14bits core limited instruction. In that situation, i think ther's many improvement to do by Melabs.

i'll send e-mail to melabs and see what they do with this.

regards

mister_e
- 2nd November 2004, 21:49
After testing it with a program under 16f648 to migrate to 18f2525... really disapointed about.... twice the code space.

It looks PBP doesn't really care about the 16bit instruction set. But there's maybe an setting to do before compile it... Maybe Melanie know how.

regards

Melanie
- 2nd November 2004, 22:17
Do NOT directly compare the PIC18-series reported compiled BYTES with the non-18 series compiled WORDS. They are NOT the same thing. You are not comparing like with like.

mister_e
- 2nd November 2004, 22:37
"Do NOT directly compare the PIC18-series reported compiled BYTES with the non-18 series compiled WORDS. They are NOT the same thing. You are not comparing like with like."

Thanks Melanie for putting lights on it. So as i can understand it will take about the same memory space at the end considering WORD compile/Bytes. Am i right on that?

Can we assume that 18F2525 will run faster than a 16F648 for some task?

Melanie
- 3rd November 2004, 02:27
When calculating properly, you will find on average the 18 series uses fractionally less codespace for the same functions. Quote:"16F877 wich was using 388 word of code space to a 18F452.... now using 722 Bytes" in this case 722 bytes is around 361 words.

I have not compared PBP's 18 series MAC and LIB files against the 16 series to see if they are identical or not, however given the same oscillator speed and configuration, I would hope to find the programs executed similarly, otherwise you will not have a direct upward migration path and compatability. There are of course salient differences because the archetecture is diffent to allow for features like increased program memory, RAM, etc. and PBP does take advantage of that because otherwise it would not work on those PICs. So of course there have to be some differences.