To make sure wiringPi was going to work OK on the new Raspberry Pi Compute Module and IO test board, I went out and bought myself one…
Note to self: DO NOT trust anything on the RS website ever again and DO NOT order from RS unless stupidly desperate. Back order they say – oh, great, so I order one 2 weeks ago – nothing. Then the date slipped – then Farnell had it IN STOCK for NEXT DAY delivery…. Get a grip, RS. Anyone want to buy a Pi compute module with IO board? Make me an offer… (When I get it, that is!!!)
And oh, Farnell, you’re not perfect either – you included 2 A to B USB cables rather than A to µB, doh!
3rd June: Update to the above. Farnell are going to send replacement USB cable and RS have now slipped their delivery date to the 1st of October, (I’m guessing due to the issue with the camera boards) however they were very helpful on the phone and let me cancel it.
So the Compute Module is a little SO-DIMM sized board with the Broadcom SoC, 512MB of RAM and 4GB of flash and … well, that’s it. All that and a big edge connector, so to make life easy for people developing for it, the boffins at Pi HQ also designed the Compute Module IO board as a reference/testing board. They’re being sold as a pair right now, but I’m sure that in the very near future you’ll be able to buy just the compute module when you’ve designed your own IO board based of the reference board.
Here it is:
That’s the photo “borrowed” off the Raspberry Pi site (hope you don’t mind, guys)
The good news is that wiringPi will work on it without any issues at all.
However, I’ve taken the liberty to make a few changes to wiringPi to make it work better with the Compute Module and other, older Pi’s.
The first change is that the wiringPi pin numbering scheme (Or the Pi’s physical P1 pin numbers numbers) doesn’t make any sense on the Compute Module, so if you call wiringPiSetup() or wiringPiSetupPhys() it will be just the same as calling wiringPiSetupGpio() and all pin numbers are then the native BCM_GPIO pin numbers.
Note that this change is only applicable to the Compute Module – wiringPi on Rev 1, 2/Model A, B Pi’s is not affected by this.
Another change has been to the gpio program – mostly in the readall command – it now understand the compute Module IO pins and produces an output like:
+-----+------+-------+ +-----+------+-------+ | Pin | Mode | Value | | Pin | Mode | Value | +-----+------+-------+ +-----+------+-------+ | 0 | IN | High | | 28 | IN | Low | | 1 | IN | High | | 29 | IN | Low | | 2 | IN | High | | 30 | IN | Low | | 3 | IN | High | | 31 | IN | Low | | 4 | IN | High | | 32 | IN | Low | | 5 | IN | High | | 33 | IN | Low | | 6 | IN | High | | 34 | IN | High | | 7 | IN | High | | 35 | IN | High | | 8 | IN | High | | 36 | IN | High | | 9 | IN | Low | | 37 | IN | Low | | 10 | IN | Low | | 38 | IN | Low | | 11 | IN | Low | | 39 | IN | Low | | 12 | IN | Low | | 40 | IN | Low | | 13 | IN | Low | | 41 | IN | Low | | 14 | ALT0 | High | | 42 | IN | Low | | 15 | ALT0 | High | | 43 | IN | Low | | 16 | IN | Low | | 44 | IN | Low | | 17 | IN | Low | | 45 | IN | Low | | 18 | IN | Low | | 46 | IN | High | | 19 | IN | Low | | 47 | OUT | Low | | 20 | IN | Low | | 48 | ALT3 | Low | | 21 | IN | Low | | 49 | ALT3 | High | | 22 | IN | Low | | 50 | ALT3 | High | | 23 | IN | Low | | 51 | ALT3 | High | | 24 | IN | Low | | 52 | IN | High | | 25 | IN | Low | | 53 | IN | High | | 26 | IN | Low | | 54 | IN | Low | | 27 | IN | Low | | 55 | IN | Low | +-----+------+-------+ +-----+------+-------+
The other change to the gpio command is better board identification:
Pi model B, Rev 1:
Raspberry Pi Details: Type: Model B, Revision: 1, Memory: 256MB, Maker: China
(does anyone know the name of the factory that made the first batches?
Pi Model B, Rev 2 and Red:
Raspberry Pi Details: Type: Model B, Revision: 2, Memory: 512MB, Maker: Egoman
Compute module:
Raspberry Pi Details: Type: Compute Module, Revision: 1.1, Memory: 512MB, Maker: Sony
This all from the gpio -v command and relies on information out of the /proc/cpuinfo pseudo file, so if that changes then it may be wrong until I find out about it…
There are other changes in wiringPi too – not related to the compute module and I’ll write more about these later, but briefly you can now set a pin to softPwm mode and softTone mode using the pinMode () function call, and (more importantly) you can change a pin out of one of these modes if you need to and it cancels the background thread that was managing them.
The latest version of wiringPi is now 2.15. If you already have it installed, then
cd ~/wiringPi git pull ./build
will get you going, if installing from scratch:
cd git clone git://git.drogon.net/wiringPi cd wiringPi ./build
will fetch and install it for you.
This is my test-bed. I connected up 46 LEDs (There are 48 GPIO pins on the BCM2835, but only 46 are brought out on the IO board – 46 isn’t used and 47 is the new ACT LED on the IO board). The IO board is being powered via the main USB socket which is coming off a powered hub which also has a keyboard and Wi-Fi dongle connected to it.