Analog/Digital Conversion on the FPGA
Lots of times we're going to need to interface our systems with the real world. While digital signals are useful, most of the real world data operates as analog values which are an infinite number of continuous numbers within a given range. In order to process them, ADC circuits convert these values into digital data that can be processed by an electronic system such as a computer or dedicated circuit.
We got two options for using ADC's in the FPGA, the first is to create a specialized circuit such as a state machine to capture the data for us. The second is to use a microprocessor core to do the work for us.
We got two options for using ADC's in the FPGA, the first is to create a specialized circuit such as a state machine to capture the data for us. The second is to use a microprocessor core to do the work for us.
Analog Capture using Picoblaze
Load the files for compiling KCPSM3 and the adc_ctrl.psm file to a compilation folder as shown.
Open dosbox in the folder where the KCPSM3 files are and compile with the instruction:
$ KCPSM3.EXE ADC_CTRL.PSM
$ KCPSM3.EXE ADC_CTRL.PSM
Next create a project on ISE and select Project->Load Source. Add the files:
- ADC_CTRL.VHD - This is generated by KCPSM3.EXE previously.
- picoblaze_amp_adc_control.ucf - Pins for the FPGA to recognize.
- picoblaze_amp_adc_control.vhd - Links the microprocessor and the FPGA.
- kcpsm3.vhd - Defines the microprocessor on VHDL.
Of interest is that I had to edit the picoblaze_amp_adc_control code to delete the PROC_RESET element as it didn't exist in picoblaze_amp_adc_control. If it marks an error, just go to the line and try compiling after deleting it. Load the application on the FPGA as usual and test.
|
|
|
|