XMC 4500 - DAC Problem

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

cross mob
User15933
Level 1
Level 1
Hello!

I want to use the DAC0 Port on my XMC4500 in Single Value Mode. But something is strange with the Output.

Here is my Code:

#include
#include
#include "GPIO.h"
#include "xmc4500.h"

int main(void){

//STEP1_1: De-assert the reset of DAC module by setting DACRS bit in PRCLR1 register
SCU_RESET->PRCLR1 |= 0x20;

//STEP1_2: Write the DACxCFG0 register values. Run => 1, Mode => Single Value Mode = 001 , Unsigned Input Data
DAC->DAC0CFG0 = 0x80100000;

//STEP1_3: Write the DACxCFG1 register values. TRIGMOD = internal Trigger = 00, Output Enable => ANAEN = 1, Scale = 000, OFFS = 0,
DAC->DAC0CFG1 = 0x81010008;

//STEP1_4: Write to DAC0DATA
DAC->DAC0DATA = 0x800;
while(1){
;
}
}

When i write to DAC->DAC0DATA = 0x800; i measure 1,8 V on the Pin, but if I change 0x800 to 0x0; i will get 1,8V too!. Whats the problem here ?
0 Likes
3 Replies
jferreira
Employee
Employee
10 sign-ins 5 sign-ins First like received
Hi,

Have a look at example DAC_SINE in examples of XMCLib, http://dave.infineon.com/Libraries/XMCLib/XMC_Peripheral_Library_v2.1.18.zip

Regards,
Jesus
0 Likes
User19541
Level 1
Level 1
the problem has been solved? now i have the same problem! how get it to work?
0 Likes