Jump to content
Coming Soon: Pi To The Sky: The Orange Pi 5 is here! ×

Connecting to CubieBoard2 I/O


COTB

Recommended Posts

Making some Cubie I/O connectors for general use is no trivial task as there are no less than 48 pins on each dual row strip and it involves soldering at at 2mm pitch.

cubieboard2_pinout.png

Above is the original Cubieboard A10 pinout courtesy of Google Groups, and as the A20 pinout is no different and the PCB reportedly identical, it should be safe to follow it.  What can we leave out in order to save a bit of work?  Well.. unfortunately there's not a great deal if we want to ensure a full gamut of pins to experiment with.  The VGA and CVBS (video blanking) signals seem the only obvious ones, and that still leaves 92 connections including the power pins - sigh!

a_good_start_on_the_cubieboard2_connector.jpg

OK, we are off to a good start here; not my best joints but there are no dry ones!  Working at 2mm pitch is when solder's surface tension and old shaky hands start to cause problems, and it's difficult to regulate the amount of solder when you use a blunderbuss iron!  And no, I haven't forgotten the two bits of heat-shrink - they are well away from the heat.  Two days later...  :D

Exploring Other Linux Distros

As a break from the tedium of wiring I decided to have a quick look at other Linux distros for the CubieBoard2.  The obvious one was Cubieeze, so I flashed cubieeze-cb2-card-hdmi-v2.0 to a microSD card.  The result was disappointing.  It's a Debian Wheezy (V7) hack and showing terminal signs of abandonment - like non-functioning repos!  They obviously lost interest here around the time Linaro lost interest in supporting ARM.  I decided that with Linaro I'd happened on the best available distro the first time around.  Apart from the broken repositories, the Cubieeze version of the D compiler was older at a critical period in the D language development, and I've already decided to use D in this project for a number of reasons I won't expand on now but might just become obvious.  Doubling down on Linaro I spent a little time on improving the UI of my SSD rooted copy in line with my likely usage.

Getting to the Metal

Browsing github.com I happened on a repo called sunxi-tools.  This proved rather rewarding as I spotted a file called pio.c which contained the raw code for accessing the pins.  I wasn't even sure that Linaro contained /dev pin drivers, but my experience is that these can be slow and limiting.  Raw C code to the pins can remove these limitations, and the platform specific nature of direct access is no barrier here as it will port to other A20 boards and non-A20 boards are unlikely to have the peripherals (or compatible drivers) anyway.  Compiling pio.c into a command line executable turned out to be very simple as it has practically no dependencies.  It was only necessary to copy over the source and an odd couple of header files.  The missing version.h header file proved simple to create with the autoversion.sh script.

./autoversion.sh >version.h

compiling_pio_c.png

The resulting pio executable can only be run as root due to the security levels all modern CPUs have these days, but that's not a problem here.

first_run_of_the_pio_executable.png

Now we've got a way to test the I/O without lots of error prone coding! :)

No Easy to Read Pinout?

The pretty picture at the very top of this post is just that - a pretty picture.  It's near useless, even on a large sized monitor.  The other pinouts I located are confusing, and can only be made any sense of once you realise that the author was viewing the board from the wrong side - except they don't explain that.  I thought I was going to have to do my own pinning table until... https://lh4.googleusercontent.com/-QvtBLZErfLM/U8ev9qDqfsI/AAAAAAAARYE/HHC_S_JcMRw/s1600/cubiea10_pinout_rev1.2.alfa_screen_size.png  Thank you Tiberiu Corbu for responding to the same general complaint from other people - six years ago!  Anyway, how is the new custom connector coming on?  Finished - well the first of the two anyway.

Cubieboard2_Breakout_Cable_1.jpg

The leads are correctly colour coded and grouped into bundles of ten.  Because the socket strip tabs are fragile I've double heat-shrink sleeved the fanout to give it rigidity and strength.  The small plugboard is there for illustration only.  Now for some testing before we make the second one...

 

 

Link to comment
Share on other sites

  • COTB changed the title to Connecting to CubieBoard2 I/O

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...