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

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

Wed Oct 12, 2011 4:04 pm

Quote from hippy on October 12, 2011, 10:20
Quote from n1ywb on October 12, 2011, 04:01
This is a thread about a carrier board, we're talking about putting a uart on a carrier board, I think.

My understanding is the original intent was just a breakout board, getting the signals from the 0.05" headers of the R-Pi to something more convenient hobbyists and others can use, with the possible addition of some lightweight circuitry to provide electrical protection for the R-Pi.

Additional functionality could be added to the board but I think it was intended to carry existing R-Pi UART signals rather than as a means to provide UART.
Yes. I agree.

I believe there were several proposals.

1. Bring all of the R-Pi I/O on to a breakout connection.
There were several suggestions.
I suggested just using a flat cable IDC connector to 0.1"pitch Dual-In-Line connector. So the R-Pi GPIO and interfaces would look like an N-pin IC. The adapter could be very small converting from the R-Pi header to something that could plug into a breadboard or 0.1" pitch matrix board.

Then there are proposals to protect the R-Pi electrical signals with current limiting resistor , and maybe diodes to clamp signals to the R-Pi power rails.

2. I suggested that it would be nice to have ADC, PWM, timers etc. and I proposed using an ATmega to give low-cost ADC, PWM, timers and real-time response. (£3.44 for two ATmega168's).

Use an R-Pi SPI+1 GPIO to build a 4 wire interface to an ATmega.
Use an ATmega which can be both programmed over SPI+RESET (R-Pi GPIO would be driving the ATmega RESET, which puts it into programming mode), and also do communications over SPI. The ATmega could be an SPI master or slave for communications with the R-Pi, so one 6-wire cable would do both jobs without plugging and re-plugging cables.
For a minimum component 'adapter', using an ATmega running on its internal clock, It would deliver or consume a byte every 2microseconds or slower.

I so far assume, but can't find any datasheets to confirm, that the R-Pi SoC has DMA controllers which could send or receive data over SPI without necessarily interrupting the R-Pi processor for each byte.

There were other proposals which would use the R-Pi USART to communicate with low-cost microcontrollers as alternative ways to get ADC, PWM, etc. and hence the comment about that not being available on productions R-Pi.

All the other R-Pi GPIO and interfaces would still be available. So it would be "Simples"

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

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

Wed Oct 12, 2011 4:27 pm

Quote from bradburts on October 12, 2011, 10:48
That would be the best approach. We won't get far salivating over all the different I/O options we would like to play with!
We discussed series resistor & diodes to each rail. Is there a hardware engineer in the house who can confirm?

I am not a qualified hardware engineer (no degree in Electronic Engineering), but I've used the technique of current limiting resistor (most important part) and either two low-forward voltage (Schottky) diodes to ground and power or Zener diodes, on commercial electronics.

The resistor must be between the outside world and the diodes. Stefan and hippy explained this earlier in this thread.

It is also worth mentioning that lots of modern microcontrollers include some diode clamping on the I/O's, and hence a resistor on a ATmega/PIC/... would likely be fine.

I'd use schottky diodes to clamp to power rails. I think it is simpler than Zeners. It is also reasonably cheap (about 5p/signal in small quantity, e.g. for a BAT54S dual diode and a resistor, if you have a toaster oven, and do SMD)

An annoyance is when using Analogue to Digital Converters (ADC) with a current limiting resistor in series with the input; an external analogue signal can never reach ground or Vcc.

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

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

Wed Oct 12, 2011 9:43 pm

The Atmega solution (or whatever micro) will follow from the simple protection breadboard.
What value resistor should we be using?
Plus it would help to have a circuit & suggested inline parts posted so we can get started safely as soon as possible. Someone (probably me) will get the diodes the wrong way around else.

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

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

Wed Oct 12, 2011 11:38 pm

Quote from bradburts on October 12, 2011, 22:43
The Atmega solution (or whatever micro) will follow from the simple protection breadboard.
What value resistor should we be using?
Plus it would help to have a circuit & suggested inline parts posted so we can get started safely as soon as possible. Someone (probably me) will get the diodes the wrong way around else.


I'm a bit cautious, so I'd look at the datasheet for the SoC, and see how much current a pin could source or sink, and calculate the resistor from Ohms law R = V/I
and that would be a lower bound.

So for an Arduino, ATmega168, the maximum current from a pin is 40mA (0.04A), and the voltage is 5V, so R = 5/0.04 = 125ohm, and the next preferred value from the E24 (5% tolerance) is 130ohm. So you should be able to leave that pin shorted 'all day' without permanent damage.

That would be a minimum 'safe' value for a 1 pin short to power or ground at 5V.

It turns out that a bunch of pins on an ATmega168 can't all source or sink 40mA each simultaneously, and I can imagine the R-Pi processor is the same. The maximum current for the entire ATmega168 chip is 200mA for the processor and all the pins. The datasheet says the core processor consumes about 12mA at 8MHz. So if you were pessimistic, and wanted to protect an ATmega from all I/O pins shorted to ground or 5V, i.e. about 20 pins, you might limit the current to less than 10mA (0.01A) per pin, which is R = 5/0.01 = 500ohm, nearest E24 preffered value is 510ohm.

So, depending on how extensive a short you would like to protect from, you might choose a value in between those.

Folks I know use 220ohm to 270ohm because that restricts a short to around 20mA, and you'd have to be a bit of a numpty to keep shorting pin after pin. One teaches undergraduates, and says in more than 10years, he hasn't had a problem with students accidentally damaging things with that sort of resistor value.

The other thing to consider is the voltage that pins might get shorted to. If it is all 5V logic, that is fine but you might be using a significantly higher voltage, and so you might want to calculate the current flowing through the clamping diodes and resistor. The BAT54S parts can handle 0.2A continuous, i.e. about 10x the ATmega pin (for a multi-pin short). The voltage would have to be well over 40V before the current flowing through a 220ohm resistor would start to become a problem for the diode, and the resistor would have failed well before the diodes would fail.

I am told that anything over 36V in the classroom is a problem anyway. So there are logical 'extreme' values depending on what you would like to do.

So if we knew the current the processor's GPIO and interfaces could source or sink, we would work out the value. 270ohm is probably a safe start, and resistors are under 1p, so we can afford to iterate the design :-)

The BAT54S is two diodes in a single package, and it is a 'SOT-23' package (http://www.rapidonline.com/pdf.....7-2914.pdf), which is asymmetric, so it is hard to get around the wrong way.
HTH

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

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

Thu Oct 13, 2011 11:04 am

Brilliant answer. Gives us numpties the means to rig something up while we wait.
Any chance of the circuit diagram? I could then wire a breadboard ready for when I finally get my RPi!
Think I will choose resistors for 5mA. Won't be less than that and that should be OK for first experiments.
As you say, easy to change a resistor when values known.

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

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

Thu Oct 13, 2011 12:58 pm

A few comments:

*) Input protection diodes are not super effective in most cases. If the fault currents are high enough that you need external diodes above and beyond those on the chip, then you are most likely in trouble in any case. This is because the current from, say, a few I/O ports connected directly to a 12V supply, will get dumped directly into the 3.3V supply rail. If the fault current is higher than the supply current to the whole circuit, very common with modern low power MCUs, then the rail voltage will drastically increase, frying the whole thing from over-voltage.

The input protection diodes work well against static electricity, though. The energy from such a discharge is frequently not high enough that it will cause the supply rail voltage to jump, as it takes time to charge up the supply rail decoupling capacitors.

*) Any A/D inputs intended to be connected to breadboards and similar oddball setups, ought to have at least a mild noise decoupling circuit added. A simple RC filter placed as close as possible to the ADC input and analog ground pins will serve well in many cases. As mentioned earlier in the thread, then - depending on the particular ADC - this may cause the apparent input voltage to be a tiny bit lower than expected. However this effect is linear in the input voltage, so can be compensated with a bit more gain elsewhere in the circuit. In most cases in the class-room this effect can be completely ignored, and the stable A/D values are much more valuable here.

