+ Reply to Thread
Results 1 to 2 of 2

Thread: XMC 4500 - DAC Problem

  1. #1
    New Member New Member Alexander Loibl is on a distinguished road
    Join Date
    Oct 2018
    Posts
    1
    Points
    15

    XMC 4500 - DAC Problem

    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 <stdint.h>
    #include <stdbool.h>
    #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 ?

  2. #2

    Infineon Employee
    Infineon Employee
    jferreira will become famous soon enough
    Join Date
    Oct 2012
    Posts
    601
    Hi,

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

    Regards,
    Jesus
    The views expressed here are my personal opinions, have not been reviewed or authorized by Infineon and do not necessarily represent the views of Infineon.

+ Reply to Thread

Tags for this Thread

Disclaimer

All content and materials on this site are provided “as is“. Infineon makes no warranties or representations with regard to this content and these materials of any kind, whether express or implied, including without limitation, warranties or representations of merchantability, fitness for a particular purpose, title and non-infringement of any third party intellectual property right. No license, whether express or implied, is granted by Infineon. Use of the information on this site may require a license from a third party, or a license from Infineon.


Infineon accepts no liability for the content and materials on this site being accurate, complete or up- to-date or for the contents of external links. Infineon distances itself expressly from the contents of the linked pages, over the structure of which Infineon has no control.


Content on this site may contain or be subject to specific guidelines or limitations on use. All postings and use of the content on this site are subject to the Usage Terms of the site; third parties using this content agree to abide by any limitations or guidelines and to comply with the Usage Terms of this site. Infineon reserves the right to make corrections, deletions, modifications, enhancements, improvements and other changes to the content and materials, its products, programs and services at any time or to move or discontinue any content, products, programs, or services without notice.