Golden Monkeys The Code

With regards to the coding of the project it was done by our CECS Major Nicholas Morrison. When we got together to work on the coding we had issues with the timing of the decoders which caused some of the LEDS to pop up and light, however since the timing was wrong some of the LEDS just stayed on, but most stayed off. After messing with the code a little more we were able to obtain some blinking, but, again, most of the LEDS stayed off.

After more inspection we found that the connections to the A3BU were connected incorrectly, which made it difficult for our programmer to accurately troubleshoot the code. This basically caused an issue with determining which pin in the LED drivers were high and low. 2015042595183202When trying to further troubleshoot the A3BU we found that we are having issues with designating pins. We have 16 pins available, and we need 20 however that would mean that we would have to disable the 4 pins that are currently in use by the A3BU.

Unfortunately, even though we completed the hardware, and tried our very best with the programming, we were not able to troubleshoot the issues that surfaced when we tried to implement the A3BU with the LED cube. The LED cube is functional when you apply a power source to it, but we were not able to program the A3BU to properly work with the Decoders and the LED drivers to make the LED cube to work properly.

This is the Code that does not function as of yet:

/**
* \file
*
* \brief Empty user application template
*
*/

/**
* \mainpage User Application template doxygen documentation
*
* \par Empty user application template
*
* Bare minimum empty user application template
*
* \par Content
*
* -# Include the ASF header files (through asf.h)
* -# “Insert system clock initialization code here” comment
* -# Minimal main function that starts with a call to board_init()
* -# “Insert application code here” comment
*
*/

/*
* Include header files for all drivers that have been imported from
* Atmel Software Framework (ASF).
*/
#include <asf.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <string.h>
#include <stdio.h>
#define AXIS_X 1
#define AXIS_Y 2
#define AXIS_Z 3

// Delay loop.
// This is not calibrated to milliseconds,
// but we had allready made to many effects using this
// calibration when we figured it might be a good idea
// to calibrate it.
void delay_time(uint16_t x)
{
uint8_t y, z;
for ( ; x > 0 ; x–){
for ( y = 0 ; y < 90 ; y++){
for ( z = 0 ; z < 6 ; z++){
asm volatile (“nop”);
}
}
}
}

static void setup()
{
ioport_pin_t J1[8] = {J1_PIN0, J1_PIN1, J1_PIN2, J1_PIN3, J1_PIN4, J1_PIN5, J1_PIN6, J1_PIN7};
ioport_pin_t J2[4] = {J2_PIN0, J2_PIN1, J2_PIN2, J2_PIN3};
ioport_pin_t J4[8] = {J4_PIN0, J4_PIN1, J4_PIN2, J4_PIN3, J4_PIN4, J4_PIN5, J4_PIN6, J4_PIN7};
int i = 0;
for(i = 0; i <8; i++)
{
ioport_set_pin_dir(J1[i],IOPORT_DIR_OUTPUT);
ioport_set_pin_dir(J4[i],IOPORT_DIR_OUTPUT);
if(i<4)
{
ioport_set_pin_dir(J2[i],IOPORT_DIR_OUTPUT);
}
}
}

int main(void)

{
// Insert system clock initialization code here (sysclk_init()).
pmic_init();
ioport_init();
setup();
int j = 0;
// while(true)
// {
while(true)
{

int i = 2;
ioport_pin_t J4[8] = {J4_PIN0, J4_PIN1, J4_PIN2, J4_PIN3, J4_PIN4, J4_PIN5, J4_PIN6, J4_PIN7};
ioport_set_pin_high(J2_PIN0);
for (i=0; i<8; i++)
{
if(i != 7)
ioport_set_pin_low( J4[i]);
else
ioport_set_pin_high(J4[i]);
}
ioport_set_pin_high(J2_PIN1);
ioport_set_pin_high(J2_PIN2);
ioport_set_pin_high(J2_PIN3);
ioport_pin_t J1[8] = {J1_PIN0, J1_PIN1, J1_PIN2, J1_PIN3, J1_PIN4, J1_PIN5, J1_PIN6, J1_PIN7};
for (i=0; i<8; i++)
{
if(i != 7)
ioport_set_pin_low(J1[i]);
else
ioport_set_pin_high(J1[i]);
}

delay_time(10);
ioport_set_pin_low(J2_PIN0);

delay_time(10000);
}
}

Further inspection, and after many red bulls, we discovered that the issue with our project lied in the hardware and connections that were in the LED cube and the IC circuit board. We tested the pins of the A3BU with a multimeter and we were getting the voltages that we wanted, however when we connected the A3BU to the LED cube we received some malfunctions — none of which was really the programs fault.

This is the final code that was developed:

/**
* \file
*
* \brief Empty user application template
*
*/

/**
* \mainpage User Application template doxygen documentation
*
* \par Empty user application template
*
* Bare minimum empty user application template
*
* \par Content
*
* -# Include the ASF header files (through asf.h)
* -# “Insert system clock initialization code here” comment
* -# Minimal main function that starts with a call to board_init()
* -# “Insert application code here” comment
*
*/

/*
* Include header files for all drivers that have been imported from
* Atmel Software Framework (ASF).
*/
#include <asf.h>
#include <avr/io.h>
#include <avr/interrupt.h>
#include <string.h>
#include <stdio.h>
#define AXIS_X 1
#define AXIS_Y 2
#define AXIS_Z 3

// Delay loop.
// This is not calibrated to milliseconds,
// but we had already made to many effects using this
// calibration when we figured it might be a good idea
// to calibrate it.
static void delay_time(uint16_t x)
{
uint8_t y, z;
for ( ; x > 0 ; x–){
for ( y = 0 ; y < 90 ; y++){
for ( z = 0 ; z < 6 ; z++){
asm volatile (“nop”);
}
}
}
}

