NeuroChip is a prototyping board for hybrid digital/analog neuromorphic computing for the DIY robotics community and researchers in the fields of artificial intelligence and computational neuroscience.
NeuroChip can be used to test various learning algorithms and activation functions in hardware. Once a design has been verified, it can be miniaturized and scaled up using one of the following technologies: System in Package (SiP), VQFN, SOT, or WLCSP.
To program each processor, remove the chip from the socket and connect it to a 5 volt Arduino or programming board (many instructions available online). To test the board, remove the "cell body" chip and connect the corresponding socket positions (with jumper wires) directly to an arduino that has been programmed with the code from the cell body chip (with some additional serial monitoring code). After confirming that the board is performing as expected, reinstall the cell body chip. External sensors, actuators and monitors can now be connected to the inputs and outputs of the board (note: these must either be at 5 volts and connected to a common ground or operated by relay).
#include "avr/interrupt.h"
volatile int state = 0;
byte input;
byte weight = 2;
byte power;
int difference;
byte learningRate = 5;
void setup() {
pinMode(4, INPUT_PULLUP); // input
pinMode(2, INPUT_PULLUP); // post-synaptic feed-back
pinMode(1, OUTPUT); // output
GIMSK = 0b00100000;
PCMSK = 0b00000100;
sei();
void loop() {
if (state == 1){
weight = weight + (difference / learningRate); // if post-synaptic neuron fired, nudge weight towards last input
state = 0 // reset post-synaptic feed-back state
}
input = pulseIn(4, HIGH) / (); // read input and normalize to 255 (to determine number to divide by, divide max
difference = input - weight; // pulse width by 255
power = abs(difference); // replace this function with Gaussian for more powerful recognition
analogWrite(1, (255 - power));
}
ISR(PCINT0_vect)
{
state = digitalRead(2); // get post-synaptic firing event (rising edge only)
if (state == 0) {
state = 1}
}