Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
1198 Discussions

ADC Interfacing with DE2 (General Overview)

Altera_Forum
Honored Contributor II
2,496 Views

Hi 

 

We have decided to use the Nios DE2 board as a development tool for my part 4 Electrical Engineering Project. 

 

I have some experience with using the Nios DE2 Board however I have very little experience interfacing the DE2 board with other external peripherals. 

 

I am in the process of selecting some ADCs to interface with the DE2 board. I need 4 ADCs for the 4 sensors. They do not have to be high speed and i haven't checked the DE2's voltage specifications yet but my guess would be 5V? 

 

Anyway, if anyone has any advice or related articles that could make this process easier I would love some help. I have looked at several posts on this forum already but most of them seem to be from people who have either had experience with external DE2 peripherals or have already selected their ADC's etc. I'm looking for a more general overview of how to go about the following: 

 

1) Selecting the right kind of ADCs 

2) Hardware Interfacing of the ADCs with the Nios DE2 Board 

3) Managing the ADCs as a peripheral in the SOPC builder 

4) Finally implementing and testing the ADCs with code 

 

I understand how ADC's work etc but am unfamiliar with the different types of ADCs and the trade offs when interfacing them with the DE2 board. 

 

 

Thanks for your help! :) 

 

Alastair
0 Kudos
8 Replies
Altera_Forum
Honored Contributor II
1,344 Views

I am now thinking of using an ATMega8 to manage the ADC's and then interfacing an output of this with the Expansion Header Pins on the DE2 Board as it seems like a reasonably low cost hopefully quite simple solution (We have $3 AtMega8s because uni buys in bulk)

0 Kudos
Altera_Forum
Honored Contributor II
1,344 Views

What about using some external ADC ICs?  

You have heaps of I/O expansion on the two expansion headers. 

 

Obviously you'll need to decide on what kind of ADC you required, resolution, sampling type, speed etc. Lots of the different I/C manufacter's provide ext ADCs. Maxim, National, ST etc
0 Kudos
Altera_Forum
Honored Contributor II
1,344 Views

 

--- Quote Start ---  

I am now thinking of using an ATMega8 to manage the ADC's and then interfacing an output of this with the Expansion Header Pins on the DE2 Board as it seems like a reasonably low cost hopefully quite simple solution (We have $3 AtMega8s because uni buys in bulk) 

--- Quote End ---  

 

 

Presuming you're targetting I2C/SPI ADCs. 

 

The DE2 expantion header's pins are 3.3V LVTTL/LVCMOS bi-directional pins. So, that's the kind of digital interface your ADCs need to have. 

 

If you need 5V ADCs, they'll either need to support separate digital/analog supplies or you'll have to insert a level converter between the ADC and the DE2. 

 

If you choose I2C, it's recomended that you add external pull resistors. Although the FPGA pins support a weak pull up which is often is good enough for 100kHz I2C. 

 

In the SOPC builder, you won't manage the ADCs themselves but the SPI/I2C master module. 

 

Software wise, you'll read/write to the SPI/I2C master, instructing it to read/write to I2C slaves (ADCs).
0 Kudos
Altera_Forum
Honored Contributor II
1,344 Views

Thanks for your help guys! 

 

 

--- Quote Start ---  

The DE2 Board provides users two 40-pin expansion headers. Each header 

provides DC +5V (VCC5), DC +3.3V (VCC33), two GND pins for users to build 

their own daughter cards using the DE2 expansion ports. 

--- Quote End ---  

 

So does that mean 3.3 V or 5V or can you choose? Obviously if it is possible to have 5V that would be preferred as that is the output levels of my AtMega8.
0 Kudos
Altera_Forum
Honored Contributor II
1,344 Views

It wont let me include the link to the Datasheet until i have 4 posts so i will post below this one (my 4th post)

0 Kudos
Altera_Forum
Honored Contributor II
1,344 Views

Here we go - pg 27 : using the expansion headers (http://users.ece.gatech.edu/~hamblen/de2/de2%20reference%20manual.pdf)

0 Kudos
Altera_Forum
Honored Contributor II
1,344 Views

I have now decided to use the RS-232 Port of the Nios board and the UART from the AtMega8. I have the appropriate voltage converter available etc. 

 

I have written code for my AtMega8 to emit the serial data of the ADC to the RS-232 Port on the DE2 Board. 

 

I am now in the stage of trying to find some code as i don't have very much experience with the UART on the Nios BUT i do have a working SOPC files with the UART programed in (from a previous uni project)
0 Kudos
Altera_Forum
Honored Contributor II
1,344 Views

You can use the JTAG UART component for debugging to the Nios IDE console. But for RS232 comms via the port on the DE2 board, grab the RS232 IP core from the free University Program IP cores package available from Altera. 

 

- Wire up your hardware (either using portmapping ie. in VHDL or schematic bdf) 

- Create your Nios software from the .SOPCINFO file 

- Let Nios II IDE build your BSP and load the appropriate HAL drivers
0 Kudos
Reply