完善资料让更多小伙伴认识你,还能领取20积分哦, 立即完善>
大家好,这是关于DMA的非常基本的问题。1)什么是DMA(直接内存访问)和什么时候使用?2)它是如何提高CPU性能的?或如何独立工作,以节省时间和更快的性能和减少延迟?3)什么是间接的和平的模式?4)在Demo代码和DSPIC33 EP FRM ADC和DMA中,DMA与定时器3(125US)方式工作。定时器如何与ADC和DMA相关?5)使用中断或DMA的ADC最快的方法是什么?6)DSPIC33 EP具有ADC模块。我可以使用ADC 1对5个频道进行轮询,ADC 2用DMA进行2个频道吗?ThankyOuts9
以上来自于百度翻译 以下为原文 Hello All, It's quite is very basic questions about DMA. 1) What is DMA (Direct Memory Access) and When to use? 2) How it increases CPU performance? or How it works with Independently to save the time and faster performance and decrease latency ? 3) What is basically indirect and ping mode? 4) In demo code and Dspic33ep FRM ADC and DMA, DMA works with Timer 3 (125us) Means. How timers related with ADC and DMA? 5) What will be fastest method to use ADC with Interrupts or with DMA? 6) Dspic33ep has to ADC Modules. Can I use ADC 1 on Polling for 5 channels and ADC 2 with DMA for for 2 Channels? Thankyou TS9 |
|
相关推荐
15个回答
|
|
理论上,DMA应该用来自ADC的样本填充缓冲器而不需要CPU的任何干预:当缓冲区满了(比如:1KWord)时,你会有一些标志提升,然后你就可以处理这些数据…同时,ADC/DMA-QIL将为您填充另一个缓冲区。基本上,减少50%的时间。通常需要一些缓冲的乒乓方法,计时器可以用来在给定的间隔触发ADC(和DMA)。我想说这一切都取决于你使用的图片:我正试图在DSPIC33 E上做一些类似的事情…
以上来自于百度翻译 以下为原文 In theory, DMA should fill a buffer with samples coming from the ADC without any intervention by the CPU: when the buffer is full (say: 1Kwords) you have some flag raisen and then you can process that data... and meanwhile the ADC/DMA qill be filling another buffer for you. Basically, cutting 50% of the time. Some buffers ping-pong method is usually needed. The timer could be used to trigger ADC (and hence DMA) at given intervals. I'd say it all may depend upon the PIC you use: I am trying to make up something similar on a dsPIC33E ... |
|
|
|
5)使用中断或DMA的ADC最快的方法是什么?6)DSPIC33 EP512MU810具有两个ADC模块。我可以使用ADC 1在5个信道和ADC 2上进行轮询,用于2个信道吗?
以上来自于百度翻译 以下为原文 5) What will be fastest method to use ADC with Interrupts or with DMA? 6) Dspic33ep512MU810 has two ADC Modules. Can I use ADC 1 on Polling for 5 channels and ADC 2 with DMA for for 2 Channels? |
|
|
|
嗨,我已经看到例子16-8:ADC配置代码从DSSPIC33 EP FRMDS70621C。现在我正在阅读所有12个通道的顺序读取轮询ADDF位,但我的要求如下:RB0<AN0>Low Speed Sample /转换所需[与轮询过程] RB1<AN1>与DMA[SPE高]ED样本/转换要求[RB2<AN2≫Low Speed Sample /转换] [轮询过程] RB3<AN3≫Low Speed Sample /转换所需[轮询过程] RB4<AN4>Low Speed Sample /转换所需[轮询过程] RB5<AN5>Low Speed Sample /转换要求D[用轮询过程] RB6& lt;AN6& GT;DMA [高速采样/转换要求] RB7& lt;AN7>Low Speed Sample /转换所需[轮询过程] RB8<AN8>Low Speed Sample /转换所需[轮询过程] RB9<AN9&GT /转换所需[与轮询]过程[RB10&L];AN10>Low Speed Sample /转换所需的[轮询过程] RB11 & lt;AN11≫Low Speed Sample /转换所需的[轮询过程] WHEDMA0DISTICTY发生在ADC结果将被CPU保存的情况下?如何在主函数或其他函数中使用该值?——TS9
以上来自于百度翻译 以下为原文 Hi, I have seen Example 16-8: ADC Configuration Code for 1.1 Msps from dsPIC33EP FRM DS70621C. Now I am reading all 12 channel by sequential read polling ADIF bit but my requirement in as Below: RB0 RB1 RB2 RB3 RB4 RB5 RB6 RB7 RB8 RB9 RB10 RB11 dsPIC33E/PIC24E Family Reference Manual Page DS70621C-page 16-58 #include /** CONFIGURATION **************************************************/ _FOSCSEL(FNOSC_FRC); _FOSC(FCKSM_CSECMD & POSCMD_XT & OSCIOFNC_OFF & IOL1WAY_OFF); _FWDT(FWDTEN_OFF); _FPOR(FPWRT_PWR128 & BOREN_ON & ALTI2C1_ON & ALTI2C2_ON); _FICD(ICS_PGD1 & RSTPRI_PF & JTAGEN_OFF); void initAdc1(void); void initDma0(void); void Delay_us(unsigned int); int BufferA[8] = {0, 0, 0, 0, 0, 0, 0, 0}; int BufferB[8] = {0, 0, 0, 0, 0, 0, 0, 0}; int i; int main(void) { // Configure the device PLL to obtain 40 MIPS operation. The crystal frequency is 8 MHz. // Divide 8 MHz by 2, multiply by 40 and divide by 2. This results in Fosc of 80 MHz. // The CPU clock frequency is Fcy = Fosc/2 = 40 MHz. PLLFBD = 38; /* M = 40 */ CLKDIVbits.PLLPOST = 0; /* N1 = 2 */ CLKDIVbits.PLLPRE = 0; /* N2 = 2 */ OSCTUN = 0; /* Initiate Clock Switch to Primary Oscillator with PLL (NOSC = 0x3) */ __builtin_write_OSCCONH(0x03); __builtin_write_OSCCONL(0x01); while (OSCCONbits.COSC != 0x3); while (_LOCK == 0); /* Wait for PLL lock at 40 MIPS */ initAdc1(); initDma0(); while(1); /* Wait for DMA interrupts to occur */ } void initAdc1(void) { /* Set port configuration */ ANSELA = ANSELC = ANSELD = ANSELE = ANSELG = 0x0000; ANSELB = 0x0001; // Ensure AN0 is analog /* Initialize ADC module */ AD1CON1 = 0x13E4; // DMA Conversion Order, sequential sampling, 10-bit, Signed Fractional AD1CON2 = 0x0100; // Select 2-channel mode, increment DMA pointer after every sample AD1CON3bits.ADRC = 0;// ADC Clock is derived from System Clock AD1CON3bits.SAMC = 2; // Sample for 2 * Tad before converting AD1CON3bits.ADCS = 2; // TAD= TCY* (ADCS + 1) = (1 / 40MHz) * 3 = 75 ns (13.3 MHz) // ADC conversion time for 10-bit Tconv = 12 * Tad = 900 ns (1.1 Msps) AD1CON4 = 0x0100; // Use DMA to store conversion results AD1CSSH = 0x0000; AD1CSSL = 0x0000; /* Assign MUXA inputs */ AD1CHS0bits.CH0SA = 0; // Select AN0 for CH0 +ve input AD1CHS0bits.CH0NA = 0; // Select VREF- for CH0 -ve input AD1CHS123bits.CH123SA = 0; // Select AN0 for CH1 +ve input AD1CHS123bits.CH123NA = 0; // Select VREF- for CH1 -ve input /* Enable ADC module and provide ADC stabilization delay */ AD1CON1bits.ADON = 1; Delay_us(20); } void __attribute__((interrupt, auto_psv)) _DMA0Interrupt(void) { _DMA0IF = 0; /* Clear DMA interrupt flag to prepare for next block */ } void Delay_us(unsigned int delay) { for (i = 0; i < delay; i++) { __asm__ volatile ("repeat #39"); __asm__ volatile ("nop"); } } When DMA0Interrupt is occurred where ADC result will save by CPU ? How to use that value in main or any other function ? -- TS9 |
|
|
|
|
|
|
|
感谢不写在DSPIC33 EP FRMDS70621Cand从CE420AADCCHCHSCAN MHCP演示
以上来自于百度翻译 以下为原文 Thanks Not Written in dsPIC33EP FRM DS70621C and taken from ce420_adc_chscan MHCP Demos void InitDma0( void ) { DMA0CONbits.AMODE = 2; // Configure DMA for Peripheral indirect mode DMA0CONbits.MODE = 2; // Configure DMA for Continuous Ping-Pong mode DMA0PAD = ( int ) &ADC1BUF0; DMA0CNT = ( SAMP_BUFF_SIZE * NUM_CHS2SCAN ) - 1; DMA0REQ = 13; // Select ADC1 as DMA Request source #ifdef _HAS_DMA_ DMA0STAL = __builtin_dmaoffset( &bufferA ); DMA0STAH = __builtin_dmapage( &bufferA ); DMA0STBL = __builtin_dmaoffset( &bufferB ); DMA0STBH = __builtin_dmapage( &bufferB ); #else DMA0STAL = ( uint16_t ) ( &bufferA ); DMA0STAH = ( uint16_t ) ( &bufferA ); DMA0STBL = ( uint16_t ) ( &bufferB ); DMA0STBH = ( uint16_t ) ( &bufferB ); #endif IFS0bits.DMA0IF = 0; //Clear the DMA interrupt flag bit IEC0bits.DMA0IE = 1; //Set the DMA interrupt enable bit DMA0CONbits.CHEN = 1; // Enable DMA } |
|
|
|
好!有道理,所以你应该找到你的数据
以上来自于百度翻译 以下为原文 Good! Makes sense So you should find your data in bufferA and bufferB (the ping-pong method) |
|
|
|
|
|
|
|
一个频道?具体渠道如何?多一个渠道?
以上来自于百度翻译 以下为原文 For One Channel ? How to particular channel ? more then one channel ? |
|
|
|
MHCP DEMOS AT1)CE401- ADC采样在1.1MSPs与DMA(无定时器)2)CE420-ADC信道扫描与DMA(定时器)与计时器我理解?没有定时器,阅读间隔可以得到什么?
以上来自于百度翻译 以下为原文 MHCP Demos at 1) CE401 - ADC Sampling at 1.1MSPS with DMA(without Timers) 2) CE420 - ADC Channel Scanning with DMA(with Timers) With Timer I understand ? Without Timer, After what interval reading can get ? |
|
|
|
DMA缓冲器被分配给特定的ADC。如果这个ADC ISS分配了一些顺序采样,那么你会在同一个DMA缓冲器(块)中找到这些通道的值——一个接一个。一个计时器可以用来触发单独的转换-以达到低于最大转换率的一些采样率。或者将ADC转换与来自相同定时器(例如PWM)的其他活动同步。
以上来自于百度翻译 以下为原文 The DMA buffers are assigned to a specific ADC. If this ADC iss assigned some sequential sampling, you'll find the values of these channels in the same DMA buffer (block) - one after the other. A timer can be used to trigger individual conversions - to achieve some sampling rate lower than the maximum conversion rate. Or to synchronize ADC conversions with other activities derived from the same timer (e.g. PWM). |
|
|
|
好的,谢谢。四个通道和十二个通道的总CPU时间与DMA相同。如何用DMA来计算?与Fosc @ 120兆赫。——TS9
以上来自于百度翻译 以下为原文 Ok Thanks.. The Total CPU time of reading for four channels and twelve channels will be same with DMA.? How to calculate that with DMA? With Fosc @120Mhz. -- TS9 |
|
|
|
“阅读时间”被理解为“ADC转换时机”?如果是的话,也许你还没有得到“DMA点”:DMA传输正在发生,否则会发生中断-需要MCU交互。简单地从一些数据传输卸载MCU。
以上来自于百度翻译 以下为原文 "time of reading" to be understood as "ADC conversion timing"? If so: yes. Maybe you didn't yet get the "DMA point": a DMA transfer is taking place where otherwise an interrupt would occur - requiring MCU interaction. Simply offloading the MCU from some data transfers. |
|
|
|
我认为我应该更快地需要与DMA和轮询休息(ADC模块2)对话2个通道(ADC模块1)?
以上来自于百度翻译 以下为原文 I think I should go faster need conversation 2 channels( with ADC Module 1) with DMA and rest of Polling (ADC Module 2) ? |
|
|
|
DSPIC33 EP 10位ADC。自动采样和自动转换选项在不检查ADIF位的情况下工作吗?内循环
以上来自于百度翻译 以下为原文 Dspic33ep 10-bit ADC. Will auto sampling and auto conversion options worked without checking ADIF bit continuously ? In while Loop |
|
|
|
由于每个ANX都有一个结果寄存器,所以我希望如此。考虑到这些ADC的复杂性,我建议咨询ADS的数据表7000 05213。
以上来自于百度翻译 以下为原文 As there exists a result register for each ANx, I expect so. Given the complexity of these ADCs, I suggest to consult DS70005213 - the ADCs' datasheet. |
|
|
|
只有小组成员才能发言,加入小组>>
5160 浏览 9 评论
1998 浏览 8 评论
1927 浏览 10 评论
请问是否能把一个ADC值转换成两个字节用来设置PWM占空比?
3170 浏览 3 评论
请问电源和晶体值之间有什么关系吗?PIC在正常条件下运行4MHz需要多少电压?
2225 浏览 5 评论
727浏览 1评论
612浏览 1评论
有偿咨询,关于MPLAB X IPE烧录PIC32MX所遇到的问题
501浏览 1评论
PIC Kit3出现目标设备ID(00000000)与预期的设备ID(02c20000)不匹配。是什么原因
626浏览 0评论
524浏览 0评论
小黑屋| 手机版| Archiver| 电子发烧友 ( 湘ICP备2023018690号 )
GMT+8, 2024-11-22 08:31 , Processed in 1.562585 second(s), Total 107, Slave 90 queries .
Powered by 电子发烧友网
© 2015 bbs.elecfans.com
关注我们的微信
下载发烧友APP
电子发烧友观察
版权所有 © 湖南华秋数字科技有限公司
电子发烧友 (电路图) 湘公网安备 43011202000918 号 电信与信息服务业务经营许可证:合字B2-20210191 工商网监 湘ICP备2023018690号