*) Anyone perhaps thinking about adding a 24 bit audio codec to their I/O expander board, could do worse than reading up a bit on proper board layout and the required analog input anti-aliasing filtering. If these issues are not considered, then a large number of bits of input resolution is in all likelihood completely wasted. You really do need an external, op-amp based analog anti-aliasing filter to protect against noise, even though this will frequently limit your sampling rate to a fixed value.

Frank.

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

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

Sat Oct 15, 2011 5:15 pm

Quote from gbulmer on October 13, 2011, 00:38
I'm a bit cautious, so I'd look at the datasheet for the SoC, and see how much current a pin could source or sink, and calculate the resistor from Ohms law R = V/I
and that would be a lower bound.

So for an Arduino, ATmega168, the maximum current from a pin is 40mA (0.04A), and the voltage is 5V, so R = 5/0.04 = 125ohm, and the next preferred value from the E24 (5% tolerance) is 130ohm. So you should be able to leave that pin shorted 'all day' without permanent damage.

That would be a minimum 'safe' value for a 1 pin short to power or ground at 5V.

HTH

I am also very cautious, partially because I hope to use the R-Pi to get my brothers doing simple programing and electronics, so I almost expect them to short out the Pi

In the specs of the Pi there is comment that the electronic IOs will be 3V3 with no over voltage protection. Although I have not seen any I limit 40mA is probably a good guess.

