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

DSM for PIC12

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



Joined: 20 Feb 2016
Posts: 3

View user's profile Send private message

DSM for PIC12
PostPosted: Sat Feb 20, 2016 8:13 pm     Reply with quote

Hi all!
I am a bit confused about how CCS handles some modules. For example - I am playing with 12F1822 and I noticed that the datasheet says that this chip have DSM, but there is nothing mentioned about it in the header file. So what is happening?
Thanks!
temtronic



Joined: 01 Jul 2010
Posts: 9245
Location: Greensville,Ontario

View user's profile Send private message

PostPosted: Sat Feb 20, 2016 8:24 pm     Reply with quote

What version of the compiler do you have? If you have an older version it might not be in it?


Jay
worvax



Joined: 20 Feb 2016
Posts: 3

View user's profile Send private message

PostPosted: Sat Feb 20, 2016 8:48 pm     Reply with quote

I believe it is 5.048.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sat Feb 20, 2016 10:12 pm     Reply with quote

If there is no CCS support, you have to write the code to do it.
In this post, jgschmidt shows how to use the DSM module by direct
register access.
https://www.ccsinfo.com/forum/viewtopic.php?t=50356

Another option is to write the setup_dsm() function yourself. Look at
the 16F1825.h file. CCS supports DSM for that PIC. It has the full set
of constants for the setup_dsm() function.

Most CCS functions just do register stuffing, and so does setup_dsm().
This makes it easy to write the function. You can define the DSM registers
with #byte statements, and then put each parameter in the setup_dsm()
function into the appropriate DSM register in the body of the function.
Look at the list of constants in 16F1825.h and at the 12F1822 data sheet
to see what DSM register each parameter should be loaded into.
Ttelmah



Joined: 11 Mar 2010
Posts: 19545

View user's profile Send private message

PostPosted: Sun Feb 21, 2016 1:52 am     Reply with quote

Or just contact CCS.....

Since they have the source code for the DSM, they will add this. It is undoubtedly just a case that the module got missed. If you look at the thread PCM_programmer points to, this was for the 1825, and support for the DSM has been added for this chip now. There are so many peripherals on some chips, that support can get missed, until a user points it out!... Smile
worvax



Joined: 20 Feb 2016
Posts: 3

View user's profile Send private message

PostPosted: Sun Feb 21, 2016 4:28 am     Reply with quote

Thanks a lot guys!
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