gbulmer
Posts: 52
Joined: Wed Sep 28, 2011 9:11 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Mon Nov 21, 2011 9:45 pm

Quote from abishur on November 21, 2011, 15:17
Quote from gbulmer on November 21, 2011, 13:54
Quote from abishur on November 21, 2011, 13:36

Interesting... so if we use the GPIO pins to supply 5V, then we need to make sure to include our own voltage protection (since it's coming in after all the voltage protection)? Or am I have a mass fit of dyslexia?

The microcontroller GPIO pins can't supply 5V directly, they can only supply 3.3V. (don't quite do 3.3V, as there is usually a little voltage drop inside the chip)

I don't believe any of the GPIO's are 5V tolerant (can't see anything on the wiki), so the only way to 'supply' 5V will be via an external device, e.g. bipolar-transistor, MOSFET, or IC.


Check the post from gert I'm referencing or the post from wizard above, two of the GPIO pins are attached to the 5V rail (though as Wizard says, I don't think they are also attached to the SoC, so it's a semantics issue)

Yes, semantics is the only stuff that matters :-)
Okay, so this is about connections on an R-Pi I/O connector, and not GPIO pins. It might be helpful to avoid using the term 'GPIO pins' unless it is referring to pins connected to GPIO pins on the SoC.

Maybe the discussion about power connections might be conflating several different use cases, or types of user?

I have several different target audiences, including the electronics neophyte, and me.

I am happy having a simple 'polyfuse' between the R-Pi power supply and the 5V pin (and 3.3V pin) on an R-Pi I/O connector. I occasionally make mistakes, and both school children and adults often make mistakes when using breadboard, so a polyfuse somewhere in the power rail, before it is exposed to the 'breadboard user", is sensible.

If it isn't on the R-Pi, I'd likely put one on an I/O adapter board intended for the "breadboard users".

PiMSE
Posts: 5
Joined: Mon Nov 28, 2011 6:38 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Mon Nov 28, 2011 7:17 pm

At the risk of incurring the wrath of the Internet, I'm going to disclose this right up front: I have not read all 15 pages of posts on this forum. No apologies.

(It might be time to summarize the posts-to-date in the wiki and come up with a list of side projects or volunteer tasks related to the GPIO interface...)

And now, I'm going to try to introduce what I hope is a new idea (on p16 of this thread, where it might never be seen):
There was a lot of discussion early on of multiplexing the GPIO pins.
If you want more GPIO, consider something like a Cypress EZ-USB chip and creating a lightweight USB peripheral. This is, more or less, how the industrial data acquisition products from Measurement Computing and National Instruments are built. Only, we should be able to do it for a fraction of the $300/board (and up) prices that they charge.

Now, I'm not a Cypress cheerleader, but I'm familiar with their EZ-USB ICs, and I think they're a good fit for this application.
Yes, they're surface mount (possibly socket-able) parts.
Yes, they need to be programmed with custom firmware.
And, yes, it requires somebody with Linux coding experience to write a Pi-side driver.
So, all of that puts a dent in the ability of users to implement DIY peripheral boards.

