Page 1 of 8

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

Posted: Sat Sep 10, 2011 8:49 pm
by Ben_P
Hi

first off this is my first post.

I have had a look around the forum and have only been able to find tangentially related to setting up a breakout board for the electronic interfaces.

Some goals of this project

The board should be low cost (whats the point of having a $25 PC and then plugging in an over priced IO board).
The board will be self assembled so easy to get easy to work with parts are a must, (e.g try to use DIPs and though hole components).
The board will be considered expendable and will sacrifice itself for the R-Pi (must be cheap), this does not mean the board should break easily.

My understanding of the problem, (please correct me if I am wrong or add if there are any more):

The header are (purposefully) difficult to work with physically.
There is no over-voltage protection on the GPIO/Serial IO pins.
There is no software written for interfacing with the the IO pins.

So my solution would be:

To create a board with a easy to use physical access to the pins.
To protect the R-Pi using tri-state buffers and possible use of optical coupling.
Possible use of latches/registers for the GPIO.
Write a kernel driver for the GPIO.
Write C API and wrapper for the kernal driver.
Write C++ and python wrappers for the API

And there are some other things that would be cool

Mux the GPIO to give more inputs/outputs (latches/registers become essential).
Add ADC in
Add DAC out.

I feel I could do a lot of this now (and am willing to learn the stuff I do not know).
As a a CS/EE grad with some limited real world experience. The area I am most out of my comfort zone for is the writing of the kernel module.

Any comments would be appreciated.

On re-reading I have thought that I might come off as someone who wants to develop an add on product and wants help monetizing it. This is not the case any designs/software will be open and freely available, I might consider selling blank board or kits at cost + PP if this becomes popular and the scale makes sense.

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

Posted: Sat Sep 10, 2011 9:09 pm
by obarthelemy
That sounds like a very interesting project, nicely researched and presented. And I'm sure the Pi guys (and gal !) wouldn't even object to you selling that, though your "cost + S/H" proposition is nice and well in keeping with the project's ideals.
I personally can't help though, except by cheering from the sidelines :-)

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

Posted: Sat Sep 10, 2011 9:13 pm
by liz
We totally don't mind people monetizing their projects. Development's an ecosystem, and we think the world runs on entrepreneurship - go to it, and we'll be really excited to see what you come up with!

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

Posted: Sat Sep 10, 2011 9:16 pm
by DanielSilva
The only problem i see i muxing the gpio since these are usually pretty expensive IC's.

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

Posted: Sat Sep 10, 2011 11:48 pm
by Ben_P
Quote from liz on September 10, 2011, 22:13
We totally don't mind people monetizing their projects. Development's an ecosystem, and we think the world runs on entrepreneurship - go to it, and we'll be really excited to see what you come up with!

It's a fair point about the world running on entrepreneurship, but the main reason for doing this is that I would like to have it. A simple IO dev board that also has the power of this ARM core would be an amazing thing to have, I also appreciate that although I have some ideas and experience in projects like this, this will be the largest undertaking I have taken on, meaning I may have to ask for technical advice on how to do things. As there is a strong possibility I will be asking for (a lot of) help I don't want people to not help because there not getting there slice.

I know I would feel as if I had had my nose put out if some one was making money out of work I had given them for free.

I think this project could benefit a lot of the other projects muted on this forum, certainly having a quick standard way to interface with the GPIO and serial IOs in software seems (to me anyway) the logical way for many of them to work. If the hardware was open it could provide a reference design for the hardware too.