As there is no OVP I would still like the shotky clamps.

There also seems to be a movement off topic on here the thread was started to make an easy interface board to access the R-Pi electronic signal. With possible some safety and maybe some extra functionality such as ADC. this could be done by putting an MCU on any of the serial interfaces

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

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

Sat Oct 15, 2011 6:29 pm

Quote from Ben_P on October 15, 2011, 18:15
Quote from gbulmer on October 13, 2011, 00:38
I'm a bit cautious, so I'd look at the datasheet for the SoC, and see how much current a pin could source or sink, and calculate the resistor from Ohms law R = V/I
and that would be a lower bound.
...


I am also very cautious, partially because I hope to use the R-Pi to get my brothers doing simple programing and electronics, so I almost expect them to short out the Pi

In the specs of the Pi there is comment that the electronic IOs will be 3V3 with no over voltage protection. Although I have not seen any I limit 40mA is probably a good guess.

As there is no OVP I would still like the shotky clamps.

There also seems to be a movement off topic on here the thread was started to make an easy interface board to access the R-Pi electronic signal. With possible some safety and maybe some extra functionality such as ADC. this could be done by putting an MCU on any of the serial interfaces

Yes, I like the idea of a seperate MCU. I suggested an ATmega to get ADC, PWM and some safety (a post at October 2, 2011, 19:06). I suggested using SPI because:
1. An ATmega can be both programmed and communicated with over SPI without changing cables, and would need only 4 signals (SPI+RESET). Also an ordinary 6-pin ribbon cable would do the job.
2. There has been a suggestion that the serial interface might disappear from the R-Pi.
3. Two ATmega-based interfaces could be under £5 (£1.72+VAT for ATmega168 at RS, two-off)

I haven't seen the spec's for the R-Pi SoC, so I am assuming 40mA (which I took from an Atmel ATmega datasheet to explain the calculations) may be a bit high.

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

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

Sat Oct 15, 2011 6:46 pm

Quote from WizardOfOZ on October 13, 2011, 13:58
A few comments:

*) Input protection diodes are not super effective in most cases. If the fault currents are high enough that you need external diodes above and beyond those on the chip, then you are most likely in trouble in any case. This is because the current from, say, a few I/O ports connected directly to a 12V supply, will get dumped directly into the 3.3V supply rail. If the fault current is higher than the supply current to the whole circuit, very common with modern low power MCUs, then the rail voltage will drastically increase, frying the whole thing from over-voltage.
I agree most MCU's have some form of diode protection on chip, but I haven't seen any datasheets for the R-Pi SoC, so I am being a bit conservative.
I have read a datasheet (more than a year ago, really can't remember what) which was specifying the on-chip diodes are anti-static protection only, with maybe 1mA-ish current protection.

The aim is to prevent I/O ports being connected directly to a 12V supply by using resistors before the clamp-diodes. I agree the current will be dumped into the power rail, which is its own problem. If folks go with the suggestion of using a separate cheap MCU, it could have its own, over specified power supply, for maybe 80p.

We are likely talking about protecting a signal pin from connection to a 5V rail (a likely other voltage), and a voltage drop of 1.7V across, say, 270ohm shouldn't dump a dangerous current into the 3.3V rail.

The input protection diodes work well against static electricity, though. The energy from such a discharge is frequently not high enough that it will cause the supply rail voltage to jump, as it takes time to charge up the supply rail decoupling capacitors.
Yes, if mentioned, that is what the datasheets explain the on-chip diodes are for. Input impedance for CMOS is huge, and static could easily destroy it otherwise.

*) Any A/D inputs intended to be connected to breadboards and similar oddball setups, ought to have at least a mild noise decoupling circuit added. A simple RC filter placed as close as possible to the ADC input and analog ground pins will serve well in many cases. As mentioned earlier in the thread, then - depending on the particular ADC - this may cause the apparent input voltage to be a tiny bit lower than expected. However this effect is linear in the input voltage, so can be compensated with a bit more gain elsewhere in the circuit. In most cases in the class-room this effect can be completely ignored, and the stable A/D values are much more valuable here.
The input voltage has its range compressed by the input protection resistor, not just lower at the high-end, but higher at the low end.

I agree an RC filter is extremely useful on ADC inputs to remove noise and higher frequency components which will otherwise cause signal aliases .

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

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

Sat Oct 15, 2011 8:57 pm

I would like to use the RPI to get my sons involved in electronics & software.
If they don't short something then I bet I will.

