- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I've been trying to make a hardware based boost converter using PSOC5 but it isn't working. I have attached a picture of my hardware configuration.
The PWM's period is 21.333us and the listed sampling rate of the ADC is 100000, giving the system about 10us of time for the system to complete the DMA and trigger the interrupt along with running a few lines of code. However using the debugger the interrupt runs either only once or not at all. I know it at least has been set up properly because it can be triggered.
I have attached the project below and am hoping someone might have insight as to why it is not repeatedly triggering.
Any help would be appreciated
Solved! Go to Solution.
- Labels:
-
PSOC5 LP MCU
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sparky,
Thanks for uploading your project.
I have replicated your results. I found the issue.
It is a 1-line code fix.
In main() your line 49:
CyDmaTdSetConfiguration(DMA_TD[0], 1, DMA_DISABLE_TD, ADC_GET_DMA__TD_TERMOUT_EN | TD_INC_DST_ADR);
The issues:
DMA_DISABLE_TD automatically terminates the DMA and disable it.
Even if the TD were not disabled, TD_INC_DST_ADR will increment the DMA destination address. You allowed ONLY one RAM location (adc_reading) and not an array. You don't want to increment the destination address.
Make the following changes to line 49:
CyDmaTdSetConfiguration(DMA_TD[0], 1, DMA_TD[0], ADC_GET_DMA__TD_TERMOUT_EN);
Making these changes have allowed the DMA_ISR to be issued immediately following the DMA operation.
One additional note:
In main.c, your line 33 has
#include "DMA_ISR.c"
The included "project.h" already includes "DMA_ISR.h"
Also you don't want to include the .c file.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Sparky,
Thanks for uploading your project.
I have replicated your results. I found the issue.
It is a 1-line code fix.
In main() your line 49:
CyDmaTdSetConfiguration(DMA_TD[0], 1, DMA_DISABLE_TD, ADC_GET_DMA__TD_TERMOUT_EN | TD_INC_DST_ADR);
The issues:
DMA_DISABLE_TD automatically terminates the DMA and disable it.
Even if the TD were not disabled, TD_INC_DST_ADR will increment the DMA destination address. You allowed ONLY one RAM location (adc_reading) and not an array. You don't want to increment the destination address.
Make the following changes to line 49:
CyDmaTdSetConfiguration(DMA_TD[0], 1, DMA_TD[0], ADC_GET_DMA__TD_TERMOUT_EN);
Making these changes have allowed the DMA_ISR to be issued immediately following the DMA operation.
One additional note:
In main.c, your line 33 has
#include "DMA_ISR.c"
The included "project.h" already includes "DMA_ISR.h"
Also you don't want to include the .c file.
"Engineering is an Art. The Art of Compromise."
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you.
After double checking the DMA documentation I did find the problem as well.