barnaby
Posts: 76
Joined: Fri Sep 16, 2011 6:32 pm
Contact: Website

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

Fri Sep 16, 2011 7:48 pm

Some kind of hardware interface to 'real circuits' that's fairly easy to write for would be utterly marvellous. I'm a software and hardware person in equal measures (I.e. Not really much good at either of them ;)), and this would be a killer replacement for over-priced circuit -> internet modules, for example.

Thanks,
Barnaby

Blars
Posts: 88
Joined: Sun Aug 28, 2011 3:22 am
Contact: Website

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

Sat Sep 17, 2011 12:38 pm

It looks like it would be straitforward to make a board that remaps some of the R-pi pins to an Olimex compatable UEXT connector. This would give you hardware access to a variety of boards from Olimex, but drivers would need to be written.

stefan
Posts: 7
Joined: Sat Sep 24, 2011 11:38 am

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

Sat Sep 24, 2011 6:18 pm

I've been thinking about the GPIO breakout board for a bit and I wanted to contribute my thoughts to this thread.

If I were trying to make a breakout as "transparent" as possible, as multi-purpose as possible and as simple as possible, I think I would focus on simply bringing signals in and out in as protected a manner as I could. Although the simple 3v3 Zener crowbar protection suggested by Ben_P would work, it's a big of a cludge as you'll saturate the Zener each time a 5v signal is applied, slowing down recovery times and probably making rise / fall times asymmetric to boot. Although this won't be a problem for most people it would violate my "transparency" criterion and could cause hard to troubleshoot issues down the line. The way I see it, there are two possible approaches.

The simple, cheap-and-cheerful method would be to add Schottky clamps between each I/O pin and the two power rails, along with a series resistor of ~100r. Although this is technically bad form (analogue components in a digital signal path) I think it would provide the greatest protection for the smallest cost and least waveform distortion. The 3v3 on the R-Pi should indeed be enough to drive most 5V logic in the outside world (depending on what voltage it actually achieves as a logic high) and the 100r limits clamp current. I've used this method successfully before in a very similar situation for i2c comms. You could add a potential divider (to drop down the 5V) at the outside world end too with perhaps a jumper to disconnect the bottom end resistor for when you wanted to work with 3v3 logic. This would leave the Schottky clamps as just fault protection and speed up rise / fall times further.

The more complex and expensive solution, but providing an entirely digital signal path, would be to use a bidirectional tristated voltage shifting buffer. You could quickly get around the problem of needing to control the OE pins for each buffer to set the direction by using an i2c or spi GPIO expander chip on one of the busses provided by the R-Pi to provide the necessary signalling and then write a small library that wraps up setting the direction of a pin both on the SoC and via the i2c GPIO. This may have advantages for higher speed comms, but I know that the cheaper solution works reliably with clocks of ~400kHz.

I'd be happy to work on a PCB layout if people wanted - it would be dead simple, I could test its performance and then R-Pi could perhaps provide it as an accessory? I'm pretty sure you could produce this for around £4 cost, based on past experience and production runs of a few hundred at a time. The first hurdle is, of course, getting finalised pinout data for the production boards. Does anyone know if and when this might be available?

Just my two cents.

hippy
Posts: 7442
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

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

Sat Sep 24, 2011 7:44 pm

I think the fundamental issue is two conflicting markets; those who know what they are doing and are happy with an easier way of getting the signals off-board and see bi-directional buffers as unnecessary and extra cost, and those who want to have best protected GPIO's they can.

I'm in the first camp but, if you designed the buffered board, those like me can buy a board without components, jumper-wire the GPIO signals to board outputs and job done; one board suits both camps. I would suggest Schottky clamps plus 100R and bi-directional buffers as the most flexible option; fit only the components one wants to use.

stefan
Posts: 7
Joined: Sat Sep 24, 2011 11:38 am

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

Sat Sep 24, 2011 8:24 pm

