MODDMA GPDMA Controller New features: transfer pins to memory buffer under periodic timer control and send double buffers to DAC

Dependents:   FirstTest WaveSim IO-dma-memmem DACDMAfuncgenlib ... more

Files at this revision

API Documentation at this revision

Comitter:
AjK
Date:
Sun Mar 13 12:46:55 2011 +0000
Parent:
10:3a46c1e383a4
Child:
12:1dfee7208043
Commit message:
1.7 See changeLog.c

Changed in this revision

ChangeLog.c Show annotated file Show diff for this revision Revisions of this file
SETUP.cpp Show annotated file Show diff for this revision Revisions of this file
example2.cpp Show annotated file Show diff for this revision Revisions of this file
--- a/ChangeLog.c	Fri Mar 11 13:47:23 2011 +0000
+++ b/ChangeLog.c	Sun Mar 13 12:46:55 2011 +0000
@@ -1,11 +1,14 @@
 /* $Id:$
 
-1.6 - 10 Mar 2011
+1.7 - 13 Mar 2011
 
-    * Chaned example2.cpp to read 3 AD inputs rather than two. 
-      I did this to support this issue:-
-      http://mbed.org/forum/mbed/topic/1798/?page=1#comment-9973
+    * Remove the test at the beginning of the channel setup.
     
+1.6 - 8 Mar 2011
+      
+    * Fixed a typo bug. Reported by Wim van der Vegt
+      http://mbed.org/forum/mbed/topic/1798/?page=1#comment-9845
+      
 1.5 - 5 Feb 2011
 
     * Found a bug in the NXP library that I had copied over.
--- a/SETUP.cpp	Fri Mar 11 13:47:23 2011 +0000
+++ b/SETUP.cpp	Sun Mar 13 12:46:55 2011 +0000
@@ -29,10 +29,6 @@
 {
     LPC_GPDMACH_TypeDef *pChannel = (LPC_GPDMACH_TypeDef *)Channel_p( config->channelNum() );
     
-    if (LPC_GPDMA->DMACEnbldChns & EnbldChns_Ch( config->channelNum() )) {
-        return 0;
-    }
-    
     setups[config->channelNum() & 0x7] = config;
     
     // Reset the Interrupt status
--- a/example2.cpp	Fri Mar 11 13:47:23 2011 +0000
+++ b/example2.cpp	Sun Mar 13 12:46:55 2011 +0000
@@ -8,7 +8,7 @@
 #include "mbed.h"
 #include "MODDMA.h"
 
-#define SAMPLE_BUFFER_LENGTH 30
+#define SAMPLE_BUFFER_LENGTH 32
 
 DigitalOut led1(LED1);
 DigitalOut led2(LED2);
@@ -27,7 +27,7 @@
 int main() {
 
     // Create a buffer to hold the ADC samples and clear it.
-    // Note, we are going to sample three ADC inputs so they
+    // Note, we are going to sample two ADC inputs so they
     // end up in this buffer "interleaved". So you will want
     // a buffer twice this size to a real life given sample
     // frequency. See the printf() output for details.
@@ -40,18 +40,16 @@
     
     // Power up the ADC and set PCLK
     LPC_SC->PCONP    |=  (1UL << 12);
-    LPC_SC->PCLKSEL0 &= ~(3UL << 16); // PCLK = CCLK/4 96M/4 = 24MHz
+    LPC_SC->PCLKSEL0 &= ~(3UL << 24); // PCLK = CCLK/4 96M/4 = 24MHz
     
-    // Enable the ADC, 12MHz,  ADC0.0, .1 & .2
-    LPC_ADC->ADCR  = (1UL << 21) | (1UL << 8) | (7UL << 0); 
+    // Enable the ADC, 12MHz,  ADC0.0 & .1
+    LPC_ADC->ADCR  = (1UL << 21) | (1UL << 8) | (3UL << 0); 
     
     // Set the pin functions to ADC
-    LPC_PINCON->PINSEL1 &= ~(3UL << 14);  /* P0.23, Mbed p15 AD0.0 */
+    LPC_PINCON->PINSEL1 &= ~(3UL << 14);  /* P0.23, Mbed p15. */
     LPC_PINCON->PINSEL1 |=  (1UL << 14);
-    LPC_PINCON->PINSEL1 &= ~(3UL << 16);  /* P0.24, Mbed p16 AD0.1 */
+    LPC_PINCON->PINSEL1 &= ~(3UL << 16);  /* P0.24, Mbed p16. */
     LPC_PINCON->PINSEL1 |=  (1UL << 16);
-    LPC_PINCON->PINSEL1 &= ~(3UL << 18);  /* P0.25, Mbed p17 AD0.2 */
-    LPC_PINCON->PINSEL1 |=  (1UL << 18);
     
     // Setup the serial port to print out results.
     pc.baud(115200);
@@ -85,7 +83,7 @@
     // just set the global flag.
     LPC_ADC->ADINTEN = 0x100;
 
-    // Enable burst mode on inputs 0, 1 and 2.
+    // Enable burst mode on inputs 0 and 1.
     LPC_ADC->ADCR |= (1UL << 16); 
     
     while (1) {