5V Trinket digital output

For other supported Arduino products from Adafruit: Shields, accessories, etc.

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
cosined
 
Posts: 30
Joined: Tue Sep 22, 2015 8:05 pm

5V Trinket digital output

Post by cosined »

Hi all, this is my first post on these forums. I have a question about the 5V Trinket. It uses 5V logic, and the 5 GPIO pins can be used to output high (i.e. 5V) when programmed to do so, right?

I realized that pins #3 and #4 were not both giving me 5V high and pin #3 was not following the directions of some code I wrote. Pin #3 is giving me a constant high voltage of 3V, while pin #4 is alternating according to the code every 2 seconds, but it gives a high of ~1.5V. Coincidentally, these are the two pins that are shared with the USB. There's probably a simple fix related to that then, since the other 3 pins work fine. I appreciate any help. Here is the snippet of the code I'm using to test this out.

Code: Select all

int positionThree = 3;
int positionFour = 4;

void setup()
{
}

void loop()
{
  digitalWrite(positionThree, LOW);
  digitalWrite(positionFour, HIGH);
  delay(2000);

  digitalWrite(positionThree, HIGH);
  digitalWrite(positionFour, LOW);
  delay(2000);
}

User avatar
Franklin97355
 
Posts: 23912
Joined: Mon Apr 21, 2008 2:33 pm

Re: 5V Trinket digital output

Post by Franklin97355 »

Do you have the USB cable disconnected while you are testing this?

User avatar
cosined
 
Posts: 30
Joined: Tue Sep 22, 2015 8:05 pm

Re: 5V Trinket digital output

Post by cosined »

No, I thought that as long as nothing was connected to those pins when the Trinket was being programmed (the red LED flashing), it was okay to use the USB connection to supply power. Is it actually the case that nothing should be connected to those pins when the USB is being used at all? If so, that's probably the issue then and I will test it soon using an external power supply.

Thanks Franklin for your help. I figured it would be an easy problem to solve. I'll post a reply with the results after I try it out.

User avatar
cosined
 
Posts: 30
Joined: Tue Sep 22, 2015 8:05 pm

Re: 5V Trinket digital output

Post by cosined »

That didn't work. I connected it to an analog power supply with 5V at the power pin and the power supply's ground on the ground pin. Pin #3 is giving me a constant 3V on the oscilloscope, and pin #4 is alternating according to the code but with a high of 2V. The 5V, BAT, and USB pins are all giving me 5V though.

What should I try next?

User avatar
adafruit_support_mike
 
Posts: 67454
Joined: Thu Feb 11, 2010 2:51 pm

Re: 5V Trinket digital output

Post by adafruit_support_mike »

Post a photo showing your hardware and connections please. 800x600 images usually work best.

User avatar
cosined
 
Posts: 30
Joined: Tue Sep 22, 2015 8:05 pm

Re: 5V Trinket digital output

Post by cosined »

Mike, here are some pictures of how I set it up.
From above
From above
20150924_073951_HDR (Custom).jpg (131.81 KiB) Viewed 254 times
Alternating 2V
Alternating 2V
20150924_073932_HDR (Custom).jpg (128.36 KiB) Viewed 254 times
Constant 3V
Constant 3V
20150924_073909_HDR (Custom).jpg (128.29 KiB) Viewed 254 times

User avatar
adafruit2
 
Posts: 22148
Joined: Fri Mar 11, 2005 7:36 pm

Re: 5V Trinket digital output

Post by adafruit2 »

yeah there is level shifting on the USB pins - USB data is 3.3V max :)

User avatar
cosined
 
Posts: 30
Joined: Tue Sep 22, 2015 8:05 pm

Re: 5V Trinket digital output

Post by cosined »

I see. Hmm. In that case, I can't use this for the purpose I intended. I wanted to drive a bipolar stepper motor controller.

Thank you Franklin, Mike, and Adafruit for the help.

Locked
Please be positive and constructive with your questions and comments.

Return to “Other Arduino products from Adafruit”