The AD5252 is a dual channel, digitally controlled variable resistor (VR) with resolutions of 256 positions. This device performs the same electronic adjustment function as a potentiometer or variable resistor. The AD5252’s versatile programming via a Micro Controller allows multiple modes of operation and adjustment. In the direct program mode a predetermined setting of the RDAC register can be loaded directly from the micro controller. Another key mode of operation allows the RDAC register to be refreshed with the setting previously stored in the EEMEM register. When changes are made to the RDAC register to establish a new wiper position, the value of the setting can be saved into the EEMEM by executing an EEMEM save operation. Once the settings are saved in the EEMEM register, these values will be transferred automatically to the RDAC register to set the wiper position at system power ON. Such operation is enabled by the internal preset strobe and the preset can also be accessed externally. The basic mode of adjustment is the increment and decrement from the present setting of the Wiper position setting (RDAC) register. An internal scratch pad RDAC register can be moved UP or DOWN, one step of the nominal resistance between terminals A-and-B. This linearly changes the wiper-to-B terminal resistance (RWB) by one out of 64/256 positions of the AD5251/AD5252 end- to-end resistance (RAB). For non-linear changes in wiper setting, a left/right shift command adjusts levels in 6dB steps, which can be useful for sound and light alarm applications.
The goal of this project (Microcontroller No-OS) is to be able to provide reference projects for lower end processors, which can't run Linux, or aren't running a specific operating system, to help those customers using microcontrollers with ADI parts. Here you can find a generic driver which can be used as a base for any microcontroller platform and also specific drivers for Renesas platforms.
HW Platform(s):
The driver contains two parts:
The Communication Driver has a standard interface, so the AD5252 driver can be used exactly as it is provided.
There are three functions which are called by the AD5252 driver:
I2C driver architecture
The following functions are implemented in this version of AD5252 driver:
Function | Description |
---|---|
unsigned char AD5252_Init(void) | Initializes the communication with the device. |
void AD5252_SendCommand(unsigned char instruction, unsigned char rDacAddress) | Sends a command to the device. |
void AD5252_WaitForDevice(void) | Performs an Acknowledge Polling. |
void AD5252_WriteRDAC(unsigned char rDacAddress, unsigned char data) | Writes data to a RDAC. |
unsigned char AD5252_ReadRDAC(unsigned char rDacAddress) | Reads data from a RDAC. |
void AD5252_WriteEEMEM(unsigned char memAddress, unsigned char data) | Writes data to EEMEM registers. |
unsigned char AD5252_ReadEEMEM(unsigned char memAddress) | Reads data form EEMEM registers. |
This section contains a description of the steps required to run the AD5252 demonstration project on a Renesas RL78G13 platform.
An EVAL-AD5252SDZ has to be interfaced with the Renesas Demonstration Kit (RDK) for RL78G13:
EVAL-AD5252SDZ A connector Pin SCL_BF (SCL) → YRDKRL78G13 J9 connector Pin 1 EVAL-AD5252SDZ A connector Pin SDA_BF (SDA) → YRDKRL78G13 J9 connector Pin 3 EVAL-AD5252SDZ A connector Pin WP_BF (WP) → YRDKRL78G13 J11 connector Pin 9
With the Applilet3 for RL78G13 tool the following peripherals have to be configured:
Choose the Single master transfer mode and configure the interface with the following settings:
Choose to generate the Transmit/receive function for the CSI10 and configure the interface with the following settings:
Disable the watchdog timer:
The reference project initializes the device, reads the RDAC1 tolerance and then continuously increases the output resistance until reaches the upper limit followed by a continuously decrease until reaches lower limit. The project also provides an example of writing and reading from EEMEM.
This section presents the steps for developing a software application that will run on the Renesas Demo Kit for RL78G13 for controlling and monitoring the operation of the ADI part.
Two software applications have to be used: Applilet3 for RL78G13 (a tool that automatically generates device drivers for MCU peripheral functions) and IAR Embedded Workbench for Renesas RL78 (the integrated development environment).
This section contains a description of the steps required to run the AD5252 demonstration project on a Renesas RX62N platform.
An EVAL-AD5252EBZ board has to be interfaced with the Renesas Demonstration Kit (RDK) for RX62N:
EVAL-AD5252SDZ A connector Pin SCL_BF (SCL) → YRDKRX62N J2 connector Pin 1 EVAL-AD5252SDZ A connector Pin SDA_BF (SDA) → YRDKRX62N J2 connector Pin 3 EVAL-AD5252SDZ A connector Pin WP_BF (WP) → YRDKRX62N J8 connector Pin 17
The reference project: The reference project initializes the device, reads the RDAC1 tolerance and then continuously increases the output resistance until reaches the upper limit followed by a continuously decrease until reaches lower limit. The project also provides an example of writing and reading from EEMEM.
This section presents the steps for developing a software application that will run on the Renesas Demo Kit for RX62N for controlling and monitoring the operation of the ADI part.
声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉
全部0条评论
快来发表一下你的评论吧 !