But what you get for all that work might make the tradeoff worthwhile.
(Cypress datasheet: http://www.cypress.com/?rID=38801 )

Up to 40 GPIO pins. An additional I2C bus controller. Two additional USARTs.
And, just by putting the Cypress chip in the loop, the RaspberryPi's Broadcom chip is effectively buffered, even if you don't put buffers on the I/Os of the Cypress chip (which you should).

All the additional GPIO and serial interfaces mean that you can implement some of the wishlist features like interfaces to external ADC and DAC chips, without sacrificing additional GPIOs on the RPi board itself.
And the issues surrounding bidirectionality of the RPi's GPIOs can be gotten around simply:
Either the I/O board driver can set the directionality of the Cypress I/O pins appropriately,
or you can actually split the Cypress GPIOs a group of dedicated inputs and a group of dedicated outputs, and have the driver send read and write requests to the appropriate Cypress pin.
That latter approach is highly "pin-intensive." But it permits extremely simple board construction, with unidirectional buffers on all the Cypress IOs, since their direction will now be fixed.

In terms of cost: it looks like the Cypress CY7C68013A chip will cost ~$6 from Digikey in qty~1000.
But, in terms of parts count, the board can (potentially) be as simple as one Cypress chip and an I/O header. The low-power Cypress chip can draw power from the +5V USB supply on the RPi board. If there is a layer of buffers on the Cypress I/Os, they would probably do well to get their own, independent, power supply.

Anyway. That's an alternative approach to multiplexing for the forum to consider.

We still need a solid design for a basic bidirectional buffer board to make the existing GPIOs usable, while protecting them from the slings and arrows of ESD, overvoltage, and short circuit events.

User avatar
meltwater
Posts: 1015
Joined: Tue Oct 18, 2011 11:38 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Mon Nov 28, 2011 8:12 pm

~$6 from Digikey in qty~1000
As my old teacher used to say..."they're cheap but what are you gonna do with the other 999?" ;)

If you can build it into an optional board then many people may have applications for it, others may not and use a different board. It's all good.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

PiMSE
Posts: 5
Joined: Mon Nov 28, 2011 6:38 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Mon Nov 28, 2011 8:47 pm

Ha. Good point, though.
Since I haven't got the expertise to do the Linux-driver end of it, I threw a post in here, hoping some interested party might step forward.

Is there any consensus yet on what the basic GPIO break-out board should look like? I have yet to see a schematic posted ...

bradburts
Posts: 341
Joined: Sun Oct 02, 2011 7:07 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Mon Nov 28, 2011 10:26 pm

Quote from PiMSE on November 28, 2011, 20:47
Since I haven't got the expertise to do the Linux-driver end of it, I threw a post in here, hoping some interested party might step forward.

I'm nibbling.
What other components would the board require? What would the UPC be for boards up to 100 off? What header would you use?
Are you an electronics engineer?
Do you have fab/test tools/abilities? The pitch is too small for me.
Getting very lazy now, does the 8051 come with all software needed or does that software need writting & programming as well?

sylvan
Posts: 118
Joined: Sun Nov 27, 2011 8:39 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Tue Nov 29, 2011 4:11 am

Quote from PiMSE on November 28, 2011, 19:17
If you want more GPIO, consider something like a Cypress EZ-USB chip and creating a lightweight USB peripheral. ...
Yes, they need to be programmed with custom firmware.
And, yes, it requires somebody with Linux coding experience to write a Pi-side driver.

Cypress makes some good chips. I used to work with several of the guys that did their first few generations...

But to avoid the custom firmware issue, maximize simplicity and leverage existing drivers for linux, plus still get most of the functionality you mention, the good old FTDI chips are pretty awesome. I'm talking about the GPIO modes of the FT232R, FT2232, FT4232 and whatever the FT{something} FIFO chip is that I cannot recall at the moment. Even the bog standard FT232R cable with the 6pin header gives you 4 GPIO lines (purchase your choice of 3.3v or 5v). If you build with the raw chip you get (IIRC) 8 or 4 plus a full serial port. For most of my purposes the 2232 hits the sweet spot. It gives you individually controllable I/Os or a few different ways to automatically clock data in and out at pretty impressive rates (to me anyway).

WizardOfOZ
Posts: 76
Joined: Thu Oct 13, 2011 8:08 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Tue Nov 29, 2011 8:48 am

Then there are those, who will be happy with just using a bunch of 74HC595s and 74HC597s, and talk to them via SPI and the provided driver. Add a few resistors and MOSFETs as level shifters, bit bang the rest of the interface, and ta-daa! I/O expander. :D

bradburts
Posts: 341
Joined: Sun Oct 02, 2011 7:07 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Tue Nov 29, 2011 8:58 am

Good point.
I used to design in USB to RS232 dongles rather an overpriced PC104 board.
Is that 4 I/O or 2 I and 2 O, RTS, CTS etc?

