Setting DMA with ADC in F28335 (2018a/2020b)
조회 수: 4(최근 30일)
표시 이전 댓글
Francisco Jesús Matas Díaz 2020년 12월 2일
댓글: Venkatesh Chilapur 2020년 12월 15일
I am in the second round configuring DMA with ADC in F28335 with TI C2000 support package. Now I am using Matlab 2020b. I am struggling with the memory allocation definitions in Simulink.
I need DMA ch1 to transfer the data adquired by ADC to an user defined memory allocation. I have 10 channels, so I have configured it for a Burst size of (10-1). I'm using a Data store and Memory allocation blocks to access stored data as in Matlab example c28x7x_c28004x_dma_epwm
My Burst source address is the ADC register (following controlsuite examples): &AdcMirror.ADCRESULT0
My Burst destination address is a buffer ADCbuffer, so I set: &ADCbuffer
If I define ADCbuffer in Simulink environment, I mean, Model properties/Callbacks, or even in Model explorer/Model environment as a Simulink.signal, I find that the compiler gives an error in DMA configuration because ADCbuffer is not defined.
However, if I define it in a custom header in Configuration parameters/Custom code, as (taken from controlsuite/adc_dma example):
volatile Uint16 ADCbuffer;
Now I get that ADCbuffer is defined in all .obj files...
Other setups gave me catastrophic errors...
The example c28x7x_c28004x_dma_epwm sets the Burst source address as duty_cycle_table, a signal generated by executing "sineTableCalculation" comand in Model properties/Callbacks, at InitFcn as well as at PreLoadFcn.
So I would be really grateful to get some advice:
- Where should I define the DMA buffer?
- It is needed a specific variable type?
- Additional tips to take into account?
Thank you for your time.
댓글 수: 1
Venkatesh Chilapur 2020년 12월 15일
Please create a service request by contacting our support:
Find more on Texas Instruments C2000 Processors in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!Start Hunting!