8x8x8 cube problem

Forum for posting topics and questions about anything.
BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube problem

Post by BobBurton » Wed Aug 26, 2020 2:32 pm

With all 8 LED slices in place and connected I became aware of another problem. Often the demo would run but not display patterns immediately or when running some of the patterns some of the LEDs would flash on and off quickly when they should be on for longer

A small test sketch turning a row of LEDs on and off for periods of 1 second showed the problem clearly. Touching the pins of the LED drivers often provoked or stopped the problem temporarily.

Whilst investigating I found no functionality that controlled the enable pin of the LED drivers (pin 21) although they are connected to digital pin 9 of the processor. Setting that pin permanently to LOW in my test sketch appears to eliminate the problem

I see in the library file that there are macros

Code: Select all

/* Macros for the LED driver enable pins */
#define DRIVER_EN_HIGH PORTB |= 0b00000001;
#define DRIVER_EN_LOW PORTB &= ~0b00000001;
Unfortunately the macros control pin 8 rather than pin 9

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 8x8x8 cube problem

Post by andrew » Thu Aug 27, 2020 9:44 am

Wow, you are correct, this is a bug. The enable pins must just happen to pull low which is the only explanation as to why it has not been spotted for all these years. No idea why yours behaves differently though but it's defiantly configured wrong. I'm going to upload a fixed version of the library (V0.2) to the software section of the forum next. Thanks for reporting this !
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube problem

Post by BobBurton » Thu Aug 27, 2020 10:53 am

Thanks for reporting this !
You are welcome.
I don't suppose there is a bounty for finding it, by any chance :D

At first I was sure that there was a problem with my soldering so I took all of the LED slices out and reflowed all of the joints to no avail. However, when monitoring the control pins of the LED drivers (***) I noticed that the EN pin was not changing state, hence I went looking for what should be changing it and found the macros with likely looking names but incorrect code

In practice the cube, or at least one slice, seems to work OK with the EN pin set permanently LOW, so I am going to put all 8 slices back and I will download the new version of the library and take out my "fix" which consists of a pinMode() and digitalWrite() in setup()

(***) As to why I have a problem and others don't, I suspect that we will never know, but the logic analyser (Hobby Components !) certainly came in handy and it is the first time that I have used it in "anger" rather than just putting it through its paces when I bought it

In retrospect I enjoyed tracking down the problem, but it was very frustrating at times.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube problem

Post by BobBurton » Thu Aug 27, 2020 12:04 pm

I have downloaded the revised (V0.2) library, installed it and remove my pinMode()/digitalWrite() fix

Running my test sketch which bounces a line of LEDs up and down one LED slice the output is stable but the lowest row of LEDs is permanently on in a ghostly state. The effect whereby a ghost row of LEDs is visible beneath the lit one (or is visible on level 7 when level 0 is lit) is no longer present, but the permanent ghosting on level0 is even more annoying and noticeable

What is the purpose of enabling/disabling the LED drivers ?

I think that I can see another way of disabling the LED driver output whilst the values are updated but it will require a hardware bodge involving the enable pins of the 74LS238. I will update this thread when I have tried it

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 8x8x8 cube problem

Post by andrew » Thu Aug 27, 2020 2:45 pm

I've attached an updated the HC8x8x8Cube.cpp library file and attached it to this post if you want to give it a try to see if it improves anything. Unfortunately I don't have access to a cube until tomorrow so I'll take a closer look then to see if there's anything else that can be done.

HC8x8x8Cube.cpp
What is the purpose of enabling/disabling the LED drivers ?
It's simply to minimise any ghosting effect.
You do not have the required permissions to view the files attached to this post.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube problem

Post by BobBurton » Thu Aug 27, 2020 7:44 pm

Results of my tests. All using the same sketch with no pinMode() or digitalWrite() on pin 9 and with the appropriate library files in the same folder as the sketch using #include "HC8x8x8Cube.h"

original library
Ghosting on the layer below the currently lit one. The display of the pattern can be disturbed by touching pin 2 of the LED drivers

V0.2 library
Permanent ghosting on the layer 0 LEDs whatever the lit layer. Touching pin 2 of the LED drivers causes no problems

amended V0.2 library
As original

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 8x8x8 cube problem

Post by andrew » Fri Aug 28, 2020 8:51 am

The display of the pattern can be disturbed by touching pin 2 of the LED drivers
amended V0.2 library As original
I've set a cube up with the updated V0.2 library as previously posted. Pin 2 of the drivers is the data pin that receives the bit pattern from the microcontroller. It's feasible that touching this pin would upset it but I'm not able to disturb the pattern by touching any of the pins of the drivers.

I'm still inclined to suspect that there's possibly a bad connection somewhere between the microcontroller and the driver(s). To make another attempt to quantify the level of ghosting you should be seeing I've programmed a cube up so that all the LEDs on layer 3 are permanently on and then taken a picture. Its a dull day here and the picture is a fairly good representation of what I'm actually seeing so you can check this image against your cube. If yours is noticeably worse given the same lighting conditions then there may still be something wrong with your cube....

8x8x8_Cube_Image.jpg
You do not have the required permissions to view the files attached to this post.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube problem

