This code creates a custom system with a 100 MHz timer using PLL, a nios2 CPU, 8192 bytes ram for stack space, PIO to output to the LEDs and an ADC processing 8 channels at 12.5 MHz. it then uses a C program to enable auto update mode, and reads from channel 0 repeatedly, writing the upper 8 bits (of the 12 bits) to the LEDs. This follows the basic design in https://ftp.intel.com/Public/Pub/fpgaup/pub/Teaching_Materials/current/Tutorials/Using_DE_Series_ADC.pdf
The C code given in the document did not work, so I changed it to use auto update mode, and always read from channel 0.
However the ADC still always returns 0x8000. The 15th bit is meant to indicate that the data is ready, but the lower 12 bits are not updating. This makes the current program always write 0 to the LEDs to turn them off. If I use the debugger to change the value to 0xFFFF, it turns all the LEDs on, so I know the LED output part is working.
This code creates a custom system with a 100 MHz timer using PLL, a nios2 CPU, 8192 bytes ram for stack space, PIO to output to the LEDs and an ADC processing 8 channels at 12.5 MHz. it then uses a C program to enable auto update mode, and reads from channel 0 repeatedly, writing the upper 8 bits (of the 12 bits) to the LEDs. This follows the basic design in https://ftp.intel.com/Public/Pub/fpgaup/pub/Teaching_Materials/current/Tutorials/Using_DE_Series_ADC.pdf
The C code given in the document did not work, so I changed it to use auto update mode, and always read from channel 0. However the ADC still always returns 0x8000. The 15th bit is meant to indicate that the data is ready, but the lower 12 bits are not updating. This makes the current program always write 0 to the LEDs to turn them off. If I use the debugger to change the value to 0xFFFF, it turns all the LEDs on, so I know the LED output part is working.