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

register and bit names as they appear in the datasheet

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



Joined: 29 Jun 2007
Posts: 62
Location: Raleigh, NC

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

register and bit names as they appear in the datasheet
PostPosted: Wed Dec 02, 2009 10:02 am     Reply with quote

There are many cases where CCS functions don't cover my needs, or they are buggy, or simply don't exist. (For example, I need a function that runs the ADC in the dsPIC33, writing continuously with DMA, using all 4 S&Hs.)

Am I correct that the PIC register and bit names, as they appear in the datasheet, are not already declared somewhere? Do I have to create a #byte or #word for every register I want to access directly? For the dsPIC33 ADC alone, there are many registers... this seems like a collosal waste of time.

Since Microchip has all the registers and bits already defined in MPLAB inc files, it would be nice to somehow access them. Has anyone created a batch file or macro or little program to read the Microchip file and spit out a CCS-compatible .h file?

If I'm way off base here, please set me straight. I just need to quickly and easily set registers and bits to configure peripherals, following the step outlined in the datasheets.

Thanks,
Jim
MikeP



Joined: 07 Sep 2003
Posts: 49

View user's profile Send private message

PostPosted: Wed Dec 02, 2009 10:54 am     Reply with quote

If you have PCW (CCS IDE)you can use the Device editor to do this.
soundscu



Joined: 29 Jun 2007
Posts: 62
Location: Raleigh, NC

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

PostPosted: Wed Dec 02, 2009 11:43 am     Reply with quote

I have the CCS IDE, and will look closer at the device editor. I didn't realize it would be helpful in this case. Can you elaborate just a bit more?

Unfortunately, though, debugging stopped working for me a while ago -- can't get anything to work properly inside CCS. I have the ICD-U40, ICD2, and ICD3. They either don't work or crash my system when trying to debug with them. So I've been working in MPLAB, where both ICDs work perfectly for debugging.

Thanks!
Jim
ckielstra



Joined: 18 Mar 2004
Posts: 3680
Location: The Netherlands

View user's profile Send private message

PostPosted: Wed Dec 02, 2009 12:12 pm     Reply with quote

soundscu wrote:
I have the CCS IDE, and will look closer at the device editor. I didn't realize it would be helpful in this case. Can you elaborate just a bit more?
I don't have the tool at hand here, but when you start the Device Editor (chipedit.exe) you can select a device and then in the upper right corner there is a button for exporting a register header file.

Quote:
Unfortunately, though, debugging stopped working for me a while ago
Post your compiler version number.
soundscu



Joined: 29 Jun 2007
Posts: 62
Location: Raleigh, NC

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

PostPosted: Wed Dec 02, 2009 12:24 pm     Reply with quote

I'm running the most current versions of everything for the dsPIC33. Compiler/IDE version 4.101. Also have the most recent release of Microchip stuff: MPLAB 8.40, and ICD firmware bundled with that release.

Jim
soundscu



Joined: 29 Jun 2007
Posts: 62
Location: Raleigh, NC

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

PostPosted: Wed Dec 02, 2009 1:32 pm     Reply with quote

Spectacular! Creating an include file of registers and bits is easy. :)

Thank you, ckielstra. Very very very much appreciated!

Jim
rampage



Joined: 16 Oct 2010
Posts: 7

View user's profile Send private message

PostPosted: Sat Oct 16, 2010 10:45 pm     Reply with quote

Thanks for the tips, very helpful.
It's on the register tab and named 'Make include file'
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