Oct 25, 2018
02:39 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 25, 2018
02:39 PM
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 ?
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 ?
3 Replies
Oct 30, 2018
03:59 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oct 30, 2018
03:59 AM
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
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
May 12, 2020
07:10 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 12, 2020
07:10 AM
the problem has been solved? now i have the same problem! how get it to work?
May 14, 2020
12:44 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 14, 2020
12:44 AM