Sunday, March 6, 2011

Project 19 - LED dot Matrix Display - Part 2

I ended up using a set of headers to raise the 8x8 display about .5cm off the breadboard... it was just enough to allow me to use my jumper wires (the non-flexible ones).

My next task was to upload the Project 19 code... I did that and only the top row of the display lit up... and it was very faint. Not sure what was going on, I took off the display and went to work checking all my wiring. The next time testing the display... still no luck.

It occurred to me that the only difference between Project 19 and the previous Project 18 was I was simply dealing with more LEDs. I had a hunch, so I loaded up the Project 18 code and wouldn't you know it... the display worked great! Watch the video - just pay attention to the top row and nothing else... you can see that it starts out with all LEDs lit up (value 255) and then counts down in binary to 0...

So, a few things here - (1) my wiring must be at least partially correct or I wouldn't have that kind of behavior and (2) because you can almost see the pattern in the vertical (column) orientation as well (watch the last column in the video - farthest from the left), I believe that both 595 chips are working properly.

So... why isn't the code for Project 19 working? Not sure... I downloaded the TimerOne library, created the TimerOne folder, and put the files in it... no errors found when the code downloads, so it must be finding the library, right?

I'm not sure where to go here - I'm wondering if there might be something wrong with the author's code... I doubt it, because so far all the programs appear to have been well tested and I can't imagine a tech editor for this book not verifying all the programs and that they work. One issue I did have was that the author uses TimerOne for the library name but you can see "Timer1.xxxx" in the code... I'm not thinking this is an issue, but I can't say for certain.

Any ideas? I'm going to go and check my wiring one more time, but I just can't see that being the issue.

7 comments:

  1. Well, I just breadboarded the same project and came up with the same problem. I just seem to get the entire row number one group of LED lighting up and flashing but nothing else happens. I tried loading the source code for project 18 and came up with exactly the same results as you did. I went ahead and loaded the code for project 20 (Scrolling Sprite) and it works just fine! Very perplexing. So, I suspect there is something wrong with the project 19 code (there are plenty of other typo errors in my book so wouldn't be surprising if something is off in Mr. McRoberts text for this project. Unfortunately the code is just too complex for me to debug (I'm just a newbie). Your video is a great example of the problem so I'll try emailing the link to Michael McRoberts at sales@earthshineelectronics.com and see if he responds. I should just stop obsessing on this and move on!

    ReplyDelete
  2. I'm having exactly the the same problem and I get the same results that you have described. Did you try loading the code for project 20 (Scrolling Sprite)?. It seems to work fine, so I think my circuit must be breadboarded correctly and functioning properly. This implies that there is something wrong with the code for project 19. I emailed the author of Beginning Arduino about this. Maybe he'll have a solution.

    ReplyDelete
  3. Michael McRoberts was kind enough to respond to my email. There is an error in the code.
    row = row << 1 // bitshift left

    should be


    row = row >> 1 // bitshift right

    ReplyDelete
  4. Actually, you're missing the semicolon :) row = row >> 1; // bitshift right

    I rewired the thing three times and was pulling my hair out, so thanks very much for this blog and thanks to EJB for finding out the problem. I was a about to give up.

    ReplyDelete
  5. THANK YOU FOR THIS!

    This was a life saver. I resorted to moving on, but like any mission left incomplete, it was always on my mind. Thanks again.

    ReplyDelete
  6. jjp
    Hi,
    I am having exactly the same issue with project 19..Project 18 seems to count as yours did but 20 does not appear to work either...Possibly a timerone problem for me..How exactly did you download and install it??? Mine was version 9..Extracted and put into the libraries folder as mentioned in the book..
    PS i tried the bitshift change but it did not help
    Thanks for your help..
    jjp

    ReplyDelete
  7. If anybody is still checking in on this blog and particularly project 19 I recommend that you go over to the following blog:

    http://mindovermaterial.wordpress.com/2012/07/17/beginning-arduino-project-19-led-dot-matrix-basic-animation/#comment-33

    They have fully explained this project and why we were having problems with it. The author re-wrote the project code as well as fixing the books code.

    slf

    ReplyDelete