tut tut...7607 WORDS with a 16F, 12477 BYTES for a 18F... still much compact in an 18F... no?![]()
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
Angus Anderson, Have you commented them out in the include file? MPASM will bitch if it is being told to redifine of rewrite configuration locations.....
Dave Purola,
N8NTA
One other thing I noticed with 18F series is the stack won't POP out if you try to overflow it. It will just hang, lol. Found a gosub routine call that was not properly returned and kept crashing the application. The 16F just pushed the bug in the program out whenever it needed too, the 18F was a little more sticky about it though, lmao.
Hi Dave-
Yes, I did comment it out in the include file when I specified the config fuses in the source file. It's just that I can get it to work with no config statements in the source file, and config statements specified in the include file, but NOT the other way around. Statement syntax is identical. This is a funny one.
CCkid, there is an 18F config statement that allows resetting of a stack overflow. I enabled it
regards
Angus
Angus Anderson, Could you please send the statements for the configurations you are trying to set? I'm sure it will shed some light on the problem.
Dave Purola,
N8NTA
Bookmarks