- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Every one,
I am trying to send data from SAR to Filter via DMA. But i am always getting one error (see attached picture). I don't know how to solve this error.
Kindly guide me.
Looking forward for your comments
Best Regards
Awais
Solved! Go to Solution.
- Labels:
-
PSoC 5LP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I load your project into the IDE I can get hints about definitions, compilation errors opening and closing brackets as well as parameter lists and more. Even at simple projects I can plug in a development kit and do a real debug, but that's usually not needed.
Incrementing the destination address is wrong for the filter...
Bob
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
LO16() expects a variable name as parameter, but you only give it a type name ('uint32') (which is used for a type cast). Look at the first part of the line, where it is used correctly.
(And I think, out of my memory, that you want to use HI16 there)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I have generated this code via DMA wizard. Is that ok?
Regards
Awais
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Line 79: LO16((uint32)) is rubbish. File cytypes.h is a generated file, did you change anything within?
For further investigation post your complete project, so that we all can have a look at all of your settings. To do so, use
Creator->File->Create Workspace Bundle (minimal)
and attach the resulting file.
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Change Line 79 to
CyDmaTdSetAddress(DMA_TD[0], LO16((uint32)ADC_SAR_1_SAR_WRK0_PTR), LO16((uint32)Filter_STAGEAH_PTR));
Read from filter, add 128 to the value and then send to VDAC.
You do not need #include <vdac.h>
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Moin Bob,
This is my code now. But i am still not seeing an output on oscilloscope.
CY_ISR(filterVDAC)
{
VDAC8_SetValue(Filter_Read8(Filter_CHANNEL_A) + 128u);
}
int main()
{
/* Start all components used on schematic */
ADC_SAR_1_IRQ_Start();
isr_StartEx(filterVDAC);
ADC_SAR_1_Start();
ADC_SAR_1_StartConvert();
VDAC8_Start();
Filter_Start();
/* User-implemented function to set-up DMA */
DMA_Config();
/* Enable Global Interrupts */
CYGlobalIntEnable;
for(;;)
{
}
} /* End of main */
void DMA_Config(void)
{
uint8 DMA_Chan;
uint8 DMA_TD[1];
/* DMA Configuration for DMA */
DMA_Chan = DMA_DmaInitialize(DMA_BYTES_PER_BURST, DMA_REQUEST_PER_BURST,
HI16(DMA_SRC_BASE), HI16(DMA_DST_BASE));
DMA_TD[0] = CyDmaTdAllocate();
CyDmaTdSetConfiguration(DMA_TD[0],1u , CY_DMA_DISABLE_TD, TD_INC_DST_ADR);
CyDmaTdSetAddress(DMA_TD[0], LO16((uint32)ADC_SAR_1_SAR_WRK0_PTR), LO16((uint32)Filter_STAGEAH_PTR));
CyDmaTdSetAddress(DMA_TD[0], LO16((uint32)ADC_SAR_1_SAR_WRK0_PTR),
LO16((uint32)VDAC8_Data_PTR));
CyDmaChSetInitialTd(DMA_Chan, DMA_TD[0]);
CyDmaChEnable(DMA_Chan, 1);
}
/* [] END OF FILE */
Looking forward for your reply!
Awais
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
CyDmaTdSetAddress appears twice. It is always easier to check a program using the IDE, so better attach a workspace bundle than just code-snippets
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thankyou for your reply Bob. I already skip that out but still the problem is there.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
using the IDE means through debug?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
When I load your project into the IDE I can get hints about definitions, compilation errors opening and closing brackets as well as parameter lists and more. Even at simple projects I can plug in a development kit and do a real debug, but that's usually not needed.
Incrementing the destination address is wrong for the filter...
Bob
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Moin Bob,
Thank you so much for your reply.
I want to discuss some points with you before doing further steps:
1. After my filter block, I want to implement an elliptical low pass filter (in software).
My question is : How i can tackle data coming from my filter block and after passing that data through ELPF, How i can write my final output of elliptical low pass filter (ELPF) into VDAC8 with very less delay?
Looking forward for your suggestions.
Best Regards
Awais
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Speed will be the problem, so keep an eye (or two) on that.
Change ADC sample mode to hardware signal and connect it to a timer or a clock to check out for the max. conversion rate.
Program your filter and some means to indicate duration of a cycle ie. toggle a pin, watch with a logic analyzer.
Set the build configuration from debug to release, check that compiler optimization set for speed.
Evaluate max speed, then change the timing for your filters accordingly.
Happy coding
Bob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Oh Ok,
I will work on it and will let you know.
Thankyou Bob once again.
Have a nice weekend 🙂
Regards
Awais