Intel® FPGA University Program
University Program Material, Education Boards, and Laboratory Exercises
Announcements
Intel Support hours are Monday-Fridays, 8am-5pm PST, except Holidays. Thanks to our community members who provide support during our down time or before we get to your questions. We appreciate you!

Need Forum Guidance? Click here
Search our FPGA Knowledge Articles here.
1049 Discussions

Using the DE-Series ADC Controller

Letangly
Beginner
237 Views

When the following c-code is loaded, the leds will light up but not respond to the attached pot.

The leds hold their initial value, and this initial value changes on different load attempts (I'm not sure what changes I've made to make this happen). 

De0 Nano
Platform Designer Modules:
    Nios ii, econ-mode
    on-chip memory
    ADC   
    Leds   
   JTAG

=========================================================

#define ADC_ADDR 0x00011000 //Qsys defined base address for the ADC
#define LED_ADDR 0x00011020 //Qsys defined base address for the LEDs

int main (void)
{

volatile int * adc = (int*)(ADC_ADDR);
volatile int * led = (int*)(LED_ADDR);

unsigned int data;
int channel;

data = 0;
channel = 0;

while(1)
{
*(adc) = 0; //Start the ADC read
data = *(adc+channel); //Get the value of the selected channel
data = data/16; //Ignore the lowest 4 bits
*(led) = data; //Display the value on the LEDs
usleep(100000);


//*(led) = 0x00;
//usleep(100000);
//*(led) = 0xFE;
//usleep(100000);


}
return 0;
}

========================================================

Any help is greatly appreciated

0 Kudos
2 Replies
EricMunYew_C_Intel
Moderator
195 Views

Hi, Joseph


May I know which document you are referring to ?


Eric


EricMunYew_C_Intel
Moderator
185 Views

Hi, Joseph


I think your ADC is not reading a new data.

You may need to check your reference design.


Can we close it if you have no more inquiry ?


Eric




Reply