Teensy3 regular sampling with ADC using interrupt

Status
Not open for further replies.

Kian

Active member
Hi all,

I am working on a project to record sound from a microphone. I need to setup the ADC (12 bit resolution) to sample at fix regular intervals, preferably at a minimum sampling rate of at least 8000 samples/sec. In addition, I need to save the samples into either external flash memory or SRAM. I was previously running into difficulties with the Arduino because i was sampling too fast and there wasn't enough time between each ADC sampling to save into external memory, hence I am migrating to Teensy3.

I am thinking of a few possibilities:

1. Acquire using analogRead() in a loop

void loop()
{
analogRead(0);
delay(xxx);
}

2. Use a timer interrupt. The ISR calls analogRead(0).

3. I used this previously for the Arduino. Setting up the ADC in free running mode in which the ADC will automatically start the next conversion as soon as the previous one is completed. But I don't know if this can be done on the Teensy.

Anyone can give some suggestions and advise on what is the best way to do this? Thanks in advance!!
 
I also have code to use the DMA to do this here:

http://hg.cmason.com/teensy3/src/90cffffb1abe3da67810725a14924ef19349a405/teensy/main_sampler.cpp
http://hg.cmason.com/teensy3/src/90cffffb1abe3da67810725a14924ef19349a405/teensy/sampler.h

It stores the samples in a ring buffer and then you can process them from your main thread. If there's interest I can clean this up into a library. As it stands there's a bunch of comments in the sampler.h header file that explain what's going on. This is probably most useful for multiple-channel ADC.

-c
 
That is very cool!

So, the ADC ring buffer can fill up, and then when it's full you can have the processor do something with it, like send to an SD card?

I think it would be a very cool library.
 
I tried using this but got lots of "there are no arguments to" and "was not declared" errors. I did not get any "No such file" errors involving the dependent libraries, though.

What am I missing?
Thanks.

Code:
  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.0"
