Skip to content

GSBhatta/FPGA-Projects

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

10 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

ADC128S022 Interface using DE0-Nano (Cyclone IV E FPGA)

πŸ“Œ Overview

This project implements a complete SPI-based interface between the ADC128S022 (12-bit, 8-channel ADC) and the Intel/Altera DE0-Nano FPGA. The design reliably acquires multi-channel analog data, performs SPI communication with the ADC, and makes the sampled 12-bit data available inside the FPGA for further processing or storage.

This repository contains:

  • RTL implementation of the SPI master
  • ADC control logic (channel selection, mode control, shutdown control)
  • Timing implemented exactly as per ADC128S022 datasheet
  • SystemVerilog testbench with verified waveforms
  • Optional data storage using internal M9K memory blocks

🎯 Features

βœ” Full SPI Master (Compatible with ADC128S022)

  • SCLK generation
  • CS control
  • DIN command framing
  • DOUT sampling (12-bit)

βœ” Configurable Channel Selection

  • Supports SINGLE mode and SCAN mode
  • Any combination of channels can be enabled

βœ” Precise Timing Control

  • Sample DOUT on rising edge of SCLK
  • Update DIN on falling edge of SCLK
  • Meets tSU(DIN), tH(DIN), tDO timing requirements

🧩 Project Structure

β”œβ”€β”€ rtl/
β”‚   β”œβ”€β”€ adc_interface.v        # Top-level ADC interface
β”‚
β”œβ”€β”€ tb/
β”‚   β”œβ”€β”€ adc_interface_tb.sv    # Full SystemVerilog testbench
β”‚   β”œβ”€β”€ waves/                 # Simulation waveforms
β”‚
β”œβ”€β”€ docs/
β”‚   β”œβ”€β”€ block_diagram.png
β”‚   β”œβ”€β”€ timing_notes.md
β”‚
└── README.md

πŸ”§ Hardware Used

DE0-Nano Board

  • Cyclone IV EP4CE22F17C6N

ADC128S022

  • 12-bit, 8-channel ADC
  • SPI serial interface

External Analog Sources

  • Any 0–3.3 V sensor or input

πŸ“ SPI Timing (Datasheet Accurate)

  • Sample DOUT on rising edge of SCLK
  • Update DIN on falling edge of SCLK
  • CS must remain LOW for the full 16-clock frame
  • 12-bit valid data appears on bits 4 to 15

Tested SCLK frequency: up to 2.5 MHz on DE0-Nano.


πŸ§ͺ Simulation

The SystemVerilog testbench verifies:

  • Correct SCLK generation
  • Bit-accurate DOUT sampling
  • Sequential sampling of enabled channels
  • Channel selection updated in next frame
  • Shutdown mode waveform
  • Memory write timing

Simulation Tool: ModelSim-Intel FPGA Starter Edition


πŸ“¦ Synthesis & FPGA Notes

  • Built using Quartus Prime Lite
  • Fully timing-clean at 50 MHz
  • M9K blocks used for optional memory storage
  • All pin assignments included in .qsf

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published