static void setup(void)
{
//J1: Cathode Control; J2: Pin 0 : Output Control, 1-3: Addressing; J4: Data bus
ioport_pin_t J1[8] = {J1_PIN0, J1_PIN1, J1_PIN2, J1_PIN3, J1_PIN4, J1_PIN5, J1_PIN6, J1_PIN7};
ioport_pin_t J2[4] = {J2_PIN0, J2_PIN1, J2_PIN2, J2_PIN3};
ioport_pin_t J4[8] = {J4_PIN0, J4_PIN1, J4_PIN2, J4_PIN3, J4_PIN4, J4_PIN5, J4_PIN6, J4_PIN7};
int i = 0;
for(i = 0; i <8; i++)
{
ioport_set_pin_dir(J1[i],IOPORT_DIR_OUTPUT);
ioport_set_pin_dir(J4[i],IOPORT_DIR_OUTPUT);
if(i<4)
{
ioport_set_pin_dir(J2[i],IOPORT_DIR_OUTPUT);
}
}
}

int main(void)
{
// Insert system clock initialization code here (sysclk_init()).
pmic_init();
ioport_init();
setup();
int i = 0;
int j = 0;
int k = 0;
int l = 0;
// while(true)
// {
while(true)
{

ioport_pin_t J4[8] = {J4_PIN0, J4_PIN1, J4_PIN2, J4_PIN3, J4_PIN4, J4_PIN5, J4_PIN6, J4_PIN7};
ioport_set_pin_high(J2_PIN0);
for (i=0; i<8; i++)
{
if(i != j)
ioport_set_pin_low( J4[i]);
else
ioport_set_pin_high(J4[i]);
}
switch (k)
{
case 0:
ioport_set_pin_low(J2_PIN1);
ioport_set_pin_low(J2_PIN2);
ioport_set_pin_low(J2_PIN3);
break;
case 1:
ioport_set_pin_high(J2_PIN1);
ioport_set_pin_low(J2_PIN2);
ioport_set_pin_low(J2_PIN3);
break;
case 2:
ioport_set_pin_low(J2_PIN1);
ioport_set_pin_high(J2_PIN2);
ioport_set_pin_low(J2_PIN3);
break;
case 3:
ioport_set_pin_high(J2_PIN1);
ioport_set_pin_high(J2_PIN2);
ioport_set_pin_low(J2_PIN3);
break;
case 4:
ioport_set_pin_low(J2_PIN1);
ioport_set_pin_low(J2_PIN2);
ioport_set_pin_high(J2_PIN3);
break;
case 5:
ioport_set_pin_high(J2_PIN1);
ioport_set_pin_low(J2_PIN2);
ioport_set_pin_high(J2_PIN3);
break;
case 6:
ioport_set_pin_low(J2_PIN1);
ioport_set_pin_high(J2_PIN2);
ioport_set_pin_high(J2_PIN3);
break;
case 7:
ioport_set_pin_high(J2_PIN1);
ioport_set_pin_high(J2_PIN2);
ioport_set_pin_high(J2_PIN3);
break;
default:
k = 0;
break;
}
ioport_pin_t J1[8] = {J1_PIN0, J1_PIN1, J1_PIN2, J1_PIN3, J1_PIN4, J1_PIN5, J1_PIN6, J1_PIN7};
for (i=0; i<8; i++)
{
if(i != l)
ioport_set_pin_low(J1[i]);
else
ioport_set_pin_high(J1[i]);
}
ioport_set_pin_low(J2_PIN0);
j++;
if(j >= 8)
{
j = 0;
k++;
if(k >= 8)
{
k = 0;
l++;
if(l >= 8)
{
l = 0;
}
}
}
delay_time(1000);
}
}

Golden Monkeys The Idea

2015042095180649

In the beginning we were thinking about doing a binary calculator, but after brooding over that idea for about a week we changed it to the LED cube. At first we wanted to have the LED cube attach to a different project that was developed by one of our team members, Tayce Lassiter, which is apart of her teaching assistant class. However, seeing as how long it was taking to complete the LED cube, and to program it, we decided to just leave the project to just the LED cube.

Golden Monkeys On Duty! (The Build)

The Beginning:

2015040795150030
It all starts with the base! This is where our 8x8x8 LED cube will sit on so that we can keep it as neat as possible when wiring. The wooden cube was manufactured by our team member, Tayce, and allowed us to keep all of the components snug.

2015032595220719

Starting out we had to create our individual layers. Since we created an 8x8x8 LED cube we had to create 8 layers of 64 LEDS with half an inch gape between each LED.

2015033195173430

After we completed soldering all 8 layers we then proceeded to solder the layers on top of each other with half an inch spacing. This required 2 people to accomplish: one to hold the new layer being soldered, and the other soldering the next layer.

2015042095180649


This is the completed 8x8x8 LED cube which resulted in 1024 solder joints, which does not include the soldering done on the board, and the wires that hook up the board to the cube. In total this build took about six weeks to accomplish.

20150414951833002015042095203508This is the board that is hooked up to the LED cube. The ones marked with numbers are the 74HC574 which are our LED drivers, and the two in the middle are our decoders 74HC138E. The decoders basically send a clock a signal to the LED drivers which in turn control which LED will get turned on. This works by giving the programmer the ability to control the LEDS in the X, Y, and Z direction.

Putting the two together, the LED CUBE and the circuit board, the completed project looks like this:2015042095152751 2015042395165003

2015042095180718 2015042095153625