A great first step would be to get a basic protection circuit diagram published with maplin available parts and some explanation such that we can change resistors when currents are known.
There has been some great & helpful information posted but we lack a circuit diagram and parts list.
Once we have a simple diode clamp circuit diagram then many may add a DIL socketed micro etc.
The circuits for micros already exist in 101 places so they will be easy to find. The micro makes sense as a final solution but I would hate to wait the extra weeks/months for it.
In the early weeks/months, before we can buy protection boards, I would like to be able to support development. Having that basic protection circuit laid out for numpties like me, would help a load!
I could then hit the ground running. I could support software & I/O driver development and/or help write a wiki on how to configure existing drivers, more or less from day one.
Without a protection circuit blue print I would not risking killing what is likely to be a hard to come by item, I would have to wait until the proper protection boards become available.
Now if I can buy a protection board in a few weeks then fine, otherwise plz someone publish a basic digital I/O protection circuit with maplin available parts!
I really would like lights on on day one!

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

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

Sat Oct 15, 2011 9:42 pm

There can be no schematic of such a board without the detailed hardware specifications for the Raspi board and the BC SoC. Those have not yet been made public by the hardworking Raspi team for reasons detailed elsewhere.

Protection circuits made 'blindfolded', meaning without detailed knowledge of the exact circuit needing protection, are generally worse than useless.

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

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

Sat Oct 15, 2011 11:34 pm

I think that this is a question of degrees rather than absolutes.
There seemed to be a lot of commonality in protection circuits when I worked with embedded software, unfortunately I am in 'pure' software now & cannot check details.
I would be happy to have a simple generic circuits for input & output protection to start with.
Caveat emporium of course.
I have learnt a lot following this post, e.g. that protection may be limited by CPU power usage.
I don't see a reason why I cannot have some protection though. Its just a clamp.
I am guessing that even a half backed protection scheme will see me good until proper kit is available. So long as the diodes are the right way round!
& after all the RPi is going to be shipped with unprotected I/O pins..........
Hope someone can fill in the missing detail.

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

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

Sun Oct 16, 2011 1:11 pm

There seems to be some confusion on what is being added or is required and there's a potential problem in that anyway as there are multiple protections required -

1) Output short protection - Each GPIO pin will have a maximum sink and a maximum source current and those cannot be exceeded ( they are often equal but can differ ). A resistor will limit current to below those levels when the output is shorted to 0V commonly but also potentially 5V or other voltages.

2) Port output protection - As each GPIO will have its own sink and source ratings then so too will the entire port or collection of GPIO pins. Using the minimum resistance value to protect a single GPIO pin in a short situation may not protect the pins if there are multiple GPIO shorts.

3) Input pin protection - each input pin, and any ESD or OVP clamping diodes, will have a maximum injection current limit which must not be exceeded when driven by less than 0V or greater than 3V3. Additionally if there are no clamping diodes these will have to be added externally.

4) Port input protection - As with output port protection there may be a combined injection current rating which must not be exceeded.

For output pins it's often desirable to have the lowest resistance possible ( particularly to drive LED's directly but not usually an issue driving other chip inputs ), but for input pins it's desirable to have the highest resistance possible. Additionally resistances may need to be higher to protect the ports and pins collectively rather than individual pins. For some signals (open-drain I2C or 1-Wire for example ) the protection added for a general purpose input or output may not be suitable, and we may not know exactly how such a pin would be used so this can mean things are at odds with each other in a generic protection circuit - hence my desire for a simple breakout board so users can use whatever they want and/or need.

As mentioned earlier there is a range of people this GPIO add-on seems to be aiming towards, from the electronic experts who simply want a break-out board, R-Pi signals unprotected, and can deal with that and any failures they incur, to the electronic novices who want to be protected from (nearly) all that they could possibly get wrong. The solutions for each will be very different.

The real problem is that, in moving away from unprotected to protected signals is that it all depends on what the board does and what protection levels it offers and that depends on the SoC spec and how it's planned to use the GPIO. As can be seen, designing a generic, general purpose and fit for all purposes, board is very difficult and perhaps even impossible.

We don't even know what GPIO there will be or the nature of those GPIO's; will I2C SDA and SCK be dedicated open-drain bi-directional signals or will they be configurable as normal push-pull general purpose outputs or as inputs ? Are general purpose outputs only push-pull or can they be open-drain ? That has a great impact on how the pins could be used and obviously how any board would be best designed.

At the present time I think people are looking for a Holy Grail that won't be found, and may never be found in the future without imposing restrictions on how GPIO is used. How suitable that would be depends on the requirements of a particular end-user.

