Thanks Guys for all the responses and Melanies detailed explanation
Well, by learning that 18F requires the MPASM assembler only, you totally solved my problem
Viva la Picbasic Forum!
Angus
Thanks Guys for all the responses and Melanies detailed explanation
Well, by learning that 18F requires the MPASM assembler only, you totally solved my problem
Viva la Picbasic Forum!
Angus
You can also just use MCSP which passes all the necessary information to the assembler for you![]()
I got the whole thing to compile guys, thanks
Use:
PBP 2.46
MPLAB 7.30
Win98SE to compile
A few observations-
1) MPASM told me when compiling that I had dual specifications for the config file. I did have config statements in the source file. By REM'ing the config statements in the PBP 18F452.INC file, it compiled fine with MPASM
Why the dual sensing? Surely the assembler will check if there is a config statement in the source, and if not, use the .INC file to set a default? Why pick up both?
2)What compiled with 7607 bytes on a 16F877A using the PM compiler actually compiles to 12477 bytes using the MPASM compiler. I can't believe that I have lost 1/2 of what I hoped to gain in code space by converting to an 18F device - that is, 4K. Is this normal?
tut tut...7607 WORDS with a 16F, 12477 BYTES for a 18F... still much compact in an 18F... no?![]()
Steve
It's not a bug, it's a random feature.
There's no problem, only learning opportunities.
Well, I learn every day. Thanks Mr_E
You know, I'm a kind of mid-level programmer, I suppose. By that I mean that I know 16F stuff and PBP pretty well but have had a kind of a rocky ride moving up to 18F.
There are a few things that illustrate:
I had no idea that 18F only compiled with MPASM. Where do PBP tell us this? They don't
*****************************************
From Mr_E
tut tut...7607 WORDS with a 16F, 12477 BYTES for a 18F... still much compact in an 18F... no?
*****************************************
I also had no idea that an 18F compiled file was expressed as bytes (18F) instead of words (16F). (And Melanie, I'll kill you if you tell me to look for this stuff in page xx sub xx sub xx of the documentation, because I cant find it
I'm not wingeing. What I want to say is that there are a lot of people out there who need answers that are not in the manual, and thank goodness, the experts in this forum provide them. But boy, have I battled to find out what cooks with my 16F to 18F migration.
So you guys who are so patient with seemingly stupid requests, bear with us please.
We appreciate it more than you think
I would not be able to conduct my small consultancy without your technical help
Angus
*smiles*And Melanie, I'll kill you if you tell me to look for this stuff in page xx sub xx sub xx of the documentation, because I cant find it
1. If you had attempted a compile with an 18F part using the standard (default) PM Assember, one of the first lines to hit your screen would have been...
"Error: PM does not support this device. Use MPASM."
This is (in case you missed it) a clue to get you on the right track...
2. If you had ever compiled using MPASM, at the end of the listing (file.LST) it says BYTES for 18F series and WORDS for the 12F, 16F etc... The PICs DATASHEET (here we go I feel a fatwa coming on - btw, does anybody ever get a thin one?), anyway check the 18F452 Datasheet MEMORY ORGANISATION chapter and you discover...
"The PIC18F252 and PIC18F452 each have 32 Kbytes of FLASH memory, while the PIC18F242 and PIC18F442 have 16 Kbytes of FLASH. This means that PIC18FX52 devices can store up to 16K of single word instructions, and PIC18FX42 devices can store up to 8K of single word instructions."
Are we still friends Angus or is it Kevlar vest time?
Anyway, digressing... it's time you thought about using the 4520 version rather than the plain 452. Heaps more versatile and CHEAPER too...
Hi Guys-
Melanie, I'm afraid that I will always be a fatwa not a thinwa...., and kevlar not needed..
I have been able to get PBP to compile with MPASM, thanks to your advice.
I was caught, though, by the __CONFIG vs the CONFIG problem with MPASM.
I still have a strange one.
If I add config (not __config!) statements to my 18F source file, I get a list of very abstruse ASM compile errors with MPASM
However, if I REM the source statements in my source file and cut and paste the same statements to the PBP 18F452.inc file, and comment out the __config statements, it assembles fine. I use PBP ver2.46.
The bottom line is - why can't I use the same statements in my source file as in the .inc file?
Any help welcomed
Angus
Bookmarks