FPGA, SoC, And CPLD Boards And Kits
FPGA Evaluation and Development Kits

Newbie project problems

Altera_Forum
Honored Contributor II
1,681 Views

Hi All, 

 

I am very new to the altera board, i have never done fpga programming before, I dont know where to start 

 

I have a stratrix-II EP2s180 board. I have to program this board such that it takes in a sine wave and converts it to digital format and stores it in the 32MB compact flash given. 

 

As a step one I am using simulink(matlab) sine wave generator to generate the sinewave then I give it to the on board A/d converter, then I gave it to the scope(simulink) and check the output, it seems to be digitizing the signal, but How do i view this when i program this code on the board 

 

I guess I could use the signal tap like the factory default program, but how do i generate sine wave from the board itself, change the frequency to something below 5kHz? I need to sample this at 10Khz too:confused:  

 

My questions might be really dump but I would appreciate some help on this as i am totally confused and lost 

 

Regards 

DSPBoard
0 Kudos
5 Replies
Altera_Forum
Honored Contributor II
808 Views

HI DSPBoard, 

 

The MATLAB sine wave generator will give you a quick way to design your system. However, to test it on the actual board, you need to use some sort of waveform generator to generate the sine wave and then feed that into the A2D port of your DSP port. The A2D should digitize your sine wave for you, and then you just need to save that into the 32MB compact flash. 

 

If you look at the factory default program, it stores a digital version of sine wave in a look-up-table and then pass that through D2A and to A2D. (If I remember correctly). Therefore, I don't think it's quite applicable in your case.
0 Kudos
Altera_Forum
Honored Contributor II
808 Views

Use the the nco megacore to gerate youre sine wave.

0 Kudos
Altera_Forum
Honored Contributor II
808 Views

Hi WrongHorizon 

Is there a way You know I could do this, I mean simulink is pretty much useless, so How do I generate the sine way, for that sampling rate, Any ideas are welcome, I am so lost and confused, I dont know where u read anything for this 

Regards 

DSP board
0 Kudos
Altera_Forum
Honored Contributor II
808 Views

 

--- Quote Start ---  

Use the the nco megacore to gerate youre sine wave. 

--- Quote End ---  

 

How, is there an example to use nco megacore ? Do you think i should be using nios software instead of the Simulink
0 Kudos
Altera_Forum
Honored Contributor II
808 Views

I wouldn't say Simulink/DSP Builder is useless. You can use it to test out your design pretty easily. You can potentially do this: Simulink SINE wave block connect to a ADC block, which is connected to some sort of memory storage unit. Besides the SINE wave block, everything else can be built with Altera block. Once you have verified your design, you can program it onto the board. 

 

Now to set the sampling rate... you can use the clock block. In the clock block, you can specify what the real world clock period is and also what each sample in Simulink signifies (i.e. each Simulink sample can correspond to 1 ms of real world clock or so). The combination of the two should allow you to create sine waves of different sampling frequency.  

 

Also, you can always use the NCO core to create the sine wave of a specific sampling rate (as pointed out by mirimon).  

 

Anyways, hope this helps.
0 Kudos
Reply