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

DE10-Standard Computer System with ARM* Cortex* A9

jey1
Beginner
909 Views

Hi,

I need to read the voltage readings of channels 0 and 1 in the DE10 Standard of ADC 0xFF204000 With C code and then translate this reading into the LED bank (0xFF200000), corresponding to GPIO pins 0-9 (0xFF200060).

How Can I do this? I am a student working on a project. Any assistance much appreciated.

 

Thanks

Shan

0 Kudos
4 Replies
jey1
Beginner
899 Views

So far, I got this..

 

#define ADDR_JP1PORT ((volatile char *) 0xFF200060)
#define ADDR_LED ((volatile char *) 0xFF200000)
#define ADDR_ADC ((volatile char *) 0xFF204000)

int main()
{
// init interface directions

int data=0;
int channel_1=0;
//int channel_2=0;


*(ADDR_JP1PORT+4) = 0xFFFFFC00; //set JP1 bit dir to input


*(ADDR_ADC) = 0; // ADC to read
//*(ADDR_ADC+4) =1;
while (1)
{
data= *(ADDR_ADC+channel_1);
data=data/12;
*(ADDR_LED) = data;
}
}

0 Kudos
jey1
Beginner
896 Views

I got something and not confident that as supposed to be. Any assistance is very helpful. 

 

#define ADDR_JP1PORT ((volatile int *) 0xFF200060)

#define ADDR_LED     ((volatile int *) 0xFF200000)

#define ADDR_ADC     ((volatile int *) 0xFF204000)

int main()

   // init interface directions

int data=0;

int channel_1=0;

//int channel_2=0;

   *(ADDR_JP1PORT+4) = 0xFFFFFC00; //set  JP1 bit dir to input

 

  

    *(ADDR_ADC) = 0; // ADC to read

//*(ADDR_ADC+4) =1;

   while (1)

   {

   *(ADDR_JP1PORT)=*(ADDR_ADC);

   data= *(ADDR_ADC+channel_1);

   printf("Data:=%d\n",data);

   data=data/16;

   printf("Data1:=%d\n",data);

      *(ADDR_LED)  = data;

   }

}

0 Kudos
AminT_Intel
Employee
869 Views

Hello,

 

What is the device OPN?

 

Thanks

0 Kudos
AminT_Intel
Employee
855 Views

We do not receive any response from you to the previous question/reply/answer that I have provided. This thread will be transitioned to community support. If you have a new question, feel free to open a new thread to get the support from Intel experts. Otherwise, the community users will continue to help you on this thread. Thank you.

0 Kudos
Reply