As for the mux being expensive you may be right but it is a pain when you find that you need just one more pin to make you project truly great. I have given it a bit more thought and wondered if another much cheaper MCU could do the job, e.g. A PIC 16F88 as a slave on the SPI bus would give you 4 ADC (although each one would have to be used serially, as there is only one ADC muxed to 4 pins. and a few more pins as well as other features such as PWM which could be used for servos. This is only a half formed idea but I think it has some mileage. I only chose the 16F88 as an example because I have used them many times before (starting when I was 15 I think) and have a few kicking round.

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

Posted: Sun Sep 11, 2011 4:32 am
by iAreNewb
I'd much prefer a simple guide (w/ wiring diagram and what products to buy) instructing on how to hook up to the GPIO safely (electronics wise) and how to set up a (de)mux in order to control more DIPs or receive more inputs. This should be separate of an actual breakout board, since I'd rather not deal with too much soldering and instead just wire it up myself to a mini solderless breadboard.

Also, I think the kernel module should be independent of both of these, considering that many people will probably attempt it, and thus one will probably be finished relatively soon after the (November?) release. There's really no point, then, in taking it upon yourself to do it if you don't want to (though if you do, more power to you -- it's just that you don't have to feel obligated).

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

Posted: Sun Sep 11, 2011 10:32 am
by wallabybob
There is quite a selection of peripherals that could be accessed over the I2C bus: ADCs, temperature sensors, light intensity, pressure sensors, accelerometers etc maybe GPIO.

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

Posted: Sun Sep 11, 2011 10:59 am
by Jason
(1st post..)

I'd like to see SPI, or I guess I2C available.
SPI has the advantage of better quality signals, faster clock rates and the signals are unidirectional (so 3v3 to 5v buffering is simple).
I use both, and have also used I2C multiplexers to give 4 x I2C busses from a single bus.

Lots of hardware for both, if there is enough GPIO, then this can be used as /CS for the SPI based Digital I/O and Analog I/O.
There are some very good 8-input analog input ICs, and 8-bit SPI digital IO is very cheap.

On the subject of drivers... Linux does have built-in support for SPI, but will need to know how to access the hardware..

As a side point, many of the LEGO NXT sensors use I2C... with lots of rugged Light/Ultrasonic/Accel/Gryo modules out there.
Perhaps they could be used (if the correct connector can be found) as a simple and quick way to interface real-world devices to the Pi?

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

Posted: Sun Sep 11, 2011 11:47 am
by obarthelemy
Both SPI and I2C are planned. Exact number of pins TBA, pray to the trace-routing gods ?
more (tentative) info here: http://elinux.org/RaspberryPiB.....re_Details

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

Posted: Sun Sep 11, 2011 12:29 pm
by Warringer
As long as we can get I2C and/or SPI I would be happy.

Not much more needed in the end to do much hardware stuff.

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

Posted: Sun Sep 11, 2011 3:28 pm
by Ben_P
Hi all great to see response.

To answer questions that have been asked above, I thought I might give some brief responses.

The breakout board would be very simple, the principle idea is to produce an easy interface, It looks like the headers are gonna be a pain to use and potentially dangerous for the R-Pi (just in case you short Vdd to an input). The main point would be to produce a simple (physical) interface with a buffer to protect the R-Pi. Possible some form of level shifting. I was thinking this board may easily hooked up to a bread board or strip board for rapid prototyping.

The software should be simple in that it really does very little beyond giving some functions in C to interface with the GPIO and serial IOs and in C++ and python having a class. I don't want to reinvent the wheel so if these functions are already there I will use them, I will also be happy (would prefer) to collaborate on the most general purpose interfaces .

I think adding additional functionality might be a bad idea so will probably drop this off the board, but might draw up some tutorials on how to add these to some more complicated projects.

I'm not sure why you would want to mux the I2C or the SPI bus as I2C offers the facility of up to 112 slaves on each bus (if you need more than this, you probably are beyond the stage of rapid prototyping), maybe if you wanted to run at multiple speeds but again probably beyond the scope of the rapid prototyping stage. SPI can daisy chain so you may have a latency issue if you have many devices but I think a bit extreme for this.

Thanks everyone for the input it's been really useful. I can't wait to get hold of the board and get to work.

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

Posted: Sun Sep 11, 2011 4:08 pm
by hippy
Quote from Ben_P on September 11, 2011, 16:28
The breakout board would be very simple, the principle idea is to produce an easy interface ... The main point would be to produce a simple (physical) interface with a buffer to protect the R-Pi. Possible some form of level shifting.

I'm very interested in interfacing to the GPIO and I'd be most keen on 'KISS' and 'cheap and cheerful', just a break-out board which makes it easier to connect to the R-Pi, something nicer than ribbon cable and fanned-out wires :-)

I'm not sure about buffering or level-shifting but I likely would not need or want it. I don't know what voltage the GPIO operate at but would guess 3V3. That's probably good enough to drive 5V logic and micros and putting 5V in should likely work with just a suitable current limiting resistor if they aren't 5V tolerant to start with - Do the hardware guys and gals have a spec of the GPIO electronics ?

I'd make it a simple self-assembly bare board supplied with headers so it connects but nothing else, designed to put current limiting resistors, pull-ups and pull-downs in place if user required but for anything else I'd say add that to a further board which connects to this interface board. Making it a break-out board with a small prototyping area might not be a bad idea.

If you can bring the R-Pi's GPIO, power and other signals through your board to a set of 0.1" headers you can then plug additional (stacking) boards into that Shield-style, so this would be the bridge between the R-Pi and any number of special purpose application boards. "That would be sweet", I believe is the phrase to use there :-)

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