In file included from dma_analogread_test.ino:1:0:
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::configureAdc()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:200:9: error: 'ADC0_CFG1' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:201:34: error: there are no arguments to 'ADC_CFG1_ADICLK' that depend on a template parameter, so a declaration of 'ADC_CFG1_ADICLK' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:201:34: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:203:34: error: there are no arguments to 'ADC_CFG1_ADIV' that depend on a template parameter, so a declaration of 'ADC_CFG1_ADIV' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:204:34: error: there are no arguments to 'ADC_CFG1_MODE' that depend on a template parameter, so a declaration of 'ADC_CFG1_MODE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:206:9: error: 'ADC0_CFG2' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:206:21: error: 'ADC_CFG2_MUXSEL' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:206:39: error: 'ADC_CFG2_ADACKEN' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:206:58: error: 'ADC_CFG2_ADHSC' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:207:9: error: 'ADC0_SC2' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:207:36: error: there are no arguments to 'ADC_SC2_REFSEL' that depend on a template parameter, so a declaration of 'ADC_SC2_REFSEL' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:208:19: error: 'ADC_SC2_DMAEN' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:209:9: error: 'ADC0_SC3' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::setupDMA()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:233:9: error: 'SIM_SCGC6' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:233:22: error: 'SIM_SCGC6_DMAMUX' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:234:9: error: 'SIM_SCGC7' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:234:22: error: 'SIM_SCGC7_DMA' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:237:19: error: there are no arguments to 'delay' that depend on a template parameter, so a declaration of 'delay' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:240:9: error: 'DMA_CERQ' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:243:9: error: 'DMA_CR' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:243:19: error: 'DMA_CR_ERCA' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:247:37: error: there are no arguments to 'DMA_TCDN_SADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_SADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:247:53: error: 'ADC0_RA' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:248:36: error: there are no arguments to 'DMA_TCDN_SOFF' that depend on a template parameter, so a declaration of 'DMA_TCDN_SOFF' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:249:36: error: there are no arguments to 'DMA_TCDN_ATTR' that depend on a template parameter, so a declaration of 'DMA_TCDN_ATTR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:250:41: error: there are no arguments to 'DMA_TCD_ATTR_SSIZE' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_SSIZE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:251:46: error: there are no arguments to 'DMA_TCD_ATTR_SMOD' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_SMOD' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:252:51: error: there are no arguments to 'DMA_TCD_ATTR_DSIZE' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_DSIZE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:254:38: error: there are no arguments to 'DMA_TCDN_NBYTES' that depend on a template parameter, so a declaration of 'DMA_TCDN_NBYTES' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:255:37: error: there are no arguments to 'DMA_TCDN_SLAST' that depend on a template parameter, so a declaration of 'DMA_TCDN_SLAST' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:256:37: error: there are no arguments to 'DMA_TCDN_DADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_DADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:257:36: error: there are no arguments to 'DMA_TCDN_DOFF' that depend on a template parameter, so a declaration of 'DMA_TCDN_DOFF' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:258:35: error: there are no arguments to 'DMA_TCDN_CSR' that depend on a template parameter, so a declaration of 'DMA_TCDN_CSR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:258:39: error: 'DMA_TCD_CSR_INTMAJOR' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:259:37: error: there are no arguments to 'DMA_TCDN_CITER' that depend on a template parameter, so a declaration of 'DMA_TCDN_CITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:259:69: error: there are no arguments to 'DMA_TCDN_BITER' that depend on a template parameter, so a declaration of 'DMA_TCDN_BITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:260:27: error: 'DMA_TCD_BITER_ELINK' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:261:61: error: there are no arguments to 'DMA_TCD_BITER_LINKCH' that depend on a template parameter, so a declaration of 'DMA_TCD_BITER_LINKCH' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:262:61: error: there are no arguments to 'DMA_TCD_BITER' that depend on a template parameter, so a declaration of 'DMA_TCD_BITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:263:40: error: there are no arguments to 'DMA_TCDN_DLASTSGA' that depend on a template parameter, so a declaration of 'DMA_TCDN_DLASTSGA' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:268:9: error: 'DMA_SEEI' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:273:37: error: there are no arguments to 'DMA_TCDN_SADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_SADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:274:38: error: there are no arguments to 'DMA_TCDN_NBYTES' that depend on a template parameter, so a declaration of 'DMA_TCDN_NBYTES' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:275:36: error: there are no arguments to 'DMA_TCDN_SOFF' that depend on a template parameter, so a declaration of 'DMA_TCDN_SOFF' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:276:37: error: there are no arguments to 'DMA_TCDN_SLAST' that depend on a template parameter, so a declaration of 'DMA_TCDN_SLAST' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:277:36: error: there are no arguments to 'DMA_TCDN_ATTR' that depend on a template parameter, so a declaration of 'DMA_TCDN_ATTR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:278:41: error: there are no arguments to 'DMA_TCD_ATTR_SSIZE' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_SSIZE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:280:51: error: there are no arguments to 'DMA_TCD_ATTR_DSIZE' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_DSIZE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:281:46: error: there are no arguments to 'DMA_TCD_ATTR_DMOD' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_DMOD' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:282:37: error: there are no arguments to 'DMA_TCDN_DADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_DADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:282:52: error: 'ADC0_SC1A' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:283:36: error: there are no arguments to 'DMA_TCDN_DOFF' that depend on a template parameter, so a declaration of 'DMA_TCDN_DOFF' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:284:40: error: there are no arguments to 'DMA_TCDN_DLASTSGA' that depend on a template parameter, so a declaration of 'DMA_TCDN_DLASTSGA' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:285:37: error: there are no arguments to 'DMA_TCDN_CITER' that depend on a template parameter, so a declaration of 'DMA_TCDN_CITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:285:69: error: there are no arguments to 'DMA_TCDN_BITER' that depend on a template parameter, so a declaration of 'DMA_TCDN_BITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:295:37: error: there are no arguments to 'DMAMUX0_CHCFGN' that depend on a template parameter, so a declaration of 'DMAMUX0_CHCFGN' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:296:37: error: there are no arguments to 'DMAMUX0_CHCFGN' that depend on a template parameter, so a declaration of 'DMAMUX0_CHCFGN' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:296:41: error: 'DMAMUX0_CHCFG_ENBL' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:296:62: error: 'DMAMUX0_SOURCE_ADC0' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::calibrate()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:305:9: error: 'ADC0_SC3' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:305:21: error: 'ADC_SC3_CAL' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:24: error: 'ADC0_CLPS' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:36: error: 'ADC0_CLP4' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:48: error: 'ADC0_CLP3' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:60: error: 'ADC0_CLP2' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:72: error: 'ADC0_CLP1' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:84: error: 'ADC0_CLP0' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:313:9: error: 'ADC0_PG' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:25: error: 'ADC0_CLMS' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:37: error: 'ADC0_CLM4' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:49: error: 'ADC0_CLM3' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:61: error: 'ADC0_CLM2' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:73: error: 'ADC0_CLM1' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:85: error: 'ADC0_CLM0' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:316:9: error: 'ADC0_MG' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::start()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:338:37: error: there are no arguments to 'DMA_TCDN_DADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_DADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:339:37: error: there are no arguments to 'DMA_TCDN_SADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_SADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:342:9: error: 'DMA_SERQ' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:352:40: error: there are no arguments to 'micros' that depend on a template parameter, so a declaration of 'micros' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:353:37: error: 'ARM_DWT_CYCCNT' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:354:9: error: 'ADC0_SC1A' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::stop()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:359:9: error: 'DMA_CERQ' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::interrupt()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:366:22: error: 'ARM_DWT_CYCCNT' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:367:27: error: there are no arguments to 'micros' that depend on a template parameter, so a declaration of 'micros' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'bool sampler<max_listener_count>::checkError()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:408:26: error: 'HIGH' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:408:30: error: there are no arguments to 'digitalWrite' that depend on a template parameter, so a declaration of 'digitalWrite' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:409:14: error: 'DMA_ERR' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:409:86: error: 'DMA_ES' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:410:30: error: 'DMA_ES_ERRCHN' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:418:26: error: 'DMA_ES_CPE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:421:26: error: 'DMA_ES_SEA' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:424:26: error: 'DMA_ES_SOE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:427:26: error: 'DMA_ES_DAE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:430:26: error: 'DMA_ES_DOE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:433:26: error: 'DMA_ES_NCE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:436:26: error: 'DMA_ES_SGE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:439:26: error: 'DMA_ES_SBE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:442:26: error: 'DMA_ES_DBE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:445:26: error: 'DMA_ES_EXC' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:451:13: error: 'DMA_CERR' was not declared in this scope
 