That's an interesting idea. The downside is that the buffers tend to be SMT and hard to source in low volumes. Because of this, the people who might need them most would probably never fit them. I suppose you could produce different finished variants of the same base PCB, but I'm not sure how much actual demand there would be for a properly buffered version if the simple option works 99% of the time.

So I guess I'd be interested to hear what people would actually want from a simple board. Also, I don't have any experience with the buffer types I'm considering, although I'd be confident enough designing with them. Does anyone have any specific buffer IC recommendations? The ones I have been looking at are from this series: http://goo.gl/5Md59.

bill
Posts: 15
Joined: Wed Aug 03, 2011 7:07 pm

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

Mon Sep 26, 2011 1:15 am

Does anybody have any experience with the T.I. TXB0108? At a casual glance it certainly looks like a solution for the buffering problem, if just a bit pricey.

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)

Mon Sep 26, 2011 7:18 am

No we have not tried that part, but we have tried auto sensing buffers from several manufacturer and found them all very disappointing. For a robust design I would take a bi-directional buffer and let the user set the direction (solder jumper or real jumper).

stefan
Posts: 7
Joined: Sat Sep 24, 2011 11:38 am

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

Mon Sep 26, 2011 9:47 am

I agree with Gert in that auto-sensing buffers are really not the solution - you're paying for functionality that is simply not well implemented. However, as a more flexible version of what Gert suggests, if you were to use fully digital buffers I wouldn't control their direction with solder blobs, but with an i2c GPIO expander, so that their direction could be flipped dynamically.

That said, I still think that the best solution would be the analogue method - I'm doing a couple of experiments to optimise its speed today. Can anyone from r-pi comment on (a) whether we should be spending any time on this, or if they have it in hand along with (b) when we might get a finalised board mechanical drawing / pinout for the GPIO connectors?

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

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

Mon Sep 26, 2011 3:16 pm

Quote from bill on September 26, 2011, 02:15
Does anybody have any experience with the T.I. TXB0108? At a casual glance it certainly looks like a solution for the buffering problem, if just a bit pricey.

I did some experiments with the TXB0106. They're easy to work with and they did what I expected them to do (1.8V to 5.0V translation).

That said, I only have a hobbyist level of understanding about digital electronics in general, so I wouldn't know *how* they could disappoint. Ignorance is bliss, I guess :)

I'll probably be stubborn, and try them on the Raspberry GPIO's anyway. I still have some left. Is there something specific I should look out for? (Read: I want to be disappointed too, it'll be a great learning experience).
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")
http://www.onandoffables.com

stefan
Posts: 7
Joined: Sat Sep 24, 2011 11:38 am

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

Mon Sep 26, 2011 4:32 pm

Go for it Panik - as much as you would like to be disappointed, I'd like to be wrong! My best test for this would be to set it up on an I2C connection and a 1-wire connection. You could trial this using a couple of 5V sensors (say accelerometer, ADC or similar - one I2C and one 1-wire). Use the TXB0108 to connect them to a 3V3 microcontroller and try to read from them. If all goes well for both setups, I'd say you have a winner. If not, take a look at the waveforms on both sides of the TXB0108 and see if they match up the way you feel they should - if not, therein lies the problem. Let us know your results!

To answer your question as to how they might disappoint, I worked on a project four years back (not with the same converter) and we found that our I2C peripherals would get stuck waiting for acknowledgements - it seemed that the direction reversal detection was just not fast enough for the devices we were using. We ended up using the simple analogue protection I've already mentioned and bingo - no problems. YMMV!

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

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

Mon Sep 26, 2011 6:43 pm

Thanks Stefan, that would be a good test. I've used the TXB0106 for UART and bitbanging shift registers. That worked well, since there wasn't a lot that could go wrong.

However, The TXB-series will not work with I2C and 1-wire. I didn't think about that when I wrote my previous post. Sorry about that. For open drain applications, TI has the TXS series. Sadly, I don't have those in my toolbox. Maybe I'll order a couple.

I'm excited to find out what you Pros come up with, though!
Microcontroller addon boards and software for Raspberry Pi A+/B+/Pi2:
- ARMinARM: ARM Cortex-M3 (STM32)
- AVRPi: ATmega32U4 & ATmega328 ("Arduino")
http://www.onandoffables.com

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)