What chance would I have soldering one to something like
http://www.hobbytronics.co.uk/.....dapter-28?
My hands don't shake too bad after the first drink but my eye sight is not good close up....

Failing that http://www.hobbytronics.co.uk/.....l-breakout is not too expensive, P&P is reasonable.
I am looking for something up to £5 though.

gbulmer
Posts: 52
Joined: Wed Sep 28, 2011 9:11 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Tue Nov 29, 2011 1:18 pm

Quote from PiMSE on November 28, 2011, 19:17
At the risk of incurring the wrath of the Internet, I'm going to disclose this right up front: I have not read all 15 pages of posts on this forum. No apologies.

And now, I'm going to try to introduce what I hope is a new idea (on p16 of this thread, where it might never be seen):
There was a lot of discussion early on of multiplexing the GPIO pins.
If you want more GPIO, consider something like a Cypress EZ-USB chip and creating a lightweight USB peripheral.


A simpler way to get a USB-based set of GPIOs/ADC/PWM is to use an Arduino or Arduino Mega.

The Arduino USB is much slower than the Cypress EZ-USB, but otherwise has the following advantages.
Already exists:
1. Off-the-shelf in many different sizes and flavours
2. Versions with GPIO protection (ruggedcircuits.com)
3. 'Firmata' software to remotely control the Arduino's I/O
4. Host driver done. No need for any new driver
6. DIY-able, i.e. Open Source PCBs are available now
7. Free and Open Source tool chain, and easy to get
8. Easy to use libraries for all peripherals.

Another option using a similar ATmega chip, which already exists, and has faster USB comms than an Arduino, is a Teensy or Teensy++.

I've mentioned this earlier in this thread, but another interesting comms. approach is SPI. An Arduino ATmega MCU can be programmed over SPI, then communicated with over SPI, and SPI is quite fast (more than 10x faster than an Arduino over an FTDI USB-to-TTL-serial). So a single 6-wire interface, including power and ground, using ribbon cable, on a easy to make 0.1" pitch header would be enough to connect R-Pi to an Arduino.

I have nothing against EZ-USB; a friend, who I have a lot of respect for, uses them a lot. But it seems like an unnecessary stretch when ready made boards could be used today.

gbulmer
Posts: 52
Joined: Wed Sep 28, 2011 9:11 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Tue Nov 29, 2011 1:45 pm

Quote from bradburts on November 29, 2011, 08:58
Good point.
I used to design in USB to RS232 dongles rather an overpriced PC104 board.
Is that 4 I/O or 2 I and 2 O, RTS, CTS etc?

What chance would I have soldering one to something like
http://www.hobbytronics.co.uk/.....dapter-28?
My hands don't shake too bad after the first drink but my eye sight is not good close up....

Failing that http://www.hobbytronics.co.uk/.....l-breakout is not too expensive, P&P is reasonable.
I am looking for something up to £5 though.

If you can use the 'toaster oven' or 'electric frying pan/skillet' technique, there is a very good chance of making those.
We did this in a toaster oven OROne - Cortex-M3 robot controller (STM32F103)
The local electronics teacher, Paul Gardiner, regularly gets school children (maybe before GCSE age) to make PIC-based microcontroller boards using SMD parts using solder paste and a toaster oven.

I would still suggest a cheap, and DIY-able solution is a 28-pin DIL ATmega168 (the same as an old Arduino) at £2.22+VAT (in packs of two), in a socket (so you can change it when it blows up) and about £1 of electronics, on a piece of veroboard, with a SPI header.

That will lose SPI (which will be tied to the R-Pi for programming and comms.), but you will gain the use of the ATmegas serial port. So you'll get 17 I/O's including 6 ADC, 6 PWM, 1 USART, 1 I2C, input capture, etc.

Someone will have to make the R-Pi SPI available as some sort of serial device so that the normal ATmega programmer software can work, and to support serial comms.

bradburts
Posts: 341
Joined: Sun Oct 02, 2011 7:07 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Tue Nov 29, 2011 2:11 pm

