Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

Legacy microcontrollers Forum Discussions

GeGa_1196981
Level 1
Level 1
5 replies posted 5 sign-ins 5 questions asked

I'm trying to use the DAC example in PDL 2.0.2 to use with the FM4-216-Ethernet since there is no updated example, so I added the corresponding DAC.c and DAC.h files, along with the pdl_user.h that comes with the example,  and when I tried to build the solution it get me this error:

..\..\..\..\Documents\Cypress\PDL\2.0.2\driver\dac\dac.h(53): error: #35: #error directive: "Don't enable DAC, as it is not available on this device"

I get this when I modify this line in pdl_user.h file:

// DAC
#define PDL_PERIPHERAL_ENABLE_DAC0 PDL_ON      //--> changed from PDL_OFF to PDL_ON          

I'm sure this device has DAC peripherals, so what could I be doing wrong?, the problem might be that I'm using an old library so it doesn't support the device I'm working with?

I'm using Keil uVision5 also I tried pulling the pdl_user.h and the DAC files from the PDL 2.0.2 and 2.1.0 none of this works

0 Likes
7 Replies
Roy_Liu
Moderator
Moderator
Moderator
1000 replies posted 500 solutions authored 5 questions asked

Hi,

Might you add the other "pdl_user.h" which is not in the dac example folder, or modify the other "pdl_user.h"?

I see the “PDL_PERIPHERAL_ENABLE_DAC0” is set to “PDL_ON” by default as below in the "Documents\Cypress\PDL\2.0.2\example\dac\dac_sin_tri_wave" folder.

// DAC
#define PDL_PERIPHERAL_ENABLE_DAC0 PDL_ON

 

 

Roy Liu
0 Likes

I tried using both files, the one in PDL 2.0.2 and the one in the PDL 2.1.0 none of them works, It gives me the same error that the DAC it's not available in my device

The Template I'm using is "s6e2ccxl_template-v20" since this is my device but this library doesn't have a DAC Example that's why I'm trying to use an older version of the PDL

0 Likes
Amy_Qian
Employee
Employee
10 solutions authored 10 replies posted 5 solutions authored

Hi,

Please firstly refer to the FM4 Peripheral Driver Library User Guide as below, this can guide you how to use the PDL Examples 

https://www.infineon.com/dgdl/Infineon-FM4_Peripheral_Driver_Library_User_Guide-Software-v02_00-EN.p...

 

0 Likes

This Guide refers to a PDL 1.0 version, which is even older then the 3 completely different Versions I'm currently trying to use, even this guide suggested that I should use their base template as start point.

The template I'm using is "s6e2ccxl_template-v20", since this was the most "updated" example when I started using this device.

Can I still use an older version of the PDL as base and still be compatible with my device? is this even recommended?

I'll try that and see where it gets me... I'll have to rewrite my code and hope i'll works thou

P.S: I'm sorry if I sound a little rude, I know you are trying to help me, I'm just getting a little frustrated because everytime I ask a question in here people always keep redirecting me to an older version of the sofware

0 Likes
Amy_Qian
Employee
Employee
10 solutions authored 10 replies posted 5 solutions authored

Hi,

I tested PDL 2.0.2 template on my side using Keil uVision5, Enable DAC0 is no problem, it can build normally.

the above user guide just is for your reference. you don't have to use the old version. 

Did you configure your correct device in pdl_device.h? you need configure MCU series and package, please check it again.

Amy_Qian_0-1675131523386.png

Can you send me your project "s6e2ccxl_template-v20" , I can help test.

 

0 Likes

Yesterday I tried that too, I tested  the PDL 2.0.2 template with the ADC and it works, but the original problem is still there, compatibility problems,  the new doesn't work with the old, my application use 3 peripherals:

GPIO's, UART, and now DAC's

And the way UART works between both versions has changed a lot, I was able to make the UART Communication works with the same template, what I will try is rewrite my code using the old api

But I still have one more question regarding the GPIO's, I can add the driver but it doesn't recognize a lot of the ports I'm using, I'm guessing that it has to do with what you said:

"Did you configure your correct device in pdl_device.h? you need configure MCU series and package, please check it again."

How do I configure MCU and Package?

What I'm trying to do in this matter is to pull the configuration from my original template, apparently it works but a lot of warnings appear:

" #define SetPinFunc_ZIN1_0(dummy) do{ \
..\..\driver\gpio\gpio_s6e2ccxl.h(11237): warning: #47-D: incompatible redefinition of macro "SetPinFunc_ZIN1_1" (declared at line 9161 of "..\..\driver\gpio\gpio_s6e2gmxj.h")"

which I think is beacuse I did it the wrong way, I'll Attach my original template and the new one

0 Likes
Amy_Qian
Employee
Employee
10 solutions authored 10 replies posted 5 solutions authored

Hi,

Firstly, You can see pdl.h for device choice list, and find the device definitions what you used in pdl.h.

and then copy it and  define PDL_MCU_SERIES / PDL_MCU_PACKAGE in pdl_device.h as below:

Amy_Qian_0-1675219185449.png

and I found that these two files (pdl_device.h and pdl_user.h) weren't in source folder of your s6e2ccxl template project.

Please add them into source folder and try it again.

 

0 Likes