View previous topic :: View next topic |
Author |
Message |
worvax
Joined: 20 Feb 2016 Posts: 3
|
DSM for PIC12 |
Posted: Sat Feb 20, 2016 8:13 pm |
|
|
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
|
|
Posted: Sat Feb 20, 2016 8:24 pm |
|
|
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
|
|
Posted: Sat Feb 20, 2016 8:48 pm |
|
|
I believe it is 5.048. |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sat Feb 20, 2016 10:12 pm |
|
|
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
|
|
Posted: Sun Feb 21, 2016 1:52 am |
|
|
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!... |
|
|
worvax
Joined: 20 Feb 2016 Posts: 3
|
|
Posted: Sun Feb 21, 2016 4:28 am |
|
|
Thanks a lot guys! |
|
|
|