Thanks. Think that the oven work is a no for me ;).
I am in fact exceptionally lazy. I was looking for something cheap and off the shelf.
The ATmega is nice n cheap but I will have to write some software and program it.
I will then have to hook it up to the RPI's SPI port and risk spiking me PI with static.
Then I will have to debug SPI to ATmega and I don't have a LA.
The ATmega has a serial port so that makes life a little easier.
What I like about the USB solution is that I don't have to solder to the RPI plus I have a reference design using a PC and the driver software. Having the two views really does help when you make as many mistakes as I do....
But the ATmega is nice and cheap, so I am being drawn.......

User avatar
panik
Posts: 369
Joined: Fri Sep 23, 2011 12:29 pm
Location: Netherlands

Re: Break out board (GPIO, SPI, I2C, and UART)

Tue Nov 29, 2011 9:31 pm

SSOP really isn't too hard to solder by hand with a regular soldering iron and "normal" tip. You don't even need an extremely steady hand.

Just make sure to use flux, and maybe a magnifying glass to check your work. Small bridges can be removed by applying the soldering iron again. Remove bigger blobs of unwanted solder with solder wick.

There are some nice videos on youtube on the process.
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")
http://www.onandoffables.com

gbulmer
Posts: 52
Joined: Wed Sep 28, 2011 9:11 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Nov 30, 2011 1:18 am

Quote from bradburts on November 29, 2011, 14:11
Thanks. Think that the oven work is a no for me ;).
I am in fact exceptionally lazy. I was looking for something cheap and off the shelf.
The ATmega is nice n cheap but I will have to write some software and program it.

You are going to have to write some software at some point to use any kind of GPIO, aren't you?

Maybe the best bet for something low-cost, on USB, with I/Os (to blow up and sacrifice itself for the R-Pi) are the PICs which come in DIL packages, and have USB on-board?

E.g.: Pinguino at http://www.hackinglab.org/
sounds like a possible solution.

I have not tried it, but it does look like a handy piece of work for PIC fans, and might satisfy a £5 budget.

Edit: The Pinguino is a single-sided PCB, using through-hole parts, so it should be cheap to make, and is DIY-able.

PiMSE
Posts: 5
Joined: Mon Nov 28, 2011 6:38 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Nov 30, 2011 1:40 am

Quote from sylvan on November 29, 2011, 04:11
to avoid the custom firmware issue, maximize simplicity and leverage existing drivers for linux, plus still get most of the functionality you mention, the good old FTDI chips are pretty awesome. I'm talking about the GPIO modes of the FT232R, FT2232, FT4232

Good call. You sold me on the FTDI chips.
Like I say, I'm familiar with the Cypress parts and I really liked their dev tools.
I never worked with the FTDI parts and I didn't realize what all they could do. They look very attractive: http://www.ftdichip.com/Products/ICs.htm

The FT4232H looks like a great choice. 40 GPIOs, reconfigurable as up to 4 serial (UART, SPI, or I2C) ports. No firmware programming required.
And the FT2232D, with smaller pin count and opto-isolated serial mode? Also awesome.

@gbulmer,
If the Arduino community is already producing boards that do this, maybe that really is the best place to look...and maybe I'll have to start keeping up with Arduino news.

And, @WizardOfOZ,
I agree. A board full of shift registers would be a REALLY simple way to expand to an arbitrary number of GPIO pins through the SPI bus. It'd be easily DIYable with through-hole components.
There's a schematic that should be sketched up and posted.

User avatar
johnbeetem
Posts: 945
Joined: Mon Oct 17, 2011 11:18 pm
Location: The Mountains
Contact: Website

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Nov 30, 2011 2:19 am

Quote from PiMSE on November 30, 2011, 01:40
Quote from sylvan on November 29, 2011, 04:11
to avoid the custom firmware issue, maximize simplicity and leverage existing drivers for linux, plus still get most of the functionality you mention, the good old FTDI chips are pretty awesome. I'm talking about the GPIO modes of the FT232R, FT2232, FT4232

Good call. You sold me on the FTDI chips.


I've used the FTDI FT2232H Mini-Module as a JTAG controller. Hardware and software work very nicely, and they have very good documentation.

