HOME EVALUATION PACK  SYSTEM OVERVIEW
Modules and Connectivity (more)
The PinStem modules are piggy backed to form the PinStem bulk (see example on the right). Every pin can be an input, an output or disconnected from the process by either cutting pins or adding extra cut pin-array and hence denying connection (note that in this case through connectivity is also denied).
Modules are framed to protect the pins, they can be removed from the frame if corner screws are removed. Each module height division is 4mm whether framed or not. Frames have holes on each corner 40mm apart for M3 bolts that clamp the modules together into a rugged structure.
Standard 26 gauge wire can be forced into the socket as shown on the right. If standard ribbon cable is used with stranded wires, they need to be twisted together tightly packed and pre-tinned before attempting to force them into the pin socket. Solid wires 26 gauge need no special attention. Frames when clamped together using bolts will provide an adequate strain relief for the ribbon cable or other wiring. I.e it takes force to pull the cable out.
Single pin for all information exchange (compin) 

PinStem uses a single (reserved) pin for simplex information exchange by default. We refer to this pin as the compin. Information exchange protocol in this case is TTL USART. This pin is used to upload programming code, and for standard I/O used by e.g. the C printf instruction. Due to the simplex nature of the conduit a multidrop operation is possible, meaning many modules may simultaneously be using this pin either to receive or emit data. While emitting the pin is in an output state, at all other times it is a listener or in an receive mode. By connecting the RX and TX pins together with a 1Kohm resistor, a conventional TTL USART can read and write data to the stack through the RX line at 460800 baud. Some processors provide extra com channels at much higher rates.
WiFi 802.11 Add-on Module 

The wifi add-on utilizes the "compin". Since the RX and TX are joined, all data sent from a remote computer through this wifi socket connection gets echoed back to the input buffers of that same computer. These add-on modules can be set as a hot spots or stations on a wifi 802.11 network. When set as a station the user will have access to many different PinStems from the external program.
More 
Multiple processing modules on the same stem 

Each processor on the PinStem can be addressed and programmed individually through a boot loader. Uploading of new programs takes place through the default "compin". The inter processor communication is left up to the user through any of the remaining 32 pins. To break application program and activate boot loader to load a new program the reset button can be pressed. Note that all processors connected to the reset conduit pin (through pin) will exit their respective application, the units run the boot loader and expect either an instruction to run an application or load a new one.
Xmega processing module (see more info

The xmega is the latest in a line of very successful 8 bit AVR microcontrollers from Atmel. Xmega is the next generation up from the ATmega (arduino). Xmega sports an instrumentation grade signal conditioner with variable gains to 64v/v, a 2Ms/s 12bit A/D and an I/O subsystem. 

The development system
The PinStem can accommodate many microprocessors having myriad of different peripherals. Each processor requires special attention and comes with a pin map (outlining the function of each pin). A common denominator for all PinStem processing modules is the programming package and the single pin "compin" information exchange protocol. The kit is furnished with the GNU compiler for the C-language. There is no IDE integrated development environment, IDE requires extra learning, instead a simplified directory structure allowing the user to compile upload and test without any need to set up or install. This makes the software bundle light, flexible and mobile. There is however nothing that prohibits the use of IDE. Note that Python 2.7 should be installed on the computer, python is free. Go to www.python.org
This example uses one of the ATMEL processors 8bit AVR xmega, click on examples. Below: the basic development package contains 3 sub folders "basic float template" compiles using a floating point library, this allows the user to apply floating point math in the code. The IMU folder contains special library for accessing the on board IMU. To add a new project it is best to make a copy of one of these folders into the same root directory, and modify the code.
Blinking LED is one of the simplest ways to get started. Click on blink LED
All example folders contain six basic files: 
  1. make_code: builds a file that the AVR Xmega processor can run
  2. load_code: uploads the code to the Xmega processor and instructs the Xmega to run it.
  3. dialog: Terminal or console enables direct communication with the hardware stack so the user can input and output data from the program.
  4. system: this file dictates which processor on the hardware stem should receive the code, what gateway the code must go through to get to the PinStem wifi or USB. Timeout dictates for how long the code may run, if omitted it runs indefinitely. Bin selects either binary or ASCII exchange for the dialog terminal program. Log sets to which file the dialog exchange data is stored. The double slash makes the line a comment which the executing program then ignores.
  5. source.c: contains the C-language source code, must always have the same name "source".
  6. library.s: is a an assembler source, the user can write own efficient assembler modules to plug into the C source code. 
The LED blink source code
For reference click on this link to see the PinStem Xmega I/O map.
This program runs on the Xmega processor. Unlike it's popular predecessor ATmega, the Xmega processor allows variable clock source. Internal and external, clock controls are found in the sys_clock.h file. The instruction set is similar to the ATmega (arduino), porting code from the old chip is not a big problem. Here is a good chance to upgrade to Xmega.
Try your own code
For starters just change the time interval in the above source code to say 12500 cycles or double 6250 cycles. Click on make_code and then click on load_code, observe the LED slow down and your first PinStem program is working.
The dialog terminal program
The access program will set up a connection to the IP address specified in System.txt once the connection is established, clicking "ID" will list all the processing units on the stem. In this case the processors are both Xmega with 128KB flash memory labeled c2 and c3. The scrolling console window below displays data emitted from the stem e.g. from functions like printf and other sysout functions.
"Run" button in the command panel forces all processors on the stem to run their application. "END" button forces all processors to end the application code.
The command panel can be used to enter parameters into the application program.
CONTACT Copyright © 2015 [Hexamite ltd]. All rights reserved. Revised: December 16, 2016 . CONTACT