Quantcast
Channel: Infineon Forums
Viewing all articles
Browse latest Browse all 9892

XMC1400 external VAREF for ADC issue

$
0
0
Hello,

i would like to use the external VAREF (VDD Pin = 5V) for reading ADC results from 5V Sensors

and (VDDP= 3,3V) for digital IO (communication with other ics and so on...

1st question: is that in principle possible? --> VDD > VDDP ?
2nd question how can i activate the external VAREF? --> I am using DAVE 4.3.2 and the ADC Measurement App 4.1.22 --> the generated code looks:

Code:

/*********************** C3 Configurations ************************************/


/*C3 ADC Channel configuration structure*/
XMC_VADC_CHANNEL_CONFIG_t  C3_ch_config =
{
  .input_class                = (uint32_t) XMC_VADC_CHANNEL_CONV_GLOBAL_CLASS0,  /* Global ICLASS 0 selected */
  .lower_boundary_select          = (uint32_t) XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND0,
  .upper_boundary_select          = (uint32_t) XMC_VADC_CHANNEL_BOUNDARY_GROUP_BOUND0,
  .event_gen_criteria        = (uint32_t) XMC_VADC_CHANNEL_EVGEN_NEVER, /*Channel Event disabled */
  .sync_conversion                    = (uint32_t) 0,                            /* Sync feature disabled*/
  .alternate_reference        = (uint32_t) XMC_VADC_CHANNEL_REF_INTREF,  /* Internal reference selected */  //----------------------------------------------this line to external ref ?!
  .result_reg_number          = (uint32_t) 13,                          /* GxRES[13] selected */
  .use_global_result          = (uint32_t) 0,                                              /* Use Group result register*/
  .result_alignment          = (uint32_t) XMC_VADC_RESULT_ALIGN_RIGHT,  /* Result alignment - Right Aligned*/
  .broken_wire_detect_channel = (uint32_t) XMC_VADC_CHANNEL_BWDCH_VAGND, /* No Broken wire mode select*/
  .broken_wire_detect                  = (uint32_t) 0,                                    /* No Broken wire detection*/
  .bfl                        = (uint32_t) 0,                            /* No Boundary flag */
  .channel_priority          = (uint32_t) 0,                                    /* Lowest Priority 0 selected*/
  .alias_channel              = (int8_t) -1,                        /* ALIAS is Disabled*/
};

/*C3 Result configuration structure*/
XMC_VADC_RESULT_CONFIG_t C3_res_config =
{
  .data_reduction_control  = (uint8_t) 0,  /* No Accumulation */
  .post_processing_mode    = (uint32_t) XMC_VADC_DMM_REDUCTION_MODE,
  .wait_for_read_mode            = (uint32_t) 0,  /* Disabled */
  .part_of_fifo                  = (uint32_t) 0 , /* No FIFO */
  .event_gen_enable              = (uint32_t) 0  /* Disable Result event */
};

/* C3 ADC channel Handle */
ADC_MEASUREMENT_CHANNEL_t ADC_MEASUREMENT_C3_handle =
{
  .ch_num        = (uint8_t) 2,
  .group_handle  = (VADC_G_TypeDef*)(void*) VADC_G1,
  .group_index        = (uint8_t) 1,
  .ch_handle        = (XMC_VADC_CHANNEL_CONFIG_t*) &C3_ch_config,
  .res_handle        = (XMC_VADC_RESULT_CONFIG_t*) &C3_res_config,
};

Attachment 2691
Attachment 2692

According to these pictures i thought its working without any problems.

But in my test setup goes something wrong: when i conect VDD to 5V then the VDDP Pins (normally 3,3V) rise up to 4V. When i disconect VDD, then is the reference voltage 2,5V at this pin.

Can anybody explain me what i am doing wrong?

Big Thnaks!

Andi
Attached Images

Viewing all articles
Browse latest Browse all 9892

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>