Where are VREF.BGOUTEN (1V bandgap voltage reference output enable) and VREF.TSEN (temperature sensor enable)?

Go To Last Post
2 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

The D09 (D10/D11) datasheet on page 150, section 16.6.12.1 ("User Control of the Voltage Reference System"), says:

 

To enable the temperature sensor, write a one the Temperature Sensor Enable bit (VREF.TSEN) in the VREF register. The temperature sensor can be redirected to the ADC for conversion. The Bandgap Reference Voltage Generator output can also be routed to the ADC if the Bandgap Output Enable bit (VREF.BGOUTEN) in the VREF register is set. The Bandgap Reference Voltage Generator output level is determined by the CALIB bit group (VREF.CALIB) value in the VREF register.The default calibration value can be overridden by the user by writing to the CALIB bit group.

 

I can't find the VREF register. There is nothing in adc.h. The BGOUTEN and TSEN fields are also a dead end.

 

When I read the 1V reference anyway, the values are those of an unconnected pin, ex: 1843, 1565, 2072, 1575, 2063, 2085, 1577, 1847, 2083, 2089, 2106, 2025, 2090, etc. 

 

 

I did find: http://atmel.force.com/support/a...

 

Did I overlook something??

 

This topic has a solution.

Last Edited: Wed. May 11, 2016 - 11:16 AM
This reply has been marked as the solution. 
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

They are in sysctrl.h, the relevant section is:

 

/* -------- SYSCTRL_VREF : (SYSCTRL Offset: 0x40) (R/W 32) Voltage References System (VREF) Control -------- */
#if !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__))
typedef union {
  struct {
    uint32_t :1;               /* bit:      0  Reserved                           */
    uint32_t TSEN:1;           /* bit:      1  Temperature Sensor Enable          */
    uint32_t BGOUTEN:1;        /* bit:      2  Bandgap Output Enable              */
    uint32_t :13;              /* bit:  3..15  Reserved                           */
    uint32_t CALIB:11;         /* bit: 16..26  Bandgap Voltage Generator Calibration */
    uint32_t :5;               /* bit: 27..31  Reserved                           */
  } bit;                       /* Structure used for bit  access                  */
  uint32_t reg;                /* Type      used for register access              */
} SYSCTRL_VREF_Type;
#endif /* !(defined(__ASSEMBLY__) || defined(__IAR_SYSTEMS_ASM__)) */

#define SYSCTRL_VREF_OFFSET         0x40         /* (SYSCTRL_VREF offset) Voltage References System (VREF) Control */
#define SYSCTRL_VREF_RESETVALUE     0x00000000ul /* (SYSCTRL_VREF reset_value) Voltage References System (VREF) Control */

#define SYSCTRL_VREF_TSEN_Pos       1            /* (SYSCTRL_VREF) Temperature Sensor Enable */
#define SYSCTRL_VREF_TSEN           (0x1ul << SYSCTRL_VREF_TSEN_Pos)
#define SYSCTRL_VREF_BGOUTEN_Pos    2            /* (SYSCTRL_VREF) Bandgap Output Enable */
#define SYSCTRL_VREF_BGOUTEN        (0x1ul << SYSCTRL_VREF_BGOUTEN_Pos)
#define SYSCTRL_VREF_CALIB_Pos      16           /* (SYSCTRL_VREF) Bandgap Voltage Generator Calibration */
#define SYSCTRL_VREF_CALIB_Msk      (0x7FFul << SYSCTRL_VREF_CALIB_Pos)
#define SYSCTRL_VREF_CALIB(value)   (SYSCTRL_VREF_CALIB_Msk & ((value) << SYSCTRL_VREF_CALIB_Pos))
#define SYSCTRL_VREF_MASK           0x07FF0006ul /* (SYSCTRL_VREF) MASK Register */

 

Use as follows:

 

SYSCTRL->VREF.bit.BGOUTEN = 1;      // enable 1V reference
SYSCTRL->VREF.bit.TSEN = 1;         // enable temperature sensor

 

Last Edited: Wed. May 11, 2016 - 11:20 AM