View previous topic :: View next topic |
Author |
Message |
davt
Joined: 07 Oct 2003 Posts: 66 Location: England
|
Possible bug? |
Posted: Fri Nov 05, 2004 3:36 am |
|
|
Hi all
I am using ccs version 3.210 and Pic 16F767.
I have made 2 projects using the same 'c' code, one for the 16F767 and the other for 16F876.
when I compile and program the 16F876 and insert the pic into my test board it functions fine. Project setup to use 16F876.
When I compile the same source file and program the 16F767 and insert it into my test board it does not work as expected. Project setup to use 16F767.
If I program the 16F767 with the 16F876 hex file and insert the 16F767 into my test board it works perfectly.
Therefore it would seem that there must be a bug when compiling for the 16f767.
I created both projects manually.
Any ideas?
Dave |
|
|
Trampas
Joined: 04 Sep 2004 Posts: 89 Location: NC
|
|
Posted: Fri Nov 05, 2004 6:12 am |
|
|
Well CCS rules one:
1) If at first your program does not run, try newer compiler.
2) If with new compiler code does not run try different optimization levels.
3) If code still does not run, start debugging and learning how to write your code in assembly. When you find the bug report to CCS, then while(1);
Trampas |
|
|
Will Reeve
Joined: 30 Oct 2003 Posts: 209 Location: Norfolk, England
|
|
Posted: Fri Nov 05, 2004 7:52 am |
|
|
Check the fuses between the 16F767 and 16F876 there may be differences. I have been caught out here before.
Will |
|
|
future
Joined: 14 May 2004 Posts: 330
|
|
Posted: Fri Nov 05, 2004 8:25 am |
|
|
Trampas, you always talk about CCS being buggy, but I never had big problems with it.
I think the key is keep it simple.
CCS is so easy to use, does not have tons of keywords just to define a function.
The generated code is very optimized, I could not do any better by hand. |
|
|
asmallri
Joined: 12 Aug 2004 Posts: 1635 Location: Perth, Australia
|
|
Posted: Fri Nov 05, 2004 8:47 am |
|
|
Quote: | The generated code is very optimized, I could not do any better by hand. |
Hmmm does not match my observations. I ported a large PIC18F452 program written in assembler using PIC18F optimized instructions to CCS to test the efficiency of the code produced by the compiler in its default (supposedly most reliable) configuration. The code produced by the CCS compiler was almost twice the size of the assembler version.
Time critical functions in the assembler version would not work in the complied version because of the additional code overhead produced by the compiler. To address this, critical code sections were replaced with the original assembler versions of code but modified to work around a FSR bug in the CCS assembler support for the PIC18F. Where I feel the CCS compiler brings the greatest benefit is in RAM address space management and high level routines, specially in terms of printf capabilities. For quick and dirty projects the #use routines are great but for industrial strength applications requiring full duplex, high speed comms across multiple ports simultaneously you have to fall back to assembler.
My expection was that Time-to-Market (TTM) would be significantly reduced with the compiler versus assembler however, while the initial TTM may be shorter the problems introduced by compiler bugs (hard to find) and the fact that you do not know from one compiler maintenance release to another if operation code will continue to work (as a result of new compiler bugs being introduced), the TTM reduction is questionable. _________________ Regards, Andrew
http://www.brushelectronics.com/software
Home of Ethernet, SD card and Encrypted Serial Bootloaders for PICs!! |
|
|
Guest
|
Re: Possible bug? |
Posted: Fri Nov 05, 2004 9:24 am |
|
|
davt wrote: | Hi all
If I program the 16F767 with the 16F876 hex file and insert the 16F767 into my test board it works perfectly.
Therefore it would seem that there must be a bug when compiling for the 16f767.
Dave |
Why not just use your 876 code for 767 ?
A lot of things may go wrong, eg. FUSE, device.dat ...
For example, 18F4620 + PCWH 3.212
Level 1 test: printf(" hello world "); ... Fail ! !
Level 2 test: printf( lcd_putc, " hello world "); ... Fail ! !
Look into the ASM file, compared with code for F452, hmmmm
Tools -> Device Editor -> 18F4620 -> ESCI -> TRUE --> modify to FALSE
Level 1 test passed now.
Look into the ASM file, compared with code for F452, hmmmm
comment out the #zero_ram ... hammm
Level 2 test passed now.
What can I say? |
|
|
|