• AVR Freaks

Hot!P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SDCX

Author
zhizaibidedz
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/10/29 05:54:07
  • Location: 0
  • Status: offline
2019/12/09 18:39:52 (permalink)
0

P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SDCX

1 Aim:
To set up the PWM in dsPIC33EP32MC204 to make it work in the independent output mode.
 
2 Problems:
1) P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SDCX, SPHASE and so on.
Does it mean that the PWM module in dsPIC33EP32MC204 cannot work in the independent mode? If not, why does the reference manual indicate it is useful in dsPIC33EP series ? And which chip can have a PWM working in the independent mode?
2) Is there any other C compiler that can used to compile the c code in MPLAB X IDE?
3) If I still use XC16 compiler, is there any way that I can do to make the the PWM module in dsPIC33EP32MC204 work in the independent mode? HOW?
#1
du00000001
Just Some Member
  • Total Posts : 3956
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SD 2019/12/10 11:32:32 (permalink)
0
Enlighten me: from which derivative stem the "SDCX, SPHASE and so on" ?
 
You could enlighten me even more, telling me that you do not know the search function of the Adobe reader: from the title page of the datasheet : "* Up to Three PWM Pairs with Independent Timing"
I suppose this is what you're denoting as "independent mode". Correct ?

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#2
zhizaibidedz
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/10/29 05:54:07
  • Location: 0
  • Status: offline
Re: P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SD 2019/12/10 17:59:37 (permalink)
0
1 Related document:
The official website of dsPIC33EP32MC204:https://www.microchip.com/wwwproducts/en/dsPIC33EP32MC204
PWM reference manual:http://ww1.microchip.com/downloads/en/DeviceDoc/70645C.pdf
 
2 Please search "Independent PWM Mode" in PWM reference manual. And you will understand what is the independent mode. Also, you can search SDCX and SPHASEX, and you will know where they are derivated. 
 


#3
Aussie Susan
Super Member
  • Total Posts : 3760
  • Reward points : 0
  • Joined: 2008/08/18 22:20:40
  • Location: Melbourne, Australia
  • Status: offline
Re: P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SD 2019/12/10 18:40:06 (permalink)
+1 (1)
This comes down to understanding how Microchip organise their documentation.
The data sheet refers to a specific MCU or perhaps a selected number of MCUs. The data sheet will tell you exactly what peripherals and registers there are for that MCU.
Each MCU is typically made up of a collection of modules, and each module is described in the associated Family Reference Manual.
The problem that you are encountering is that the FRM will typically tell you about all of the features of a module, but a specific MCU may or may not implement all of those features. In the FRM you reference, look at Register 14-17 and Note #2 below it where it says that the SDCx register is not available in all devices. You happen to have a device that does NOT have this register as it is not describe in the data sheet.
As to the register (or bit(s)) name itself, if a device has multiple modules, they are normally named individually with a '1', '2' etc.. When the documentation is talking about the functionality of the register across all of the modules is uses a lower case 'x' in the name. Therefore you have names such as SPIxBUF which reger to the SPI1BUF version of that register in the SPI1 module, the SPI2BUF register in the SPI2 module etc.
Therefore you need to replace the 'x' with the specific module number you are using.
Also you should not be including the processor specific modules they way you have. Just import <xc.h> and the compiler will import the correct module-specific include file for you (that is why you tell the IDE the module you are using - it will pass this on to the compiler).
Susan
#4
du00000001
Just Some Member
  • Total Posts : 3956
  • Reward points : 0
  • Joined: 2016/05/03 13:52:42
  • Location: Germany
  • Status: offline
Re: P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SD 2019/12/11 02:22:09 (permalink)
0
Section 14. High-Speed PWM - e.g. page 14-24
Note 1: Not all of the features and registers listed in this block diagram are available on all devices. Refer to the
“High-Speed PWM” chapter of the specific device data sheet for availability.

 
Seems the EP-MC20X/50X hasn't got the "independent PWMxL" feature.

PEBKAC / EBKAC / POBCAK / PICNIC (eventually see en.wikipedia.org)
#5
zhizaibidedz
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/10/29 05:54:07
  • Location: 0
  • Status: offline
Re: P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SD 2019/12/11 18:02:35 (permalink)
0
Aussie Susan
The problem that you are encountering is that the FRM will typically tell you about all of the features of a module, but a specific MCU may or may not implement all of those features. In the FRM you reference, look at Register 14-17 and Note #2 below it where it says that the SDCx register is not available in all devices. You happen to have a device that does NOT have this register as it is not describe in the data sheet.

Thank you[link=mailto:you@Susan]@Susan[/link]. I totally understand all your explanation. There is only one thing confusing me——Is there any MCU containing the SDCX, etc registers to make it work in indepent mode? As you can see, the PWM FRM is about the dsPIC33E&PIC24E series. But in fact, I check the header file of some other MCU like dsPIC33EP128GP504, and I couldn't find those registers either.(Plus:I do know the X of SDCX should be '1','2',etc.). Could you just find point out one MCU that is able to work in the independent mode? Thanks.
#6
ric
Super Member
  • Total Posts : 28434
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SD 2019/12/11 18:07:20 (permalink)
+1 (1)
All the XC16 header files are on your hard drive.
If I look in
C:\Program Files (x86)\Microchip\xc16\v1.33\support\dsPIC33E\h
for *.h files containing "SDC1", 52 out of 135 header files do contain it.
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#7
zhizaibidedz
New Member
  • Total Posts : 4
  • Reward points : 0
  • Joined: 2019/10/29 05:54:07
  • Location: 0
  • Status: offline
Re: P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SD 2019/12/11 18:17:44 (permalink)
0
@ric Thank you. I just find out the way to search the content of the whole h files in the same folder.
#8
ric
Super Member
  • Total Posts : 28434
  • Reward points : 0
  • Joined: 2003/11/07 12:41:26
  • Location: Australia, Melbourne
  • Status: online
Re: P33EP32MC204.h in XC16 doesn't contain the definition of some PWM registers such as SD 2019/12/11 18:35:23 (permalink)
0
In Windows, you can just enter the search term into the search field at the top right corner of a Windows Explorer window.
I actually used "Windows Grep" to count them
The author's website has expired, but you can still get it from https://download.cnet.com/Windows-Grep/3000-2351_4-75805915.html
 

I also post at: PicForum
Links to useful PIC information: http://picforum.ric323.co...opic.php?f=59&t=15
NEW USERS: Posting images, links and code - workaround for restrictions.
To get a useful answer, always state which PIC you are using!
#9
Jump to:
© 2020 APG vNext Commercial Version 4.5