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

Oranges Could Become My Favourite Fruit!

A few weeks back I was tempted by a Pi - not the one with all the little seeds you understand.  No, that one isn't open source engineering, and quite frankly isn't for us professional (retired) engineers. ;) Yes, you've guessed it: Orange Pi!  The sub-twenty-UK-pounds of the Orange Pi PC proved just too much to resist.  A board with a quad core CPU, 1GB of RAM, WiFi & Ethernet, HDMI video, IR receiver, Camera Port, 3xUSB, etc. at this price level is probably too good to be true.  Or is it?

I decided that boards which depend on a microSD for program storage are an economy too far.  Whilst this bottleneck might be OK in an ultra low cost embedded application development work requires something better.  So it was pay the few pounds extra for the eMMC version and see what turned up.  As it turned out there wasn't the expected six weeks or more wait for Chinese components, as despite all the world turmoil Orange Pi central had their pretty box on my desk in inside a month.

I don't generally rush off and try new gismos the same hour/day, but eyeballing the OP PC+ triggered childhood Christmas Morning Syndrome, and I just had to fire it up right away.  I'd omitted to order a power lead but the one 1.7/4.0mm for the Cubieboard 2 did the job fine.  Ditto HDMI converter, keyboard etc. for same.

Orange_Pi_PC_Plus_First_Powerup.jpg

Power up time: oh no not Android 4.4 again, and all in CHINESE!  This was not a good start!  Drawing on all my painful experiences with cheap Chinese Android tablets that had - often mysteriously - factory reset, I navigated through the hieroglyphics and attained English language nirvana!

Chinese_Android.jpg    No_Android_Apps.jpg

Click on the massive Google Play icon... zilch!  Click on every one of the other giant icons... double zilch!  It had a dumb deaf and blind Android core installed so I'd need to sideload some apps.  But wait; enough of this nonsense; let's boot to a decent Linux distro from the microSD.  I'd never tried Armbian before but this seemed like a good time to start.

The first attempt at booting Armbian from the microSD didn't go well: I'd naturally chosen the latest version (Focal) but missed a warning that Focal images had been broken.  Stepping back to Buster solved this problem, and that booted after a short delay - we were getting somewhere!  Set the passwords; do the usual updates...

The next step was to transfer Armbian from the microSD to the on-board eMMC so that we could lose the slow card entirely.  This proved remarkably easy as there's a pre-written script called nand-sata-install to do exactly this.  Now we are flying as a boot is so much faster - yes, eMMC was certainly the right way to go here!  You can see the eMMC at the bottom centre (just above the dual row pin header) of the board in the first picture.  On the Plus version they've moved the second DRAM to the other side of the board (directly below the visible one near the centre of the board) to make room for it.  BTW if you do have the non-Plus version then don't make the mistake of going for a superfast A2 microSD card as there aren't any drivers for these in Armbian (yet) and it will likely run significantly slower than a much cheaper A1 specification card.

Transferring_Armbian_Rootfs_To_eMMC.jpg

After my usual desktop tweaks I pulled the D language compiler from the repos: although I like Python, D takes a much better approach to higher level programming and also integrates almost seamlessly with C code for the low level bit twiddling.

sudo apt install gdc

How are we doing from a thermal stress point of view?  Well... so far the H3 isn't under much stress, but it can get a lot hotter!

H3_CPU_Idle_Temperature.jpg

Getting To The Pins

Next step was to get at the peripherals, and it turns out that WiringPi has already done the spadework for the H3 here - no sense reinventing the wheel!  There's a WiringPi port for the Orange Pi PC to be found here.

The H3 sports the following multi-functional input/out pins:

Port A (PA): 22 input/output port
Port C (PC): 19 input/output port
Port D (PD): 18 input/output port
Port E (PE): 16 input/output port
Port F (PF):  7 input/output port
Port G (PG): 14 input/output port
Port L (PL): 12 input/output port

The Orange Pi Plus PC can't possible provide user access to all these 108 pins within the limited board area, though unused peripherals can generally be reassigned to simple I/O:


Orange_Pi_PC_IO_Pinout.jpg

Orange_Pi_PC_Plus_IO_Test.jpg

With WiringPi installed we can now get at the pins at both BASH script and compiled C code level, the package also contains a wealth of examples.  I chose to test things out with a tiny script.  Just to throw some execution randomness and impose a parallel load on the H3 CPU I ran a HD movie in another window.  I can thus report that Kill Bill didn't kill the execution script! ;)

Orange_Pi_PC_Plus_IO_Screen.jpg

PIN=1
while true; do
	gpio write $PIN 1
	sleep 0.05
	gpio write $PIN 0
	sleep 0.05
done

Orange_Pi_Script_Output_On_Pin_1.jpg

A fairly regular squarewave as expected, so the video playback isn't impacting the hardware timing, however the observant reader may note that the output frequency of the square wave on logical Pin 1 (physical Pin 12 - the red picohook) isn't the 10Hz it should be.  This is a - long by about 25% - error in the Armbian sleep routine and nothing directly to do with the hardware.  It would be interesting to trace the sleep routine implementation back to see exactly where/how this crept in.  Maybe more on this later.

The Conclusion...

So.. now we have a near perfect development platform for embedded applications.  The beauty here is that there are much smaller and even lower cost boards using the same basic hardware configuration but without unnecessary appendages like the HDMI interface to form the basis of really smart hardware.  Orange Pi Central has recognised this potential by promising Long Term Support for these boards - hardware projects generally have a far longer useful lifetime than software.  Fabricators should therefore be able to depend on continuity of supply!  If all this potential is fulfilled then Oranges really could become my favourite fruit!

Coming Up

I've ordered a few of the Orange Pi PC Plus' smaller even cheaper cousins - the Orange Pi Zero, to embedd in future Stripboard projects, so stay tuned for a first evaluation.

 

_____________________________________

If you enjoyed this article and want to see a lot more then please create a site membership and post a comment - a little encouragement goes a long way!  With free membership you can also start new threads in our forums; ask questions; or publish your own constructional articles.  Stripboard.com is an advertising free, and non-commercial area of the Internet that has no aspiration toward world domination - or even making anyone any money!





User Feedback

Recommended Comments

There are no comments to display.


×
×
  • Create New...