CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Problem compiling with CCS > 4.038

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
jmaurin



Joined: 29 Mar 2008
Posts: 26
Location: Ribeirão Preto, SP, Brasil

View user's profile Send private message Visit poster's website ICQ Number

Problem compiling with CCS > 4.038
PostPosted: Sun Mar 06, 2011 7:45 pm     Reply with quote

Hi.
I have a program with i usually compile using CCS 4.038 and everything works fine. I tried to use ANY version after 4.038, but not work, any version.
The program compiles fine, but the memory mapping where code are stored are totally crazy.
My code is to use with Microchip bootloader for 18F4550 and i have these lines to make sure my code start from the right point in memory, but it`s not working anymore.

Code:
//Bootloader
#build(reset=0x800, interrupt=0x808)
#org 0x000, 0x7ff { }


This is the RIGHT code, compiled in PCWHD 4.038
http://img845.imageshack.us/i/working.jpg/

Look at the address, start exactly where i need.
Now, this is the code generated by any CCS after 4.038
http://img402.imageshack.us/i/wrongs.jpg/

And more: this address is random. What i'm missing?
Ttelmah



Joined: 11 Mar 2010
Posts: 19520

View user's profile Send private message

PostPosted: Mon Mar 07, 2011 9:29 am     Reply with quote

Settings.
Check the code format being generated. Normally an odd format like this, is because CCS is set to generate a different output format to the one that the MPLAB program is trying to read. The default changed during the development of V4....

Best Wishes
jmaurin



Joined: 29 Mar 2008
Posts: 26
Location: Ribeirão Preto, SP, Brasil

View user's profile Send private message Visit poster's website ICQ Number

PostPosted: Mon Mar 07, 2011 1:18 pm     Reply with quote

But where? I tried to change everything in "Output Files" and still the same problem :/
jmaurin



Joined: 29 Mar 2008
Posts: 26
Location: Ribeirão Preto, SP, Brasil

View user's profile Send private message Visit poster's website ICQ Number

PostPosted: Fri Apr 15, 2011 10:45 am     Reply with quote

Up
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Fri Apr 15, 2011 12:54 pm     Reply with quote

You didn't post a test program, so there's no real way to test your
exact problem. So I just threw together some code, that may not be in
your same configuration, and compiled it with vs. 4.120 and it works.
Here's the program:
Code:

#include <18F4550.h>
#fuses HS,NOWDT,NOLVP,PUT,NOBROWNOUT
#use delay(clock=20000000)             

//Bootloader
#build(reset=0x800, interrupt=0x808)
#org 0x000, 0x7ff { }

//======================================
void main(void)
{

while(1);
}


Then if I go to View/Disassembly Listing in MPLAB, I get this.
(I don't have your USB bootloader). It's working.
Code:

1:                 #include <18F4550.h>
  0800    EF04     GOTO 0x808
2:                 #fuses HS,NOWDT,NOLVP,PUT,NOBROWNOUT
3:                 #use delay(clock=20000000)             
4:                 
5:                 //Bootloader
6:                 #build(reset=0x800, interrupt=0x808)
7:                 #org 0x000, 0x7ff { }
8:                 
9:                 
10:                //======================================
11:                void main(void)
12:                {
  0808    6AF8     CLRF 0xff8, ACCESS
  080A    9ED0     BCF 0xfd0, 0x7, ACCESS
  080C    6AEA     CLRF 0xfea, ACCESS
  080E    6AE9     CLRF 0xfe9, ACCESS
  0810    50C1     MOVF 0xfc1, W, ACCESS
  0812    0BC0     ANDLW 0xc0
  0814    090F     IORLW 0xf
  0816    6EC1     MOVWF 0xfc1, ACCESS
  0818    0E07     MOVLW 0x7
  081A    6EB4     MOVWF 0xfb4, ACCESS
13:               
14:                while(1);
  081C    D7FF     BRA 0x81c
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group