Last edited:
I tried using this but got lots of "there are no arguments to" and "was not declared" errors. I did not get any "No such file" errors involving the dependent libraries, though.

What am I missing?
Thanks.

Code:
  This report would have more information with
  "Show verbose output during compilation"
  enabled in File > Preferences.
Arduino: 1.0.5 (Mac OS X), Board: "Teensy 3.0"
In file included from dma_analogread_test.ino:1:0:
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::configureAdc()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:200:9: error: 'ADC0_CFG1' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:201:34: error: there are no arguments to 'ADC_CFG1_ADICLK' that depend on a template parameter, so a declaration of 'ADC_CFG1_ADICLK' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:201:34: note: (if you use '-fpermissive', G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:203:34: error: there are no arguments to 'ADC_CFG1_ADIV' that depend on a template parameter, so a declaration of 'ADC_CFG1_ADIV' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:204:34: error: there are no arguments to 'ADC_CFG1_MODE' that depend on a template parameter, so a declaration of 'ADC_CFG1_MODE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:206:9: error: 'ADC0_CFG2' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:206:21: error: 'ADC_CFG2_MUXSEL' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:206:39: error: 'ADC_CFG2_ADACKEN' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:206:58: error: 'ADC_CFG2_ADHSC' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:207:9: error: 'ADC0_SC2' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:207:36: error: there are no arguments to 'ADC_SC2_REFSEL' that depend on a template parameter, so a declaration of 'ADC_SC2_REFSEL' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:208:19: error: 'ADC_SC2_DMAEN' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:209:9: error: 'ADC0_SC3' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::setupDMA()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:233:9: error: 'SIM_SCGC6' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:233:22: error: 'SIM_SCGC6_DMAMUX' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:234:9: error: 'SIM_SCGC7' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:234:22: error: 'SIM_SCGC7_DMA' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:237:19: error: there are no arguments to 'delay' that depend on a template parameter, so a declaration of 'delay' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:240:9: error: 'DMA_CERQ' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:243:9: error: 'DMA_CR' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:243:19: error: 'DMA_CR_ERCA' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:247:37: error: there are no arguments to 'DMA_TCDN_SADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_SADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:247:53: error: 'ADC0_RA' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:248:36: error: there are no arguments to 'DMA_TCDN_SOFF' that depend on a template parameter, so a declaration of 'DMA_TCDN_SOFF' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:249:36: error: there are no arguments to 'DMA_TCDN_ATTR' that depend on a template parameter, so a declaration of 'DMA_TCDN_ATTR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:250:41: error: there are no arguments to 'DMA_TCD_ATTR_SSIZE' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_SSIZE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:251:46: error: there are no arguments to 'DMA_TCD_ATTR_SMOD' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_SMOD' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:252:51: error: there are no arguments to 'DMA_TCD_ATTR_DSIZE' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_DSIZE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:254:38: error: there are no arguments to 'DMA_TCDN_NBYTES' that depend on a template parameter, so a declaration of 'DMA_TCDN_NBYTES' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:255:37: error: there are no arguments to 'DMA_TCDN_SLAST' that depend on a template parameter, so a declaration of 'DMA_TCDN_SLAST' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:256:37: error: there are no arguments to 'DMA_TCDN_DADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_DADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:257:36: error: there are no arguments to 'DMA_TCDN_DOFF' that depend on a template parameter, so a declaration of 'DMA_TCDN_DOFF' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:258:35: error: there are no arguments to 'DMA_TCDN_CSR' that depend on a template parameter, so a declaration of 'DMA_TCDN_CSR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:258:39: error: 'DMA_TCD_CSR_INTMAJOR' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:259:37: error: there are no arguments to 'DMA_TCDN_CITER' that depend on a template parameter, so a declaration of 'DMA_TCDN_CITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:259:69: error: there are no arguments to 'DMA_TCDN_BITER' that depend on a template parameter, so a declaration of 'DMA_TCDN_BITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:260:27: error: 'DMA_TCD_BITER_ELINK' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:261:61: error: there are no arguments to 'DMA_TCD_BITER_LINKCH' that depend on a template parameter, so a declaration of 'DMA_TCD_BITER_LINKCH' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:262:61: error: there are no arguments to 'DMA_TCD_BITER' that depend on a template parameter, so a declaration of 'DMA_TCD_BITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:263:40: error: there are no arguments to 'DMA_TCDN_DLASTSGA' that depend on a template parameter, so a declaration of 'DMA_TCDN_DLASTSGA' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:268:9: error: 'DMA_SEEI' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:273:37: error: there are no arguments to 'DMA_TCDN_SADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_SADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:274:38: error: there are no arguments to 'DMA_TCDN_NBYTES' that depend on a template parameter, so a declaration of 'DMA_TCDN_NBYTES' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:275:36: error: there are no arguments to 'DMA_TCDN_SOFF' that depend on a template parameter, so a declaration of 'DMA_TCDN_SOFF' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:276:37: error: there are no arguments to 'DMA_TCDN_SLAST' that depend on a template parameter, so a declaration of 'DMA_TCDN_SLAST' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:277:36: error: there are no arguments to 'DMA_TCDN_ATTR' that depend on a template parameter, so a declaration of 'DMA_TCDN_ATTR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:278:41: error: there are no arguments to 'DMA_TCD_ATTR_SSIZE' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_SSIZE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:280:51: error: there are no arguments to 'DMA_TCD_ATTR_DSIZE' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_DSIZE' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:281:46: error: there are no arguments to 'DMA_TCD_ATTR_DMOD' that depend on a template parameter, so a declaration of 'DMA_TCD_ATTR_DMOD' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:282:37: error: there are no arguments to 'DMA_TCDN_DADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_DADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:282:52: error: 'ADC0_SC1A' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:283:36: error: there are no arguments to 'DMA_TCDN_DOFF' that depend on a template parameter, so a declaration of 'DMA_TCDN_DOFF' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:284:40: error: there are no arguments to 'DMA_TCDN_DLASTSGA' that depend on a template parameter, so a declaration of 'DMA_TCDN_DLASTSGA' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:285:37: error: there are no arguments to 'DMA_TCDN_CITER' that depend on a template parameter, so a declaration of 'DMA_TCDN_CITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:285:69: error: there are no arguments to 'DMA_TCDN_BITER' that depend on a template parameter, so a declaration of 'DMA_TCDN_BITER' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:295:37: error: there are no arguments to 'DMAMUX0_CHCFGN' that depend on a template parameter, so a declaration of 'DMAMUX0_CHCFGN' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:296:37: error: there are no arguments to 'DMAMUX0_CHCFGN' that depend on a template parameter, so a declaration of 'DMAMUX0_CHCFGN' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:296:41: error: 'DMAMUX0_CHCFG_ENBL' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:296:62: error: 'DMAMUX0_SOURCE_ADC0' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::calibrate()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:305:9: error: 'ADC0_SC3' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:305:21: error: 'ADC_SC3_CAL' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:24: error: 'ADC0_CLPS' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:36: error: 'ADC0_CLP4' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:48: error: 'ADC0_CLP3' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:60: error: 'ADC0_CLP2' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:72: error: 'ADC0_CLP1' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:311:84: error: 'ADC0_CLP0' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:313:9: error: 'ADC0_PG' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:25: error: 'ADC0_CLMS' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:37: error: 'ADC0_CLM4' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:49: error: 'ADC0_CLM3' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:61: error: 'ADC0_CLM2' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:73: error: 'ADC0_CLM1' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:314:85: error: 'ADC0_CLM0' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:316:9: error: 'ADC0_MG' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::start()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:338:37: error: there are no arguments to 'DMA_TCDN_DADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_DADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:339:37: error: there are no arguments to 'DMA_TCDN_SADDR' that depend on a template parameter, so a declaration of 'DMA_TCDN_SADDR' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:342:9: error: 'DMA_SERQ' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:352:40: error: there are no arguments to 'micros' that depend on a template parameter, so a declaration of 'micros' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:353:37: error: 'ARM_DWT_CYCCNT' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:354:9: error: 'ADC0_SC1A' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::stop()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:359:9: error: 'DMA_CERQ' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'void sampler<max_listener_count>::interrupt()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:366:22: error: 'ARM_DWT_CYCCNT' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:367:27: error: there are no arguments to 'micros' that depend on a template parameter, so a declaration of 'micros' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h: In member function 'bool sampler<max_listener_count>::checkError()':
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:408:26: error: 'HIGH' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:408:30: error: there are no arguments to 'digitalWrite' that depend on a template parameter, so a declaration of 'digitalWrite' must be available [-fpermissive]
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:409:14: error: 'DMA_ERR' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:409:86: error: 'DMA_ES' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:410:30: error: 'DMA_ES_ERRCHN' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:418:26: error: 'DMA_ES_CPE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:421:26: error: 'DMA_ES_SEA' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:424:26: error: 'DMA_ES_SOE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:427:26: error: 'DMA_ES_DAE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:430:26: error: 'DMA_ES_DOE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:433:26: error: 'DMA_ES_NCE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:436:26: error: 'DMA_ES_SGE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:439:26: error: 'DMA_ES_SBE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:442:26: error: 'DMA_ES_DBE' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:445:26: error: 'DMA_ES_EXC' was not declared in this scope
/Users/drbleep/Documents/Arduino/libraries/dma_sampler/sampler.h:451:13: error: 'DMA_CERR' was not declared in this scope

use sample.h as guide only, you can try also with centinela.ino, I am currently working on improving it, regards!

PD1: There exist a lot of cmason MACROS different from the original, I hope I do not have some too
PD2: see it working: http://flipflop.pepeline.org/teensy30/centinela
 
Status
Not open for further replies.
Back
Top