Posted: Sun Sep 11, 2011 4:26 pm
by rickyjames
As I've noted elsehere, I think ExpressPCB's Miniboard service would be ideal for this purpose - three boards for $51 processed in 24 hours and shipped anywhere in the world, perfectly sized for Rpi at a credit-card sized 3.8 x 2.5 inches, and laid out with free downloadable software from the vendor. A master template file matching the Rpi mounting holes and GPIO header holes could be created and distributed to Rpi tinkerers so we would all have the same starting point.

http://www.expresspcb.com/Expr.....iboard.htm

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

Posted: Sun Sep 11, 2011 4:28 pm
by hippy
Quote from DanielSilva on September 10, 2011, 22:16
The only problem i see i muxing the gpio since these are usually pretty expensive IC's.

Cost isn't usually excessively high and suitable parts are often readily available though it does depend on what you want to interface, how many lines you need. As noted there's always the ability to use additional low-cost micros as 'smart peripherals'.

Although I have 'a lifetime' in such interfacing I'm not familiar with the embedded Linux side of things so I second the desire for some good How To guides, documentation on API's and even how to write drivers for the more adventurous.

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

Posted: Sun Sep 11, 2011 4:38 pm
by hippy
Quote from rickyjames on September 11, 2011, 17:26
three boards for $51

$17 ~= £11, which would be a little expensive to me when I could just solder to the header pins, but others may feel differently. With confidence in the product, enough pre-order commitment, a larger run and much lower cost should be achievable.

What would ultimately be nice is for add-on boards and the like to be purchasable through R-Pi dealers so you can buy everything in one go.

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

Posted: Sun Sep 11, 2011 5:27 pm
by cmduarte
SparkFun has a product that adds IO to Android phones/tablets that looks like it could also be used here. I think it's called xio-xio pronounced yo-yo.

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

Posted: Sun Sep 11, 2011 6:09 pm
by Ben_P
Quote from hippy on September 11, 2011, 17:08

I'm very interested in interfacing to the GPIO and I'd be most keen on 'KISS' and 'cheap and cheerful', just a break-out board which makes it easier to connect to the R-Pi, something nicer than ribbon cable and fanned-out wires :-)

I'm not sure about buffering or level-shifting but I likely would not need or want it. I don't know what voltage the GPIO operate at but would guess 3V3. That's probably good enough to drive 5V logic and micros and putting 5V in should likely work with just a suitable current limiting resistor if they aren't 5V tolerant to start with - Do the hardware guys and gals have a spec of the GPIO electronics ?


From R-Pi Wiki http://elinux.org/RaspberryPiB.....re_Details

There are approximately 16 spare GPIOs, which are brought out to 1.27mm pin-strip. Voltage levels are 3v3. The connector choice is deliberately annoying to connect to directly; there is no over-voltage protection on the board so the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.

We also bring 2x I2C (3v3), I2S and an SPI (3v3) interface out to the same connector. We support one slave interface for I2C and one for SPI.


I want this board for prototyping to give an easy and quick interface for breadboard or strip board and I don't wan to be constantly soldering onto the headers. I also want to protect my and others from accidental damage, so the chips on the board may blow but the R-Pi will be safe.

This board is quickly becoming a lot simpler then initially planned which can only be a good thing. Other boards with extra stuff could either plug into this board or directly to the R-Pi.

I am now imagining a simple board with a header/ribbon cable that connects to the header on the R-Pi. These signals along with the power and ground taken out with the signal pins running though DIP buffers to another header that’s easier to hookup to the proto board.

As for paying £11 pounds for blank boards this seems a huge amount, I could etch them at home for less and I would be willing to wait for a batch processed ones if I'm ordering lots.

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

Posted: Sun Sep 11, 2011 8:02 pm
by Gert van Loo
There are already plans in the raspberry-pi hardware team to do an expansion board. I had a discussion with Eben about that last week but we have come no further then: Yes we probably should make one. So please come up with a list of what you want on it most. If I see what people are missing I would say it needs:
Audio in and out (there is your microphone and CD-audio)
Camera (Difficult choice as Camera connectors are all different, tiny and expensive)

Note that it is not simple to add buffers for GPIO unless you know the signal direction. And yes, there are auto direction sensing buffers out there and we have tried them and we never are going to look at them again.
This is all very early an will only be done if we have some spare time, which at the moment is at a premium.

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

