0

TPA2016 SHDN
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

TPA2016 SHDN

by rzelko on Thu Oct 18, 2018 2:28 pm

I am trying to understand what I need to do to utilize the SHDN pin on the TPA2016. I understand that the TPA2016's SHDN pin has pullups to VDD by default. The documentation for the TPA2016 states to connect SHDN to ground if you want to turn off the amp. How would I hook up the breakout to a Feather M0 controller? Can I just hook it up to a GPIO and digitalwrite LOW to the pin? Do I need any external circuitry to make the amp turn off by way of a GPIO signal?

rzelko
 
Posts: 32
Joined: Wed Feb 28, 2018 9:57 pm

Re: TPA2016 SHDN

by rzelko on Sat Nov 10, 2018 1:45 pm

Answering this post for myself, it would have helped tremendously if I had set the pinMode to OUTPUT in the first place. This one slipped by me for months. As a newcomer to the MCU world, it would have been helpful if Adafruit's product literature for the Feather M0 would have simply referred to the OUTPUT pinMode as being unchanged as opposed to the INPUT pinMode needing to be written as INPUT_PULLUP for the M0. This would have clued me into my mistake.

rzelko
 
Posts: 32
Joined: Wed Feb 28, 2018 9:57 pm

Re: TPA2016 SHDN

by adafruit_support_carter on Mon Nov 12, 2018 6:54 pm

Those are general MCU digital input / output features, not really specific to the Feather M0. Was the confusion related to the mentioning of pull up resistors on the SHDN pin?

adafruit_support_carter
 
Posts: 7014
Joined: Tue Nov 29, 2016 2:45 pm

Re: TPA2016 SHDN

by rzelko on Mon Nov 12, 2018 9:28 pm

Being new to Arduino, I had just recently learned how to set pinMode in my sketches. When I switched from the Mega to the M0, I had seen that the literature made note of a few differences in programming, one being Fir pinMode on the M0. It stated that the old way of setting a pin as INPUT should be written as INPUT_PULLUP. Not seeing a reference to OUTPUT, and the fact that it was the first time I had worked with an output, the concept of setting the pin for output never occurred to me.

The SHDN pull-up resistor had me confused to some degree. Having my M0 pin set as INPUT_PULLUP I was picking up voltage from the SHDN pin on the amp. I only figured it out because I happened to be using pin 13 on the M0, which is common with the on board LED (which was glowing dimly).

Thanks for the follow up.

rzelko
 
Posts: 32
Joined: Wed Feb 28, 2018 9:57 pm

Re: TPA2016 SHDN

by adafruit_support_carter on Tue Nov 13, 2018 1:58 pm

Sorry for it being confusing. I can see how the jargon could do that. Pull up/down resistors are a general concept, they get used for various things. Try reading through this guide section about pull up/down resistor and how they are used with digital inputs:
https://learn.adafruit.com/circuit-play ... ing-inputs

For a digital output, these are not needed as the output will be driven either high or low. There's no ambiguity as there is with floating inputs (see link).

For the description of the SHDN pin - think of it from the point of view of the TPA2016. It is reading the value of that pin to determine if it should shut down or not. So it is an input from the point of view of the TPA2016. So the issue described in the link above applies. Further, the idea with the pull up resistor that is included on the board is to allow you to be able to use the TPA2016 without needing to connect to the SHDN pin. The resistor will pull it up the enable setting. That way you only have to tie into the pin if you actually want to be able to force it to shut down.

adafruit_support_carter
 
Posts: 7014
Joined: Tue Nov 29, 2016 2:45 pm

Re: TPA2016 SHDN

by rzelko on Tue Nov 13, 2018 3:32 pm

Thank you for the explanation and for the Circuit Playground link. I have a much better understanding now. Thanks again for the follow up.

rzelko
 
Posts: 32
Joined: Wed Feb 28, 2018 9:57 pm

Please be positive and constructive with your questions and comments.