Mon Sep 26, 2011 7:20 pm

I think they may work well if the direction seldom switches or very slowly. We could not get them working for fast bi-directional buses.

stefan
Posts: 7
Joined: Sat Sep 24, 2011 11:38 am

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

Tue Sep 27, 2011 5:19 pm

Gert, do you know if the mechanical and electrical details of the "final" board layout (enough to draw up addon boards) will be released ahead of the first boards being put on sale?

Also, having read the wiki and various posts, it seems that there is no overvoltage protection on the r-pi board. There's nothing about whether the SoC itself has 5v tolerant inputs though (in which case we can simplify protection circuits significantly). Does anyone have a definitive answer to this? Whilst I'm poking in that direction, what do the GPIO ports look like electrically? What is their maximum output current, input/output capacitance, Vih, Voh, Vil, Vol?

I know we're a while away from having the boards to play with, but if we can get this kind of info in advance, we can have robust and well cost engineered breakout boards available on release day. If we can model the digital outputs in an analogue manner, we can more successfully protect them using more cost effective analogue methods.

Ben_P
Posts: 16
Joined: Sat Sep 10, 2011 5:10 pm

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

Wed Sep 28, 2011 7:59 pm

Stefan i really like your shotky clamp idea. I would like to have my brothers play around with the GPIO of the R-Pi and although I will not attach a 12V source to the GPIO or try to draw an amp out of them, but they might.

stefan
Posts: 7
Joined: Sat Sep 24, 2011 11:38 am

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

Wed Sep 28, 2011 8:24 pm

With series resistors along with the Schottky clamps, you should protect the GPIO from both voltage and current - if your brothers tried 12V, the resistors would suck it up and the diodes would protect the input. If they tried 120V, the resistors would blow. An important part of the design is to ensure the diodes can take far more current than the resistors. That way, if something silly happens, the resistors die before the diodes, disconnecting the source of danger and protecting the r-pi.

I wish I had young brothers to give the r-pi to - I have to sadly admit I'm more in the hacker camp and at 27 am no longer really counted as a boy by anyone other than my mother!

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

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

Thu Sep 29, 2011 12:04 am

My first post - this is a project dear to my heart.

I'd like a simple board with headers/pins on a nice breadboard-friendly 0.1" pitch. I'm happy with having 100R + Schottky diodes clamping to ground and 3V3.

I am also very happy with SMD. I'd prefer it. Paul Gardiner, a D&T teacher, and the D&T Electronics coordinator for Coventry & Warwick uses the "toaster-oven technique" with his 11yo, and upwards, school children. It is quicker for a class to make boards using solder paste than soldering through-hole parts, and the children get higher success rates than through-hole technology. I could imagine that some of his school children could successfully tackle making this board before they are old enough to do GCSEs.

When the production board physical layout is confirmed, I could try to find time to do a PCB if nobody else wants to do SMD. With a bit of luck, an SMD board might be single sided, which would make it feasible for kids to make the PCB themselves in school (I know double sided is possible, but it demands much more care).

My young college Stephen Pithouse has become pretty good at making PCBs using the schools CNC milling machine to engrave boards (some of his work, with some of his own PCBs at http://stephenpithouse.webs.co.....ojects.htm and )

The 1.27mm socket pitch might be a bit too high for that engraving technique (we'd need to do an experiment or two), but using a CNC mill only for drilling would save a lot of time, and get a consistent result for DIY boards.

If the boards were 100mm x 80mm (credit card is about 86 × 54 mm), PCBCart, who are pretty good quality, quote $49.70 tooling and $2.03 each PCB 100-off, $1.25 500-off.

We could organise a 'SolderFest' at HackSpaces to teach folks how to make SMD boards (Paul has a nifty little practice piece, which seems to be fool-proof, would cost just over £1, and you'd get flashing LEDs:-). Once folks had a practice and some success then they'd likely feel comfy making the breakout board. We are planning SMD workshops at fizzPop in Birmingham (UK), and I can imagine this might interest folks as a follow-up.

stefan
Posts: 7
Joined: Sat Sep 24, 2011 11:38 am

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

Thu Sep 29, 2011 12:44 pm

Hi gbulmer

So glad to hear kids doing SMD work in school and getting great results - really encouraging! In my head I was imagining designing for SMD for convenience and cost. Not sure I can see how I would route single sided, but that said I haven't tried yet!

Another thing to perhaps brainstorm together would be the way we might hope to physically design the breakout for ease of use. With a SMD 1.27mm socket and a TH 2.54mm header on a single sided board we can pass the signal through easily enough. How would this work with your breadboard idea though? Would you want a two row header split by 7.62mm to span the centre gap on a breadboard like a DIP package? Would you want it to protrude on a tab from one side of the R-pi so that access around the breadboard is easier? How would other people use their breakout?

EDIT:

Some decent value 1.27mm dual row SMT headers for reference - does anyone know of even better value ones? link

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

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

Thu Sep 29, 2011 4:28 pm

stefan, thank you for your responses
Quote from stefan on September 29, 2011, 13:44
So glad to hear kids doing SMD work in school and getting great results - really encouraging! In my head I was imagining designing for SMD for convenience and cost. Not sure I can see how I would route single sided, but that said I haven't tried yet!

I am thinking the first thing to try is a "no-components" board, i.e only plugs, sockets and headers with no resistors or Schottky diode protection. That might be enough for experts to get started.

Paul Gardiner uses 1206 size components, the extra bit of size makes it easier. It also means there is enough clearance to route a track underneath them (though that makes DIY boards, with no solder mask, harder to solder).

I am thinking a little 'stand' to support anything sticking down under the board would enable kids to make the whole board with solder paste. Something like Meccano U-shaped beams might work.

Another thing to perhaps brainstorm together would be the way we might hope to physically design the breakout for ease of use. With a SMD 1.27mm socket and a TH 2.54mm header on a single sided board we can pass the signal through easily enough.
I was initially thinking, maybe SMD 1.27mm plug on the breakout, and use a very short ribbon cable.

I am worried about noise, so another thought is to get ground between the signals using two PCBs:
1. Plugs straight into R-Pi (with a 1.27mm plug), and then it has a socket which carries the signals to the actual breakout via a less noisy cable (probably still 1.27mm, but 2x connections).
2. Breakout board which gets the less-noisy cable inserted, and expands the live signals to DIL breadboard friendly headers.

Not worth trying until we know noise is a problem :D

Ideally the production R-Pi would have the socket near an edge to minimise cable length.

How would this work with your breadboard idea though? Would you want a two row header split by 7.62mm to span the centre gap on a breadboard like a DIP package?
Exactly.
It could be 0.3", or 0.6", and could fit straight into DIL IC sockets.

If everything worked perfectly, it might be nothing more than an IDC DIL connector
So the breakout PCB is actually at the R-Pi socket end, and the ribbon cable connects from that into a breadboard, veroboard or PCB.

Would you want it to protrude on a tab from one side of the R-pi so that access around the breadboard is easier? How would other people use their breakout?
I don't know, I'd need to experiment with it.
I certainly think the R-Pi socket needs to be close to the edge.

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

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

Sun Oct 02, 2011 8:38 am

As long as there is a SPI port on the PI ('SPI-PI') then we're good to go.
You can get almost any device in SPI, I have used ADC, DAC, GPIO and digipots in SPI.
Only potential trouble with SPI that they tend to be surface mount. Would be nice to start collecting links to easy to use DIL chips.
Is the PI's SPI properly buffered?

I am no expert but I have seen the diode clamp with series resistor used a lot.
With regard to voltage levels, isn't most kit (& especially SPI) 3.3V these days anyway? If you really wanted to drive TTL then the 4050 should do it.

Bacan
Posts: 347
Joined: Sun Sep 25, 2011 10:03 pm

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

Sun Oct 02, 2011 3:18 pm

What about using Opto-isolators to bridge between the R-Pi GPIO signals and the User Add-on area.

Would they give voltage conversion and protect from ESD and voltage spikes?

Scribe
Posts: 98
Joined: Wed Sep 28, 2011 12:00 pm
Contact: Website

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

Sun Oct 02, 2011 3:34 pm

As opposed to opto, this is a good new product range:

http://uk.mouser.com/search/re.....=107867441

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

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

Sun Oct 02, 2011 4:53 pm

Think that this approach will get quickly get outside my pocket money! £1.56 is a lot for single channel isolation.
As far as I am aware I/O is usually protected with diodes to both rails and resistor as posted.
Cheap as chips (srry) when surface mounted and good enough.
The evaluation/development boards I have used have only the microcontroller's protection.
The board sits on my desk, is exposed to coffee & crumbs. I try and get the LED to light and short the GPIO to the 12V PSU when I hang probes on to see what is (or is not) happening.
I would say that that is the working scenario. I would hope to buy that board for peanuts (pound or two?)
The times that I have seen boards die is when I pass the software/board on to support hardware development. Usually the spikes from the custom PSU is what takes them out.

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

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

Sun Oct 02, 2011 6:06 pm

I have posted this suggestion elsewhere, but please let me repeat ...

Use the R-Pi SPI to talk to an ATmega (e.g. an Arduino chip). They are pretty cheap, at £1.72+VAT each, 2-off from RS components.

The ATmega is programmed over SPI+RESET (so use one of the GPIO's to drive that).
It can also act as an SPI slave, so program in some code which, when run, will cause it to act as an SPI slave to the R-Pi, doing whatever you like.

They can run at 3.3V, using only the internal oscillator, so it'd only need a few capacitors to decouple its power supply and a resistor on RESET. (I might build a power supply for it, as I often use an Arduino as a power supply for external electronics)
That gives 17 I/O pins, 6ADC channels, 3 timers with 5PWM (one lost to SPI), a USART, I2C and a bunch of other capabilities.

You also have the Arduino IDE examples and libraries, to get people going.
There are also upload programs, so much of the work to program it has been done.
There is also Firmata which enables host programs to talk to an Arduino (or in this case, a naked ATmega168) and use its peripherals. Hack that so that it listens to SPI instead of USB/serial, and simple experiments don't need any extra software on the Atmega.

Let the ATmega take the hit if you're worried about pin protection. I've run Arduino workshops for a couple of hundred people, and only one has died. I believe the two kids worked hard to kill it, so I believe they are quite robust.

Please add resistors and Schottky diodes if that makes you feel happier, but for non-abusive users, I agree with bradburts, microcontrollers are pretty robust. IMHO they have to be, they are stuck into everything, and the protection can't be more expensive than a 50p chip, or a company would make a 60p chip with the protection built in!-)

Lakes
Posts: 267
Joined: Wed Aug 24, 2011 2:17 pm

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

Sun Oct 02, 2011 8:31 pm

A bit off topic perhaps, but do you have any details (links) for the Arduino Workshops?

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

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

Sun Oct 02, 2011 9:09 pm

Quote from Lakes on October 2, 2011, 21:31
A bit off topic perhaps, but do you have any details (links) for the Arduino Workshops?

My Arduino workshops?
I build them to suit the attendees.
Some of my public adult workshops are on line at:
http://www.fizzpop.org.uk/even.....-howduino/
http://wiki.2010.dev8d.org/w/B.....Workshop_A
http://wiki.2011.dev8d.org/w/Session-WK5
The DD&T conference and D&T workshop were not public, but I mention the conference here Arduino in Schools at DD&T Conference
I don't know where our public Birmingham ScienceFest "Build a Robot in a Day" has gone (which I did in collaboration with BCU)
The ones for school children are not published.

Return to “Other projects”