As to my own answer to the dilemma; I'd design a simple beak-out board as that overcomes the problems all users will have in interfacing to GPIO. Beyond that,I'd take a dictatorial approach and design a board that best suit general purpose use in a manner I'd find acceptable then let 'the committee of end-users' try to pull me in other directions to suit their needs. Bearing in mind, the more it can do and the more flexible it is, the more complicated and more expensive it will be, and runs the risk of not meeting the requirements of those who want something simple and cheap. I wouldn't particularly want to embark on designing such a general purpose board as I can see too many conflicting requirements arising.

Edit : Typo's correct, content the same.

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

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

Sun Oct 16, 2011 2:05 pm

There is another potential issue with designing hardware for the I/O port at this point in time, in addition to the issues explained by hippy:

If my understanding of the situation is close to accurate, then we may not even have software support in the Raspi for the I/O port on initial launch. The Raspi team are attempting to get as much done as possible, but some items may initially end up on the cutting room floor to get the board done and out the door.

For the original mission of the Raspi project to succeed, then I'd say getting solid support for, say, USB peripherals and the on-chip graphics is much more important at launch in order to quickly get the project up to speed among the supporters. The I/O ports can be left out if need be. Remember that at this point not even the Raspi team themselves may have boards with the proper connections made. So for now they probably cannot even test any kernel driver or user space library, which might support the I/O port, and thus much less give the information to us. Bad info is worse than none in my view, doubly so if the community frantically start designing hardware around it.

So the bottom line is I believe I might be *harming* the Raspi project, if I helped design some sort of expansion board at this point in time. The existence of such boards at launch might put undue pressure on the team behind the Raspi at a point, where their time and energy might be better used elsewhere.

Thus no help with blinkenlights on day one from me, unless we have A) software support and B) hardware specs well before then. Sorry.

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

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

Sun Oct 16, 2011 8:24 pm

Thanks for the detailed answers.
I will support the software development, if its needed.
The reason I am pushing for thoughts on basic hardware protection is to avoid the situation you describe, no software for hardware, no hardware for software.
I understand that there will be differences depending on the nature of the GPIO port.
My understanding is that there are just a few types of ports and so I thought that each could be described and/or links to online descriptions posted.
That way I can get software going as soon as possible.
I figured out how diode clipping works in detail so I am more relaxed about that now.
Just need to read up on open drain circuits as that is usually whats used.
Then find maplin part numbers for the IDC cable, headers etc (which from my software perspective is a pain in the butt). BTW I read that the IDC was 0.5" but elsewhere 0.1"??
Once I know that I can readily get materials then I will revisit a driver or two.
Should then be ready.
I don't think that you would harm anything by reviewing the potential options now.
I agree the GPIO is probably a low priority.
Its got to work though so someone has used it in this or an earlier use of the cell.
I am not too worried about pin out details right now, its what breadbord was made for!

EDIT:
Being going back through earlier models on the assumption that they copied an existing GPIO cell. Not a lot of datasheets available on the closest models, well actually none of any worth that I can find.
I think that the GPIO software will work. Not much you can get wrong & it will be an existing cell & driver anyway (fingers crossed).

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

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

Sun Oct 16, 2011 9:17 pm

Quote from bradburts on October 16, 2011, 21:24
Thanks for the detailed answers.
I will support the software development, if its needed.
The reason I am pushing for thoughts on basic hardware protection is to avoid the situation you describe, no software for hardware, no hardware for software.
Yes, I agree. Discussing this stuff helps get clear about the different uses and users.

...
Then find maplin part numbers for the IDC cable, headers etc (which from my software perspective is a pain in the butt). BTW I read that the IDC was 0.5" but elsewhere 0.1"?? ...

If you look at the 'pitch' attribute here:
http://uk.rs-online.com/web/c/.....bon-cable/
or "Pitch Spacing":
http://uk.farnell.com/cable-ribbon

You'll see a bunch of values.

Most IDC connectors use 2-rows of pins. The pitch of those pins will be double the pitch of the cable; so two conductors will match the pin pitch. For example, a 2-row IDC connector with 0.1" (2.54mm) pins will need cable which has 0.05" pitch (1.27mm).

The R-Pi, wiki says 1.27mm:
http://elinux.org/RaspberryPiB.....I2S.2C_SPI

It doesn't say if it is one or two rows. I'd assume two, so the IDC connector would be two-rows at 0.05" (1.27mm) pitch, so an IDC cable would be 0.025" (0.635mm, or 0.64mm).

User avatar
psergiu
Posts: 224
Joined: Mon Nov 07, 2011 8:36 am
Location: TX, U.S.A. (was: RO, E.U.)
Contact: Website

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

Mon Nov 07, 2011 8:28 pm

