Go to Post We don't have to reinvent the wheel every year. (We have AndyMark to do that for us.) - GaryVoshol [more]
Home
Go Back   Chief Delphi > Technical > Electrical
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 27-12-2013, 09:14
Mike Ounsworth's Avatar
Mike Ounsworth Mike Ounsworth is offline
Roboticist
FRC #3710 (Cyber Falcons)
Team Role: Mentor
 
Join Date: Dec 2004
Rookie Year: 2004
Location: Montreal, Qc, Canada
Posts: 22
Mike Ounsworth is a jewel in the roughMike Ounsworth is a jewel in the roughMike Ounsworth is a jewel in the rough
3V3 digital signal to the cRIO

I am using a Raspberry Pi to send a digital I/O to the cRIO. I know that the Pi uses 3.3V (3V3) for a True, while the cRIO expects a 5V signal.

I know that with some combinations of hardware this is fine, and others cause problems. Does anyone know about the Raspberry Pi / cRIO combination?

(Note and warning: I know that putting a 5V signal into the Pi will fry it, I'm asking about the Pi --> cRIO direction.)
__________________
I am doing graduate work on autonomous aerial and underwater vehicles with McGill University's Mobile Robotics Lab.

I have been Lead Programming Mentor with Teams 296 and 3710, as well as Head Mentor for 2 years at 3710.
  #2   Spotlight this post!  
Unread 27-12-2013, 11:13
McGurky's Avatar
McGurky McGurky is offline
Geek
AKA: Kyle McGurk
FRC #1716 (Redbird Robotics)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Houghton, MI
Posts: 291
McGurky is just really niceMcGurky is just really niceMcGurky is just really niceMcGurky is just really nice
Re: 3V3 digital signal to the cRIO

Like you have said, and others have tried, running a 3V3 signal into the cRIO will not trigger a logic high for the cRIO. You must use some type of logic level converter(LLC) to perform the task you are desiring. (3V3-->5V)

Picking the proper LLC depends on the frequency of switching that your application requires as well as the type of signal you are running (i.e is it bidirectional or not). However, without knowing this, I can at least point you in the right direction to start looking...

Sparkfun Electronics sells a cheap LLC board that is run off of the BSS138 Transistor. It should work for you, and has worked for other teams

Link to Board
Link to Schematic
Link to Transistor Datasheet

Also, here is a relevant thread from last year: http://www.chiefdelphi.com/forums/sh...d.php?t=101407
__________________
RTFM -Read The First Manual

You already are who you are, I may be able to show you a fancy trick or two, but the term "Better" is relative to the potential you already have.
Take a look at my website/Blog!
  #3   Spotlight this post!  
Unread 27-12-2013, 12:21
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

The 14 DIO on the digital sidecar are connected to the NI 9403 digital module, which specifies 5v TTL. a 5v TTL input is compatible with 3.3v CMOS output. Vih for 5v TTL is 2v, while Voh for 3.3v CMOS is 2.4v. There is reduced margin, but it was designed to work. I have not tried it, however. Sparkfun has a nice tutorial on logic levels: https://learn.sparkfun.com/tutorials...s/introduction. However, because the digital sidecar has a 5v pullup, you should not connect them to the Raspberry Pi, but could be used with 5v tolerant 3.3v logic.

I could not quickly find a spec on the DIO for the Raspberry Pi, so you would have to make sure it conforms to 3.3v CMOS logic levels.

Other signals on the digital sidecar do not go directly to the 9403 and would have to be evaluated independently (like I2C).

Quote:
Originally Posted by McGurky View Post
Like you have said, and others have tried, running a 3V3 signal into the cRIO will not trigger a logic high for the cRIO. You must use some type of logic level converter(LLC) to perform the task you are desiring. (3V3-->5V)

Also, here is a relevant thread from last year: http://www.chiefdelphi.com/forums/sh...d.php?t=101407
Do you have another example besides that thread? It sounds like the problem was not powering the IMU from the right power source, rather then a logic conversion problem.

Last edited by Joe Ross : 27-12-2013 at 20:27. Reason: added pullup info
  #4   Spotlight this post!  
Unread 27-12-2013, 13:40
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: 3V3 digital signal to the cRIO

I would say, if you have a two way connection with one direction per line, the RPi tx can be directly connected to the rx on the crio. However, you would need a resistor in the rx of the pi. Are you using i2C or SPI, etc? I use a 5v UART connection with my pi to access terminal via serial.

5v requires 2v5 to register a 1.
  #5   Spotlight this post!  
Unread 27-12-2013, 16:13
magnets's Avatar
magnets magnets is offline
Registered User
no team
 
Join Date: Jun 2013
Rookie Year: 2012
Location: United States
Posts: 748
magnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by yash101 View Post
5v requires 2v5 to register a 1.
Not quite. You only need 2 volts for TTL to read high, which is a zero, not a one on the cRIO.
  #6   Spotlight this post!  
Unread 27-12-2013, 16:17
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,590
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by magnets View Post
Not quite. You only need 2 volts for TTL to read high,
correct

Quote:
Originally Posted by magnets View Post
which is a zero, not a one on the cRIO.
Where did you get that information?
  #7   Spotlight this post!  
Unread 27-12-2013, 16:22
magnets's Avatar
magnets magnets is offline
Registered User
no team
 
Join Date: Jun 2013
Rookie Year: 2012
Location: United States
Posts: 748
magnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond reputemagnets has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by Joe Ross View Post
correct



Where did you get that information?
I can't find it in any documentation, but I just remembered this, and thinking it was counterintuitive.
  #8   Spotlight this post!  
Unread 27-12-2013, 17:00
Tem1514 Mentor's Avatar
Tem1514 Mentor Tem1514 Mentor is offline
Registered User
FRC #1514
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Toronto
Posts: 239
Tem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to behold
Re: 3V3 digital signal to the cRIO

If all else fails you could always make up a converter with any open collector transistor. Off the top of my head a MPSA14 or MPSA13 would work very nice to change the 3.3 to 5 volt. All you need is to drive the base with the 3.3 logic and then use a 4.7K pullup to cRIO 5 volts on the collector. Be sure to use a common ground between the PI and cRIO.
  #9   Spotlight this post!  
Unread 27-12-2013, 17:23
Thad House Thad House is online now
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

You actually DO NOT want to directly connect a pin on the Pi to a pin on the Sidecar. The sidecar has an internal pullup to 5V in it. Putting that 5V to the Pi could destroy the Pi. Either a Pull down, voltage divider, or logic converter would be needed in order to protect the Pi. The CRIO can take up to i think 24v on an input, so no need to worry about damaging the CRIO at the levels you are using.

That 5V comes from the Sidecar even if it is set as an input, so it needs to be worked out even if the CRIO is set as input.
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.

Last edited by Thad House : 27-12-2013 at 17:25.
  #10   Spotlight this post!  
Unread 27-12-2013, 20:01
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by sst.thad View Post
You actually DO NOT want to directly connect a pin on the Pi to a pin on the Sidecar. The sidecar has an internal pullup to 5V in it. Putting that 5V to the Pi could destroy the Pi. Either a Pull down, voltage divider, or logic converter would be needed in order to protect the Pi. The CRIO can take up to i think 24v on an input, so no need to worry about damaging the CRIO at the levels you are using.

That 5V comes from the Sidecar even if it is set as an input, so it needs to be worked out even if the CRIO is set as input.
That could be true. I am kind of comparing to the BASIC stamp which has 5v I/O. Just stay safe and buy a cheap level shifter. $5 could save you from buying more $35 RPis, so being safe-than-sorry would also be the cheaper way in this case.

Is that true that the pin is held up? That reduces some of the nightmares I have, about limit switches having the pins floating, so thanks
  #11   Spotlight this post!  
Unread 27-12-2013, 20:06
Thad House Thad House is online now
Volunteer, WPILib Contributor
no team (Waiting for 2021)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Thousand Oaks, California
Posts: 1,106
Thad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond reputeThad House has a reputation beyond repute
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by yash101 View Post
That could be true. I am kind of comparing to the BASIC stamp which has 5v I/O. Just stay safe and buy a cheap level shifter. $5 could save you from buying more $35 RPis, so being safe-than-sorry would also be the cheaper way in this case.

Is that true that the pin is held up? That reduces some of the nightmares I have, about limit switches having the pins floating, so thanks
Yeah they include a 10k Pullup to 5V inside the sidecar.

Here's the schematic.
http://www.usfirst.org/uploadedFiles...matic%20v7.pdf
__________________
All statements made are my own and not the feelings of any of my affiliated teams.
Teams 1510 and 2898 - Student 2010-2012
Team 4488 - Mentor 2013-2016
Co-developer of RobotDotNet, a .NET port of the WPILib.
  #12   Spotlight this post!  
Unread 27-12-2013, 20:24
Tem1514 Mentor's Avatar
Tem1514 Mentor Tem1514 Mentor is offline
Registered User
FRC #1514
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Toronto
Posts: 239
Tem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to behold
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by sst.thad View Post
Yeah they include a 10k Pullup to 5V inside the sidecar.

Here's the schematic.
http://www.usfirst.org/uploadedFiles...matic%20v7.pdf
Thank you sst_thad I forgot about the 10K inside the sidecar. Using the MPSA transistor will work just fine in an open collector configuration to change the Pi 3.3 V to the cRIO 5 V level.

Just as a side note, I have a 5 volt micro computer stand alone system that is used to drive an 'H' bridge that runs at 24 volts with no problems handling the two voltages.

As long as you use the transistor between the Pi and Digital side car no problem as the transistor will act as the buffer between the two.
  #13   Spotlight this post!  
Unread 27-12-2013, 20:38
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: 3V3 digital signal to the cRIO

Are you talking about this excerpt (attached below)? It shows a set of pull-up resistors connected to the I/O.
Attached Thumbnails
Click image for larger version

Name:	Screen Shot 2013-12-27 at 6.36.23 PM.png
Views:	28
Size:	55.4 KB
ID:	15664  
  #14   Spotlight this post!  
Unread 27-12-2013, 20:55
Tem1514 Mentor's Avatar
Tem1514 Mentor Tem1514 Mentor is offline
Registered User
FRC #1514
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Toronto
Posts: 239
Tem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to behold
Re: 3V3 digital signal to the cRIO

Quote:
Originally Posted by yash101 View Post
Are you talking about this excerpt (attached below)? It shows a set of pull-up resistors connected to the I/O.
That's the one and you are interested in the GPIO [1-14] as they are the digital inputs on J26 for the Rev 7 digital sidecar. You made me pull out my book.
  #15   Spotlight this post!  
Unread 27-12-2013, 21:27
Tem1514 Mentor's Avatar
Tem1514 Mentor Tem1514 Mentor is offline
Registered User
FRC #1514
Team Role: Mentor
 
Join Date: Feb 2010
Rookie Year: 2010
Location: Toronto
Posts: 239
Tem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to beholdTem1514 Mentor is a splendid one to behold
Re: 3V3 digital signal to the cRIO

Here is section of my ‘H’ bridge that is driven by TTL 5 volt logic and then will either source B+ (24 volts) or sink the 24 volts.

The TTL control signals are on the right hand side and called;
COL3 when logic high will source B+ (24 volts) through Q11 (TIP127)
With the help of Q33 (MPSA14) that is used an a inverted in this case.

COL3’ when logic high will sink the B+ through Q22 (TIP122)

Just a side note here, NEVER put a logic high on both COL3 and COL3’ at the same time as it will create a short from B+ to ground and blow the fuse F11.


For your application all you need is COL3 (Output from PI) R22 (220ohm) R55 (1K) and Q33 (MPSA14). The point where Q33 connects to R33 is not needed but instead would go GPIO [1-14] on the digital side card.

So just three parts and your Pi can talk to your cRIO. I am sure there is a I/C chip that will also work but I don’t have my data books handy.

If you need more help just ask.

The other picture is the actual boards in the project.
Attached Thumbnails
Click image for larger version

Name:	H bridge section.JPG
Views:	28
Size:	723.3 KB
ID:	15665  Click image for larger version

Name:	Clock.JPG
Views:	33
Size:	1.24 MB
ID:	15666  
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 21:56.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi