Post Reply 
Intel Edison generic calculator shield photo journal
04-06-2015, 06:33 PM (This post was last modified: 04-06-2015 06:34 PM by MarkHaysHarris777.)
Post: #49
RE: Intel Edison generic calculator shield photo journal
Greetings, this post is just an Edison development pointer; and update from a software engineering standpoint as it comes to developing for the Intel Edison... what I've learned, and how it might help you.

Everyone (and I do mean everyone) is miserably confused initially (and it does not depend on the board you're using) how to 'know' which GPIO pins match the real hardware physical pins and how those physical pins match the MRAA board pin assignments, and then finally what 'your particular board' decided to call those gpIO pins logically. Trust me, its a fit, and there are long lists of mapping tables to help everyone keep it all straight. The Edison makes this *all* even more confusing because the Edison has "four" (count them) breakout configurations which are *all* different! 1) mini breakout board from Intel, 2) Arduino breakout board with love from Italy, 3) the Intel Edison Hirose connector pin assignments, and finally 4) the Sparkfun GPIO 'block' breakout board.

It is very tempting, especially if you're an Arduino fanatic like me, to go to what 'you know' and work with the Edison in the Arduino IDE expanded in v1.6 to include the Edison board. Here's my first tip: drop the Arduino IDE, grow up and use a real development kit or compile your MRAA projects directly on the Edison (yes, you can do that!). The reason is simple: you will simplify the mraa mapping and you will be able to use the full compliment of 56 GPIO pins of the Edison including both I2C buses. Some of the Edison pins are not available within the Arduino IDE, and some of them require that you use the Arduino breakout board (which, as in my calculator use case, is often not possible).

Just to give some of you interested parties in an idea through a coding example I am providing a 'binary counter blinker' example tarball 'blinker.tar' which is a multi-file MRAA GPIO sample that is stand-alone, fully functional, and cleanly demarcates the mraa mapping stuff from the main logic, giving the bare minimum required to turn leds (or anything else) on and off.

The code is written for the Edison plugged into the Sparkfun GPIO 'block' and uses the eight gpIO lines on the north side of the card, gp44, gp45, gp46, gp47, gp48, gp49, gp15, & gp14. I have logically numbered them pin8 - pin1 respectively in my code, and I'm using pin1 and pin2 (which must be tied to HIGH via pullup resistors) as inputs, and pin3 - pin8 as binary register output pins.

The code is fairly straight-forward; its a binary counter. It updates its counter every 200 milliseconds and displays the counter on the binary register LEDs. The two inputs are in preparation for my interrupt driven keyboard, but are not really functional that way yet... one of them causes the counter to 'pause' for five seconds, and the other one (if read at the top of the count) causes the routine to blow out and exit.

I am running the example as a 'sketch,' as root, and I have built the code entirely ON the Edison itself; nothing extra, no other installation packages, and no other tools... just gcc at the command line. I have included a 'build' text file (rather than make) that can be used to call gcc; otherwise it will give you an idea of what is required; for instance remembering to pass the linker -lmraa or the thing won't compile ever!

My I2C sample will be coming shortly. The GPIO and I2C samples are the minimum for the Edison becoming a calculator with LCD display capabilities and analog keyboard and data-gathering capabilities.

One thing I've noticed, in closing, is that the IDE environments (Arduino and Intel's SDK on Eclipse Kepler) is that their builds are enormous, often initially close to or exceeding 100K, even for hello world complexity. The command line builds (whether on the PC or on the Edison directly) are much smaller, tighter, and faster. This sample compiles in just over 10K at the Edison command line.

Cheers,
marcus
Smile


Attached File(s)
.tar  blinker.tar (Size: 21 KB / Downloads: 5)

Kind regards,
marcus
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Intel Edison generic calculator shield photo journal - MarkHaysHarris777 - 04-06-2015 06:33 PM



User(s) browsing this thread: 14 Guest(s)