If anyone will create a add-on board with all the I/O pins exposed, please try to use the Arduino pinout so people can reuse Arduino Shields (3.3V-compatible that don't use the Analog Inputs pins). As the Arduino layout is open-sourced, there's absolutely no need to invent another incompatible pin layout (as TI did with their MSP430 LaunchPad)

Thanks.

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

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

Mon Nov 07, 2011 9:00 pm

I explicitly reserve the right to *break* Arduino shield compatibility when deemed necessary. Sorry.

The original Arduino shield pinout is extremely poorly thought out, if you intend to use the I/O pins for high speed I/O and other critical applications. There is hardly *any* ground connections, and good luck if you need analog shielding, or other tricky connection types. Just because the original layout is awful doesn't mean I will feel an obligation to copy it, particularly not for any educational application(s) I may or may not have in mind.

But if you just wish to flash a few LEDs and other low speed control applications, then Arduino shield compatibility might be a good idea to aim for.

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

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

Mon Nov 07, 2011 11:00 pm

Quote from psergiu on November 7, 2011, 20:28
If anyone will create a add-on board with all the I/O pins exposed, please try to use the Arduino pinout so people can reuse Arduino Shields (3.3V-compatible that don't use the Analog Inputs pins). As the Arduino layout is open-sourced, there's absolutely no need to invent another incompatible pin layout (as TI did with their MSP430 LaunchPad)

Thanks.

What do you mean by an Arduino pinout? Do you want SPI and I2C in the right places on an Arduino pinout scheme? Do you want deeper levels of compatibility?

I also would like to explicitly reserve the right to not implement the Arduino shield pinout too.

1. As WizardOfOZ has explained it is not very good electrically. RaspberryPi signals may be approximately 20x faster, so it could matter quite a lot.
2. It might be a low value constraint. What fraction of shields support "(3.3V-compatible that don't use the Analog Inputs pins)" *and* provide something that RaspberryPi does not have already *and* that RaspberryPi would drive? It might be so few that there is little to be gained. I truly don't know.
3. It is DIY unfriendly. I would much prefer something that anyone could make a shield for using common, cheap technology, for example with all pins on a 0.1" pitch, without resorting to a PCB.
4. It is plausible that RaspberryPi will out-produce Arduino by such an enormous factor that Arduino pinout is irrelevant very quickly. I believe the Arduino team has acknowledged that the pinout was an error, but decided to stick with it for compatibility. They have not ruled out changing it in future designs. So why constrain ourselves? It might be better to collaborate on a 'better pinout'.
5. If we discover most people want to do simple LED/switch experiments, then shields might not be be relevant, but DIY may dominate.
6. There are some shields with dual pinout, with both Arduino pinout and which also support a more regular pinout. They may cover enough of the relevant areas to support a better alternative pinout from day one.
7. One option I like is to to plug straight into a breadboard and get something more convenient to use than an Arduino.

So I believe I understand there might be benefits from using Arduino shields, but I think it may be a premature constraint.

Of course, you are free to design whatever you feel is appropriate, and we can't avoid 'Darwinian forces' from choosing.

This is not to say that I don't like Ardiuno. I do, use them a lot, and have designed a few shields. RaspberryPi is just such a different machine from an Arduino and I think we should have an open mind.

User avatar
psergiu
Posts: 224
Joined: Mon Nov 07, 2011 8:36 am
Location: TX, U.S.A. (was: RO, E.U.)
Contact: Website

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

Tue Nov 08, 2011 2:08 pm

I believe that a lot of people will want to use the RPi as an Arduino replacement for "blinking lights" and other low-level & low-speed projects. If all the RPi's connectivity options will be "by professionals for professionals" - a lot of people will give up trying their first "blink a led" project. I for one am not able to solder reliably anything 1.27mm pitch or smaller - and i'm considered a "soldering guru" amongst my techie friends.

If the Arduino people do intend to standardize on a new, better pinout for shields, indeed let's talk to them and find some common ground (and GND pins :) )

Example of some compatible Arduino shields (3.3v capable, do not require pwm or analog pins) i found in a couple of minutes:

W5100-based ethernet shields use only the SPI & digital pins and are 3.3v
GSM Shield - http://www.sparkfun.com/products/9607
Lots of other ready-made shields could work allowing soldering-shy people to do cool stuff with their RPis. Not everybody was born with the soldering iron in their hands. The RPi is on track to become the new Apple II - we need something akin to the Apple II peripheral cards.

http://xkcd.com/927/

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

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

Tue Nov 08, 2011 2:48 pm

I don't believe any efforts to create R-PI GPIO breakout or expansion boards should necessarily be constrained by needing to be Arduino Shield compatible.

But I'd also say; if someone wants to create an R-Pi Shield interface which is fully Shield compatible then I believe people would welcome that. I would prefer a solution for Shield interfacing which allows all and any Shield hardware to be used so the R-Pi can simply use those Shields, for example adding ADC on the Shield interface to give the R-Pi the capability of that and allow Shields which need it to be used.

One thing to bear in mind is that simply having an ability for an R-Pi to link to a Shield isn't the be all and end all of things. It may lead to expectations that an R-Pi will be able to control all Shields, belief that the R-Pi is - or is trying to be - an Arduino substitute device, will even be capable of running code written for Arduino, and that needs to be addressed and managed.

I've seen non-Arduino products take a real drumming because, while they can use some Shields, they are not 'any Shield' compatible or don't have the software libraries to allow use of all Shields, or don't run code written for Arduino. That can generate a lot of negativity within Arduino circles with a product seen as a "me too" effort, riding on Arduino coat tails but not Arduino compatible, not Arduino capable; an inferior product to Arduino. That's usually a misunderstanding or misrepresentation of what the product set out to do but that doesn't prevent such negativity damaging the product so it has to be managed carefully.

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

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

Tue Nov 08, 2011 3:47 pm

Quote from psergiu on November 8, 2011, 14:08
I believe that a lot of people will want to use the RPi as an Arduino replacement for "blinking lights" and other low-level & low-speed projects.
Yes, that is what I want to enable.
IMHO, the easiest system to use is a plug straight into a breadboard.
Something like this IDC DIL Connectors
If all the RPi's connectivity options will be "by professionals for professionals" - a lot of people will give up trying their first "blink a led" project.
Agree, and I'd like folks to be able to do those experiments easily.
...
If the Arduino people do intend to standardize on a new, better pinout for shields, indeed let's talk to them and find some common ground (and GND pins :) )

We should try. But an R-Pi is so electrically different that they may quite reasonably feel we are over constraining them.

Example of some compatible Arduino shields (3.3v capable, do not require pwm or analog pins) i found in a couple of minutes:

W5100-based ethernet shields use only the SPI & digital pins and are 3.3v

This is exactly an example which I feel is of low value. Hence why I asked for a list of things that "... provide something that RaspberryPi does not have already ".
R-Pi already has ethernet, and drivers, integrated into the system.

I agree some people might want a second ethernet, but I'm not convinced an arduino shield will be popular enough to justify constraining a breakout to the Arduino pinout for it.
It might be much better to use a second R-Pi and talk over USB or SPI anyway.


GSM Shield - http://www.sparkfun.com/products/9607

Yes, the same module is on a breakout module too:
http://www.sparkfun.com/products/9427
for $40 less, i.e. you could have a free RaspeberryPi.

Making a breadboard friendly breakout board on 0.1" is probably more popular than making Arduino shields.

Lots of other ready-made shields could work allowing soldering-shy people to do cool stuff with their RPis. Not everybody was born with the soldering iron in their hands. The RPi is on track to become the new Apple II - we need something akin to the Apple II peripheral cards.
Apple II ignored the existing standards.

http://xkcd.com/927/

IMHO, their are a few problems constraining development to reuse poor 'standards'. Much better to use an existing, easy to use standard technology, along with an easy way for anyone to access a much larger set of electronics.

Using 0.1" pitch headers is already a very popular approach to making electronics available. 0.1" pitch connectors are popular for break out boards already. You can get *LOTS* of electronics that way. Far, far more than Arduino shields.

Constraining something which is much, much faster and more powerful than an Arduino to use a poor, DIY unfriendly standard almost destroys the ability to get much benefit.

IMHO, it would be better to use an ATmega to carry an Arduino pinout, and talk to it over USB (doable now). There is no hardware development needed to use USB, and all shields work. Job done. If the R-Pi retains serial, then an R-Pi Arduino shield adapter doesn't even need USB, and is cheaper than an Arduino. For now, you can prototype using an Arduino.

There are already through-hole PCB's designs so there is no hardware development needed. My chum Chris Godbert has designed a Serial Arduino PCB which can be made on common school milling machines for less than a £1, so a DIY serial-Arduino-shield-adapter would cost about £5 to make, one-off. Likely much cheaper than every alternative way of getting Arduino pinout compatibility.

Even cleverer, if the Arduino shield is 3.3V compatible, and only needs SPI and power (e.g. the ethernet shield), we could make a tiny SPI adapter from the R-Pi, plug it into the Arduino ISP header, and the shield adapter doesn't need anything else other than female headers. Job done,

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

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

Tue Nov 08, 2011 4:03 pm

Quote from hippy on November 8, 2011, 14:48
I don't believe any efforts to create R-PI GPIO breakout or expansion boards should necessarily be constrained by needing to be Arduino Shield compatible.

But I'd also say; if someone wants to create an R-Pi Shield interface which is fully Shield compatible then I believe people would welcome that. I would prefer a solution for Shield interfacing which allows all and any Shield hardware to be used so the R-Pi can simply use those Shields, for example adding ADC on the Shield interface to give the R-Pi the capability of that and allow Shields which need it to be used.

...

I've seen non-Arduino products take a real drumming because, while they can use some Shields, they are not 'any Shield' compatible or don't have the software libraries to allow use of all Shields, or don't run code written for Arduino. That can generate a lot of negativity within Arduino circles with a product seen as a "me too" effort, riding on Arduino coat tails but not Arduino compatible, not Arduino capable; an inferior product to Arduino. That's usually a misunderstanding or misrepresentation of what the product set out to do but that doesn't prevent such negativity damaging the product so it has to be managed carefully.

I agree with all you have said. There is a danger of confusion to the detriment of everyone.

I also worry that attempts at compatibility might also distracts effort into simply replicating what can already be done easily with an Arduino, but which could be focused on making R-Pi much better instead.

I would add:
1. IMHO i would be crazy to take a R-Pi, which has maybe 40x the performance of an Arduino, and throttle it to be slightly Arduino compatible for the sake of a few shields.
2. IMHO, it is easy to talk to an Arduino *TODAY*, without any hardware development at all, and use the Arduino to talk to shields, and hence get total shield compatibility.

Then, as I previously mentioned, the cost could be driven down, if that matters to anyone. I presume it is not cost sensitive for some people if they are willing to pay a 40% premium to get a shield rather than use a breakout board.

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

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

Tue Nov 08, 2011 4:11 pm

It feels to me there may be a misunderstanding or two brewing here somewhere. No-one said people shouldn't make Arduino compatible boards when appropriate, quite the contrary. What gbulmer and I said was that *we* reserve the right not to do so. I posted what I did to prevent the opposite situation: The Pi community quickly reaching a consensus, whereby we all should try to aim for Arduino Shield compatibility. Something *I* refuse to do. The rest of you may do as you please, it is none of my business. ;)

Another thing to keep in mind, is that the Pi doesn't even have enough I/O pins to enable a 1:1 pin mapping between the Pi GPIO port and the Arduino shield interface. Far from it, in fact. The Pi GPIO will apparently have on the order of 16 I/O pins.

What this means is that in order to make a Pi 'carrier board' to interface to Arduino shields, the carrier board will have to contain some serious I/O multiplexing circuitry. Probably a micro controller of some sort with enough pins to talk to both the Shield interface, and the Pi. Then the carrier board start to be precariously close to a standard Arduino in complexity, and *then* what is the point of the exercise? Just use an Arduino when you want it, and talk to it/control it remotely via a suitable protocol, as described above by gbulmer. There are genuine 32 bit Arduino boards in the pipeline, based on Atmel's SAM3U ARM chips.

To make matters worse, even if you did make such a carrier board, then the interfacing software library on the Pi would almost certainly need to have at least some knowledge of the functionality and pinout of each and every Arduino Shield. Only then would it be able to tell the carrier board MCU how to talk to a given Shield. Then the Shield author changes his software, or how he addresses the Arduino interfacing bus, and we have a problem. Doubly so if the Shield author suddenly begin utilizing new Arduino functionality, which the carrier board MCU is unable to replicate (because it isn't really an Arduino).

Keeping the software on the carrier MCU and the Pi interface library would then be a royal mess to maintain and keep up to date, given the frequent updates to the software on umpteen Shields. Good luck to whomever wish to maintain that. You will need it.

Finally, making even very simple Shields, like simple buffer boards with screw terminals for I/O, it doesn't make too much sense to me either. Just put the same circuitry on the carrier board for the same use of resources, and at the same time you neatly sidestep any software compatibility issues. In this case you may even add and utilize any unique abilities of the Pi GPIO port, or make a *very* simple I/O multiplexer, allowing even more connectivity at low cost (and ease of assembly).

User avatar
liz
Raspberry Pi Foundation Employee & Forum Moderator
Raspberry Pi Foundation Employee & Forum Moderator
Posts: 5212
Joined: Thu Jul 28, 2011 7:22 pm
Contact: Website

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

Tue Nov 08, 2011 4:13 pm

Just to muddy the waters even more, I should add that we (the Raspberry Pi Foundation) do plan to make some add-on boards ourselves next year.
Director of Communications, Raspberry Pi

Return to “Other projects”