Posted: Mon Sep 12, 2011 1:07 am
by Blars
Wanted, more or less in priority order:
Serial console for headless systems, usable as rs232 port otherwise.
SPI
I2C
Analog inputs, if available. Maybe via optional i2c a/d converter.
Audio I/O. Maybe via I2S.
General input and output pins.
Second SD/uSD slot if it's cheap/easy. Shouldn't be hard via SPI. Avoids bus contention with other USB devices.
Camera
Cheap LCD or oled display.

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

Posted: Mon Sep 12, 2011 6:22 pm
by Ben_P
I would want (in some form of priority order)

I2C
SPI (actually I don't mind which of these two but at least one is the most important thing)
Simple mechanical interface for interfacing with breadboard , and strip board.
Simple digital pins for bit banging (Would be nice to have some protection on this)

According to the wiki this is all on the board already. So I suppose the main thing is a physical interface, as well as a simple way to cope with this in software.

I have been thinking about the bufferd IO and there seems 2 ways to do it. One solutions would be to use tri-state buffers but this would half your IO as each one would require an OE line. The alternative is to have each pin connected to two buffers connected in in inverse parallel. You would not be able to have the Input and output pins connected together as this would create a race condition. You would end up with a different input and output pin thus doubling the your required header count with little benefit but his does not seem to bad. You would also echo your input to the output.

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

Posted: Tue Sep 13, 2011 12:57 pm
by TonyD
After reading the FAQ, it would seem user I/O is coming out to a pair of 1.27mm headers.

"J11, J14: 1.27mm header providing ~16 GPIOs at 3v3, I2C and SPI interfaces and ARM JTAG"

For an expansion board I would trace these out to 2.54mm headers to make it breadboard friendly and add some supply and ground pins to the mix.

Buffered I/O is real pain to implement when you want to mix and match your I/O directions (inputs or outputs) on the fly.

Does any one know if the Digital I/O is 5V tolerant?

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

Posted: Thu Sep 15, 2011 8:43 pm
by Ben_P
I have been doing yet more thinking about how to protect the GPIO. I think I was over complexing it, A reasonable simple solution would be to use a 3v3 zener across the output.

I still have not seen an official response to 5V tolerance, this would be all that would really be required.

However:
From The wikiThe connector choice is deliberately annoying to connect to directly; there is no over-voltage protection on the board so the intention is that people interested in serious interfacing will use an external board with buffers, level conversion and analog I/O rather than soldering directly onto the main board.

So some over-voltage protection would be good, as I said above could probably be solved with a zener and maybe a resistor, at least to make the IO 5V tolerant if it is not. There are some chips about to specifically buffer SPI and I2C, but these would seem even less useful than the GPIO buffers.

Also When I started this thread I mentioned U(S)ART it's in the title. I can't find any reference to it in any of the (admittedly slightly sparse) documentation on this site. Although I have seen it mentioned a few times else where on the forum. I am not worried about having it, if I need it I will sought something else out. Would just like to know

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

Posted: Thu Sep 15, 2011 9:19 pm
by sunny
There is some discussion of similar nature on

R-Pi as a Super Component

that may be useful here ...

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

Posted: Fri Sep 16, 2011 8:21 am
by vorrias
Grate idea to looking for I/O board. That will be very usfull to our R-Pi PLC design we discusing in another thred. Without knowing your efort here I already proposed that And yes one option is to interface directly from R-Pi GIOP, but this will have limited I/O power. (for simple designs may be that will be a solution). But the PLC program will remain the same. Only some I/O tables the designer mast change.
and
..If they really exists must be in a place where easily with a flat cable or any other easy way (acting as a bus) to interface with other I/O boards. With I2C it can connected to a bus topology with other local or remote I2C I/O boards-modules *that is why I2C may be it is better to have a separate connector). A piggy back interface board may be is a cheep alternative in making extremely cheap controllers like the watering or some kitchen controllers..
So you are on the right track here. I love to see R-Pi PLC project to communicate with this I/O design.
I will keep an eye to this thread and try to help with my knowledge as I can.

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

Posted: Fri Sep 16, 2011 6:30 pm
by Ben_P
I have looked at the PLC controller (actualhave been lurking there since it came about). The thread seems to have much bigger ambitions than (at least my idea) what is intended from this thread. There is a lot of cross over between the 2 threads, I think the desighn goal is ultimatly diffrent. I don't see this as somthing you would ever use long term, but somthing that will give an idea motion quickly thus the call to have it easyly interfaced with breadboard and not on a flat cable as you suggested.

I have also commented on the R-Pi as super component page it would be great to get all these projects to comunicate and work out what the common goals are so we can pool our efforts.