Audio shield Teeny 3.2 - FFT issue - LED_BUILTIN

netmindz

Member
After many of hours head scratching and process of elimination I have found the reason why the FFT code returns only zero in my project when I copy and paste were sample into it.

Setting pinMode(LED_BUILTIN, OUTPUT); appears to be the cause?!

I'm blinking that LED to provide status info. Commenting out that line
 
I think that very poor design for the audio board to reuse a pin that already has a function on the teensy itself. It's one thing for two different accessories to be incompatible, but for a board to be incompatible with the basic function of the microcontroller is bad, especially when the teensy has so many pins and such flexibility
 
Do you realize these chips have a limited range of hardware functions that can be attached to each pin? Many Arduinos and
Arduino compatibles use pins 10..13 as the SPI bus so that limits the use LED pin already - you can't use it if using SPI on
many boards.

In attempting to be Arduino-compatible and pinning out useful busses on the available pins compromizes have to be made - very
few microcontrollers have fully multiplexed I/O connections, and different microcontrollers are different, often very different - different
Teensy's for example use completely different chips, yet present as similar a pinout as possible. For instance the T3.2 uses the
MK20DX256 from Freescale, but the T4's use the iMXRT1062 from NXP - there are enough differences between these to force a different
audio board version to be designed for the T4 - that's just how it is...

My advice is learn the lesson that one has to check shield pinouts for clashes, in fact there's several ways hardware can clash,
either pin use, interrupts, timer and other resource usage --- hardware is not as flexible as software, you can't just redefine it,
you have to work with what you've got, and its a good idea before launching into a project to list all the pins and resources and
check for clashes. This is both for hardware and for libraries that directly interface to hardware.
 
Yeah I know that on the Teensy certain pins can only be used for certain purposes as it comes with the great colour coded guide.

I didn't realise their was attempt to match pin numbers with Arduino, as otherwise would have been better for the LED to be on pin2 or pin24 to allow it to be dedicated to that purpose . That said pin 2 is used by octo

With regards to hardware clash, I had checked the audio shield and the octo board for clash, my point is that the audio board clashes with the microcontroller board itself.

I can't work around this in software as the hardware design choice to put the led on the SPI SCK pin is not something I can change. My only option will be to add an external led.

No so easy to do when currently just a stack of the 3 boards. I'll check the pinouts of both the audio and octo to work out what is free and easily accessible
 
One thing I found useful was to mark the audio shield pins on the Teensy pinout card with a marker pen, since its
not immediately obvious from the existing information, being a combination of I2S, I2C, A1 and SPI pins
 
Back
Top