View previous topic :: View next topic |
Author |
Message |
soundscu
Joined: 29 Jun 2007 Posts: 62 Location: Raleigh, NC
|
register and bit names as they appear in the datasheet |
Posted: Wed Dec 02, 2009 10:02 am |
|
|
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
|
|
Posted: Wed Dec 02, 2009 10:54 am |
|
|
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
|
|
Posted: Wed Dec 02, 2009 11:43 am |
|
|
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
|
|
Posted: Wed Dec 02, 2009 12:12 pm |
|
|
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
|
|
Posted: Wed Dec 02, 2009 12:24 pm |
|
|
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
|
|
Posted: Wed Dec 02, 2009 1:32 pm |
|
|
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
|
|
Posted: Sat Oct 16, 2010 10:45 pm |
|
|
Thanks for the tips, very helpful.
It's on the register tab and named 'Make include file' |
|
|
|