http://www.ftdichip.com/Produc.....odules.htm

The FT2232H Mini-Module is not dirt cheap (£19.50 at FTDI site), but cheaper than most JTAG modules. It has two very configurable ports and is very compact. I got mine in the USA from Saelig (US$25.75):

http://www.saelig.com/product/UB066.htm

Saelig is a nice company with very interesting products.

bradburts
Posts: 341
Joined: Sun Oct 02, 2011 7:07 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Nov 30, 2011 9:48 am

E.g.: Pinguino at http://www.hackinglab.org/
sounds like a possible solution.

Thanks, some great links comming through.

You are going to have to write some software at some point to use any kind of GPIO, aren't you?


I was of course lying, I work very hard at not having to do the hard work ;)
Done right then I will just have to write a few lines in a script.

lyzby
Posts: 24
Joined: Sun Nov 20, 2011 3:34 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Tue Dec 13, 2011 5:41 pm

R-Pi hardware question: does the R-Pi board have the pull-up resistors for the I2C or would they need to be on the breakout board?

User avatar
TonyD
Posts: 451
Joined: Thu Sep 08, 2011 10:58 am
Location: Newcastle, UK
Contact: Website

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Dec 14, 2011 1:23 pm

Quote from lyzby on December 13, 2011, 17:41
R-Pi hardware question: does the R-Pi board have the pull-up resistors for the I2C or would they need to be on the breakout board?

I would put them on a board to be sure. You can always take them off if they are present on the R-Pi.
Tony

problemchild
Posts: 22
Joined: Thu Oct 06, 2011 8:08 am
Contact: Website

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Dec 14, 2011 2:32 pm

If someone just wants a basic board with just locations to do your own thing then I miught suggest what we have been doing:

http://www.raspberrypi.org/for.....038;t=1483

Might be of intereest to folks who want to do their own thing.

Any interesty and we;ll roll up the improvements and get them etched ASAP

lyzby
Posts: 24
Joined: Sun Nov 20, 2011 3:34 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Dec 14, 2011 3:48 pm



Based on this photo of the gpio header, it appears that SDA0 and SCL0 are connected to resistors. It looks like a 6-pin, 2-row cable could carry off the following, counter-clockwise from the square pad: 3V3, SDA0, SCL0, GND, DNC, 5V. That's everything you want for i2c.

Can someone with a connection to the developers comment on whether the i2c drivers and kernel code are expected to be enabled in the initial distro releases?

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Dec 14, 2011 4:07 pm

Or you could use the up and coming Gert board (made by r-pi's Gert Van Loo) ;)
Dear forum: Play nice ;-)

User avatar
meltwater
Posts: 1015
Joined: Tue Oct 18, 2011 11:38 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Dec 14, 2011 4:23 pm

I hope the Gert board won't be far behind real pi's but I imagine that's not quite the focus at the moment. A Gert board is a must though, so fingers crossed for it.
______________
http://www.themagpi.com/
A Magazine for Raspberry Pi Users
Read Online or Download for Free.

My new book: goo.gl/dmVtsc

Meltwater's Pi Hardware - pihardware.com

Like the MagPi? @TheMagP1 @TheMagPiTeam

lyzby
Posts: 24
Joined: Sun Nov 20, 2011 3:34 am

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Dec 14, 2011 4:43 pm

I did not see that the Gert board (page 11 of this thread) mentioned i2c--that's what I am particularly interested in.

User avatar
Gert van Loo
Posts: 2487
Joined: Tue Aug 02, 2011 7:27 am
Contact: Website

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Dec 14, 2011 5:09 pm

Uh no, I use SPI as I find I2C too slow. Boards have come back expect pictures soon.

obarthelemy
Posts: 1407
Joined: Tue Aug 09, 2011 10:53 pm

Re: Break out board (GPIO, SPI, I2C, and UART)

Wed Dec 14, 2011 5:32 pm

I like the bomb dropped off-handedly as an afterthought ^^

Return to “Other projects”