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 support@ccsinfo.com

Question about the IDE and include files....

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



Joined: 27 Oct 2010
Posts: 28

View user's profile Send private message

Question about the IDE and include files....
PostPosted: Wed Jul 31, 2013 11:25 pm     Reply with quote

Hello.

I must say I'm new to using the IDE from CCS, I almost 99% of the time use MPLAB.

I'm trying to use the option in the IDE that generates include files (structs and variables).

After it generates the include file I saw that for the TxCON registers it generates the same name for different registers.

Code:

#word MCU_T1CON = 0x104
#bit    MCU_TCS = MCU_T1CON.1

#word MCU_T2CON = 0x110
#bit    MCU_TCS = MCU_T2CON.1


#word MCU_T3CON = 0x112
#bit    MCU_TCS = MCU_T3CON.1



Shouldn't the IDE generate different names for the different registers, maybe MCU_TCS1, MCU_TCS2?

Maybe I'm missing some feature on the generating part (this is for a 24FJMC101).

Thanks in advance.
Ttelmah



Joined: 11 Mar 2010
Posts: 19328

View user's profile Send private message

PostPosted: Thu Aug 01, 2013 12:58 am     Reply with quote

Use of register names and bits is rarely needed, and generally discouraged. I'd suspect that you have found a fault in the generation, that no one else has found, because they never use it.....

In general, 99% of register/bit accesses, are now never wanted, because the compiler handles the functions for you. This ability was left present for the few 'old/odd' occasions where an antique program wanted these. Most such programs would pre-date the PIC24, and having multiple TCS bits.

Report the duplication to CCS.

If you want for a very few bits to use names, then use the SFR name ability instead (getenv). I'd doubt is 1 in 1000 of the 'old hands' with CCS, ever use the automated register naming now.

Best Wishes
mcr1981



Joined: 27 Oct 2010
Posts: 28

View user's profile Send private message

PostPosted: Thu Aug 01, 2013 1:13 am     Reply with quote

Thanks Mr. Ttlemah for the super-fast response. Will report this to CCS.

Ttelmah wrote:
Use of register names and bits is rarely needed, and generally discouraged. I'd suspect that you have found a fault in the generation, that no one else has found, because they never use it.....

In general, 99% of register/bit accesses, are now never wanted, because the compiler handles the functions for you. This ability was left present for the few 'old/odd' occasions where an antique program wanted these. Most such programs would pre-date the PIC24, and having multiple TCS bits.

Report the duplication to CCS.

If you want for a very few bits to use names, then use the SFR name ability instead (getenv). I'd doubt is 1 in 1000 of the 'old hands' with CCS, ever use the automated register naming now.

Best Wishes



Did not know this "getenv" thing (I'm kinda bad with C), but will use it. Got your info here: http://www.ccsinfo.com/forum/viewtopic.php?t=50698&highlight=getenv

Thanks.
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