Post by BobBurton » Fri Aug 28, 2020 10:13 am

Thanks for the picture

One of the problems with trying to describe brightness is that it is very subjective. That is one reason why I prefer digital to analogue circuits !

When I run a similar sketch to yours to turn on all of the LEDs in layer 3 I can distinctly see that the corresponding LEDs in layer 0 are glowing, albeit not very brightly

Attached is a photo of my cube running the program using the original V0.2 library. As you can see the LEDs on layer 0 are glowing faintly. I would be interested to know whether there is any sign of that on your cube, however faint
I'm still inclined to suspect that there's possibly a bad connection somewhere between the microcontroller and the driver(s)
I will check again, but as the V0.1 and updated V0.2 libraries show ghosting on the level below the active one and the original V0.2 library shows ghosting on level 0 for all active levels I am somewhat bemused

I will remove all of the LED slices except number 7 to make access easier and trace the connections from the microcontroller to the LED drivers

Am I having fun yet ? :D
You do not have the required permissions to view the files attached to this post.

andrew
Site Admin
Posts: 1374
Joined: Sun Aug 05, 2012 4:15 pm

Re: 8x8x8 cube problem

Post by andrew » Fri Aug 28, 2020 11:56 am

Attached is a photo of my cube running the program using the original V0.2 library. As you can see the LEDs on layer 0 are glowing faintly. I would be interested to know whether there is any sign of that on your cube, however faint
Yes I see the same thing as your image with the original V0_2 version but not with the corrected V0_2. With the corrected version the bottom leyer is completely off. Please ignore the original V0_2 as that version isn't correct. Just to make sure that we're on the same page regarding versions I've uploaded the corrected V0_2 that I posted previously in this thread to the software section of the forum and here's the test sketch I used to produce the image:


  1. #include "HC8x8x8Cube.h"
  2. #include "HC8x8x8_Cube_Patterns.h"
  3.  
  4. void setup()
  5. {
  6.   /* Initialises the cube library */
  7.   CubeInit();
  8. }
  9.  
  10. /* Main loop */
  11. void loop()
  12. {
  13.   Matrix_Buffer[2][0] = 0xFF;
  14.   Matrix_Buffer[2][1] = 0xFF;
  15.   Matrix_Buffer[2][2] = 0xFF;
  16.   Matrix_Buffer[2][3] = 0xFF;
  17.   Matrix_Buffer[2][4] = 0xFF;
  18.   Matrix_Buffer[2][5] = 0xFF;
  19.   Matrix_Buffer[2][6] = 0xFF;
  20.   Matrix_Buffer[2][7] = 0xFF;
  21.  
  22.   while(1);
  23. }


I will remove all of the LED slices except number 7 to make access easier and trace the connections from the microcontroller to the LED drivers

Whilst your checking the cube, and assuming you have a multimeter you may want check the following...

Setting it to resistance and with power to the cube removed check the resistance between the following pins:

U2 Pin 15......U5 Pin 21
U2 Pin 16......U5 Pin 4
U2 Pin 17......U5 Pin 2
U2 Pin 19......U5 Pin 3

U2 Pin 15......U6 Pin 21
U2 Pin 16......U6 Pin 4
U2 Pin 19......U6 Pin 3
U5 Pin 22......U6 Pin 2

U2 Pin 15......U7 Pin 21
U2 Pin 16......U7 Pin 4
U2 Pin 19......U7 Pin 3
U6 Pin 22......U7 Pin 2

U2 Pin 15......U8 Pin 21
U2 Pin 16......U8 Pin 4
U2 Pin 19......U8 Pin 3
U7 Pin 22......U8 Pin 2

Test between the legs of the actual ICs themselves just in case its a socket issue. I would expect to see about 1 Ohm between connection give or take. Although I would only bother going to this trouble if when running the corrected V0_2 it looks different to the picture I posted.
Comments made by this poster do not necessarily reflect the views of Hobby Components Ltd.

BobBurton
Posts: 34
Joined: Sat Jun 06, 2020 3:11 pm

Re: 8x8x8 cube problem

Post by BobBurton » Fri Aug 28, 2020 8:28 pm

I have still not found out why my cube is behaving differently than yours. All solder joints look OK and the resistances between the ICs that you suggested checking are all around 1 ohm

I have, however, managed to eliminate the ghosting another way.
The 3 to 8 decoder has 3 enable inputs, one tied to VCC and the others to GND. I have disconnected the enable input on pin 4 of the IC from the socket and connected it to pin D8 of the processor instead thus, enabling it to be controlled instead of being permanently enabled.

Then, in the library I have modified the 2 macros previously fixed so that they control the state of pin D8 (ironic or what ?)

Code: Select all

#define DRIVER_EN_HIGH PORTB |= 0b00000011
#define DRIVER_EN_LOW PORTB &= ~0b00000011
and added a pinMode() to setup() in my test sketch to define D9 as an OUTPUT

The result is to disable the output of the 3 to 8 decoder whilst the ISR is running. There is now no ghosting on inactive layers of the single LED grid that I currently have installed in my cube and no perceivable loss of brightness. I will install all of the slices tomorrow and test it some more

Post Reply

Return to “General Discussion”