OpenCores

Project maintainers

Details

Name: pmodad2driver
Created: Feb 11, 2025
Updated: Feb 13, 2025
SVN Updated: Feb 13, 2025
SVN: Browse
Latest version: download (might take a bit to start...)
Statistics: View
Bugs: 0 reported / 0 solved
Star0you like it: star it!

Other project properties

Category:Other
Language:VHDL
Development status:Beta
Additional info:
WishBone compliant: No
WishBone version: n/a
License: LGPL

PmodAD2Driver

Pmod AD2 Driver for the 4 Channels of 12-bit Analog-to-Digital Converter AD7991. The communication with the ADC uses the I2C protocol. User can specifies the I2C Clock Frequency (up to 400 kHz with the Fast Mode).

Usage

User specifies inputs: I2C mode (i_mode), ADC Slave Address (i_addr), Configuration Byte (i_config_byte, write mode only) and the Last Read Cycle trigger (i_last_read, read mode only).

The i_enable signal can be triggered (set to '1') to begin transmission.

When started, the PmodAD2Driver executes the complete operation cycle (configurations or ADC conversions) independently of the new i_enable signal value.

At the end of the operation cycle, if the i_enable signal is still set to '1', the PmodAD2Driver executes the operation again with the current inputs.

The o_ready signal (set to '1') indicates the PmodAD2Driver is ready to process new operation. The o_ready signal is set to '0' to acknowledge the receipt.

The o_ready signal is set to '0' to acknowledge the receipt.

In Write mode, the PmodAD2Driver writes the Configuration byte into the ADC register and stop the transmission.

In Read mode, the PmodAD2Driver always reads 2-byte ADC conversion values channel-by-channel (according to ADC configuration).

The ADC value (o_adc_value) is available when its validity signal (o_adc_valid) is asserted.

In Read mode, while the i_last_read is NOT set to '1', the PmodAD2Driver execute the read operation.

ADC AD7991 has 2 I2C Addresses:
AD7991-0: 010 1000
AD7991-1: 010 1001

Configuration Register (8-bit Write Only):

D7D6D5D4D3D2D1D0Bit
CH3CH2CH1CH0REF_SELFLTRBit Trial delaySample delayDescription
11110000Default Value

Configuration Register MSB Description:

D7D6D5D4Analog Input Channel
0000No channel selected
0001Convert on VIN0
0010Convert on VIN1
0011Sequence between VIN0 and VIN1
0100Convert on VIN2
0101Sequence between VIN0 and VIN2
0110Sequence between VIN1 and VIN2
0111Sequence among VIN0, VIN1, and VIN2
1000Convert on VIN3
1001Sequence between VIN0 and VIN3
1010Sequence between VIN1 and VIN3
1011Sequence among VIN0, VIN1, and VIN3
1100Sequence between VIN2 and VIN3
1101Sequence among VIN0, VIN2, and VIN3
1110Sequence among VIN1, VIN2, and VIN3
1111Sequence among VIN0, VIN1, VIN2, and VIN3

Conversion Result Register (16-bit Read Only):

D15D14D13D12D11D10D9D8D7D6D5D4D3D2D1D0
00CHID1CHID0MSBB10B9B8B7B6B5B4B3B2B1B0

Signal Generator Pin Description

Generics

NameDescription
sys_clockSystem Input Clock Frequency (Hz)
i2c_clockI2C Serial Clock Frequency (Standard Mode: 100 kHz, Fast Mode: 400 kHz)

Ports

NameTypeDescription
i_sys_clockInputSystem Input Clock
i_enableInputModule Enable ('0': Disable, '1': Enable)
i_modeInputRead or Write Mode ('0': Write, '1': Read)
i_addrInputADC Address (7 bits)
i_config_byteInputADC Configuration Byte (8 bits)
i_last_readInputIndicates the Last Read Operation ('0': Continue Read Cycle, '1': Last Read Cycle)
o_adc_validOutputADC Read Value Valid ('0': Not Valid, '1': Valid)
o_adc_valueOutputADC Read Value
o_readyOutputADC Ready Status ('0': NOT Ready, '1': Ready)
io_sclIn/OutI2C Serial Clock ('0'-'Z'(as '1') values, working with Pull-Up)
io_sdaIn/OutI2C Serial Data ('0'-'Z'(as '1') values, working with Pull-Up)