OK, thanks Kurt.
At a minimum, this code does need the audio board to be installed to test whether the code will start properly or not.
In order to play with it you also need a microphone.
Pete
Sketch uses 617,716 bytes (58%) of program storage space. Maximum is 1,048,576 bytes.
Global variables use 51,024 bytes (19%) of dynamic memory, leaving 211,120 bytes for local variables. Maximum is 262,144 bytes.
C:\tCode\T3_K66\AUDIO\vocoder_16rec_9fx_SF_6_rectify\vocoder_16rec_9fx_SF_6_rectify.ino
F_CPU = 180 MHz
Found 11 loops
Loop = CARRIER22
setup done
CASCADE_2
bp_base = 100.0, bp_width = 400.0
mixer18_gain = 4.0, mixera_gain = 3.0
Using MICROPHONE input
Proc = 55.72 (55.72), Mem = 25 (29)
Proc = 55.09 (55.78), Mem = 25 (29)
C:\tCode\T3_K66\AUDIO\vocoder_16rec_9fx_SF_6_rectify\vocoder_16rec_9fx_SF_6_rectify.ino
F_CPU = 240 MHz
Found 11 loops
Loop = CARRIER22
setup done
CASCADE_2
bp_base = 100.0, bp_width = 400.0
mixer18_gain = 4.0, mixera_gain = 3.0
Using MICROPHONE input
Proc = 41.78 (41.78), Mem = 25 (29)
... is my assumption correct that only the first DAC is currently supported?
#if defined(__MKL26Z64__)
analogWrite(A12, nextPwm);
#elif defined(__MK20DX128__) || defined(__MK20DX256__)
analogWrite(A14, nextPwm);
#elif defined(__MK64FX512__) || defined(__MK66FX1M0__)
analogWrite(A21, nextPwm);
#else
#error "Unknown Teensy"
#endif
bummer on the head thing - Not sure if this is responsive? :: the only DAC use I tried was for TALKIE.cpp when FrankB expertly adjusted as below and I tested A22 to work just as well in that case as A21.
Here is what I got. Note, I plugged in the 3.6, 3.2, and 3.0 at different times, so the device number will be different. On the 3.6, this is using the standard USB, not the secondary USB that can be added via the internal pins.Wondering now about what lsusb on linux will show.
Bus 001 Device 043: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.01
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x16c0 Van Ooijen Technische Informatica
idProduct 0x0483 Teensyduino Serial
bcdDevice 2.00
iManufacturer 1 Teensyduino
iProduct 2 USB Serial
iSerial 3 0
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 0
CDC Header:
bcdCDC 1.10
CDC Call Management:
bmCapabilities 0x01
call management
bDataInterface 1
CDC ACM:
bmCapabilities 0x06
sends break
line coding and serial state
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 64
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
Bus 001 Device 041: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.01
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x16c0 Van Ooijen Technische Informatica
idProduct 0x0483 Teensyduino Serial
bcdDevice 2.00
iManufacturer 1 Teensyduino
iProduct 2 USB Serial
iSerial 3 1937660
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 0
CDC Header:
bcdCDC 1.10
CDC Call Management:
bmCapabilities 0x01
call management
bDataInterface 1
CDC ACM:
bmCapabilities 0x06
sends break
line coding and serial state
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 64
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
Bus 001 Device 047: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 1.01
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x16c0 Van Ooijen Technische Informatica
idProduct 0x0483 Teensyduino Serial
bcdDevice 2.00
iManufacturer 1 Teensyduino
iProduct 2 USB Serial
iSerial 3 28780
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 0
CDC Header:
bcdCDC 1.10
CDC Call Management:
bmCapabilities 0x01
call management
bDataInterface 1
CDC ACM:
bmCapabilities 0x06
sends break
line coding and serial state
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 64
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
Bus 001 Device 044: ID 16c0:0483 Van Ooijen Technische Informatica Teensyduino Serial
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 2 Communications
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
idVendor 0x16c0 Van Ooijen Technische Informatica
idProduct 0x0483 Teensyduino Serial
bcdDevice 1.00
iManufacturer 1 Teensyduino
iProduct 2 USB Serial
iSerial 3 1122030
bNumConfigurations 1
Configuration Descriptor:
bLength 9
bDescriptorType 2
wTotalLength 67
bNumInterfaces 2
bConfigurationValue 1
iConfiguration 0
bmAttributes 0xc0
Self Powered
MaxPower 100mA
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 0
bAlternateSetting 0
bNumEndpoints 1
bInterfaceClass 2 Communications
bInterfaceSubClass 2 Abstract (modem)
bInterfaceProtocol 1 AT-commands (v.25ter)
iInterface 0
CDC Header:
bcdCDC 1.10
CDC Call Management:
bmCapabilities 0x01
call management
bDataInterface 1
CDC ACM:
bmCapabilities 0x06
sends break
line coding and serial state
CDC Union:
bMasterInterface 0
bSlaveInterface 1
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x82 EP 2 IN
bmAttributes 3
Transfer Type Interrupt
Synch Type None
Usage Type Data
wMaxPacketSize 0x0010 1x 16 bytes
bInterval 64
Interface Descriptor:
bLength 9
bDescriptorType 4
bInterfaceNumber 1
bAlternateSetting 0
bNumEndpoints 2
bInterfaceClass 10 CDC Data
bInterfaceSubClass 0 Unused
bInterfaceProtocol 0
iInterface 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x03 EP 3 OUT
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Endpoint Descriptor:
bLength 7
bDescriptorType 5
bEndpointAddress 0x84 EP 4 IN
bmAttributes 2
Transfer Type Bulk
Synch Type None
Usage Type Data
wMaxPacketSize 0x0040 1x 64 bytes
bInterval 0
Device Status: 0x0000
(Bus Powered)
void usb_init_serialnumber(void)
{
char buf[11];
uint32_t i, num;
__disable_irq();
#if defined(HAS_KINETIS_FLASH_FTFA) || defined(HAS_KINETIS_FLASH_FTFL)
FTFL_FSTAT = FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL;
FTFL_FCCOB0 = 0x41;
FTFL_FCCOB1 = 15;
FTFL_FSTAT = FTFL_FSTAT_CCIF;
while (!(FTFL_FSTAT & FTFL_FSTAT_CCIF)) ; // wait
num = *(uint32_t *)&FTFL_FCCOB7;
#elif defined(HAS_KINETIS_FLASH_FTFE)
// TODO: does not work in HSRUN mode
FTFL_FSTAT = FTFL_FSTAT_RDCOLERR | FTFL_FSTAT_ACCERR | FTFL_FSTAT_FPVIOL;
*(uint32_t *)&FTFL_FCCOB3 = 0x41070000;
FTFL_FSTAT = FTFL_FSTAT_CCIF;
while (!(FTFL_FSTAT & FTFL_FSTAT_CCIF)) ; // wait
num = *(uint32_t *)&FTFL_FCCOBB;
#endif
Yep. Talk into the mic. Also, if you put a button on pin 28 (or just ground a piece of wire from pin 28) it switches to the next loop.Short 'organ' sound brushing finger over mic and more so blowing across the mic?
I can't figure out where that "sustain" comes from - it isn't intentional. The only thing I can think of is that it is something to do with the biquad filters. Although, the mic I am using is very sensitive and in my case perhaps it is picking up the constant fan noise from the desktop computer.Volume knob works to raise volume - can hear some sustain sticking in there?
No problems 5 uploads works at 180 and 240. {both proto_6 and round_3 T_3.6}
That's the problem.Going back to Rnd#1 board - it uploads and goes offline with no serial output?
Oh, oh. That sounds ominous. But the vocoder needs a lot of cpu for the audio processing and 96MHz is too slow. On the T3.6 you should run it at 180MHz. This version of the vocoder won't run in a T3.2/1 because of the ram space requirement unless it is compiled with only one of the smaller loops. But then the processor must be overclocked at 144MHz.Now Rnd#3 won't run and give warning at 96 MHz - I know I saw that last night.
When that happens to me (BTW - this is on Windows 7 Pro), I hold down the reset switch, compile and upload the Blink sketch and, once it has uploaded, release the button. That has always revived the serial port in Win 7 for me.TYQT shows them 'Missing' - they never come online.
This was on ubuntu 14.04, 1.6.9 with 1.29-beta4 (with recent teensy core updates). so my environment may have other problems, and probably not relevant to the vocoder issues. But it might be of interest to see if the problem can be demonstrated with a simpler sketch...Teensy Loader could not find the file bigflash.ino
Oh no, the compiler quit with an error, but did not print any error messages!
Your computer may be running out of memory or resources. Try closing other
windows or programs
Error compiling for board Teensy 3.5
const short array[256*1000-36000] = {43};
void setup()
{
Serial.begin(9600);
while(!Serial);
delay(1000);
int32_t sum = 0;
for(int i=0;i<rand();i++) {
sum += array[i];
}
Serial.println(sum);
}
void loop()
{
}
Here's a simple sketch which demonstrates the problem without any need for an audio board or microphone.
Code:const short array[256*1000] = {43}; ...
Pete