Here the project.Because of the bad Internet,I have not uploaded it before.
May be problem with the browser, try use IE.
1. you have
int* dst as global variable
int dst in your main loop.
2. when you say cannot dispaly, what actually happen? you can see the
on the display but not the value or it is showning something else?
As L.L. said: remove the "int * dst" from program and move the definition
"int dst" to the global variable area.
Have a look into the DMA-datasheet to see how sram-addresses should be defined in opposite to PSoC3 designs.
Debugging DMA is a bit complicated, since there is no instruction you can stop at. I would suggest to write and connect an interrupt that gives you a breakpoint to set at a complete DMA-transfer.
You might make the following changes -
1) Filter sample rate, 10 Khz
2) Filter window to blackman
This will get you a little more rejection, and less power consumption.
Use DMA wizard, under tools menu, to set your dma up and get code
to copy into your setup.
Yeah,i delete the int *dst,and set the int dstto global variable area.Now no matter how i set the filter cutoff, the LCD only display two datas on it for a cycle.My ideal number of datas is 100.
what do you mean by 2 data per cycle? and what do you expect those data are?
@Mark: I guess you should tell a little bit about what you want to do. The LCD is not that fast, it might be updated 10 times per second.
I just want to digitalize the sine wave generated by WaveDAC8，and store the datas into sram.And the sampled datas number is 100.I add a CYdelay() after the LCD_PrintInt8(),so i think it will update not to fast.
What do you mean by "digitalize the sine wave".
As far as I understood you have a WaveDAC8, generating a sine wave. The output of the DAC is routed to an ADC, which in turn is connected to a DFB block. The DFB then stores the filtered result in sRAM.
But what is it that you want to display?
To digitize the sinewave, much like a DSO does, you can either do it in real time,
which means you oversample your waveform, or you can use equivalent time
sampling if you cannot sample fast enough. However this is limited to continuous
time signals, unlike real time sampling. Principles discussed in attachment.
Do you need, for any frequency input, it to always yield 100 samples for a single
cycle of the waveform ?
Note there are several example projects that show how to accompish DMA, here -
Basic Scope.pdf 275.2 K
1. I would also print out the array index to the LCD
2. What did you see from the LCD? BLANK? wrong value? some charaters but not numbers?......
The filter is vain in this project,but i should use it in the nest step,so i put it on the topdesign.If i set the cutoff higher than the frequency of sine wave,it will not work ,doen't it?now,for example,i set the WaveDAC8 to generate a 100HZ sine wave ,if i set the conversion rate of ADC to 10000HZ,i can get 100 datas about the sine wave in one cycle,dosen't it?I need to save them to SRAM ,then read them on LCD.But ,i just see two datas on LCD,that's why?