Italy
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #210 on: March 06, 2012, 06:52:27 pm » |
With the last commit of the library code I done an ultimate cleanup of the code. And some speedup. Moreover I found a middle way between don't using cpp macros anymore with complicated definitions in ht1632.h and an acceptable loss of performance. Now the benchmark can reach 136 fps (leaving the define USE_NLFB and USE_ASM in ht1632.h). As you can see in ht1632.cpp I wrote some assembler code from low level bit banging. Respect to C code, you can avoid some repetitive operations (I analyzed the compiled assembler code with avr-objdump). My concern is make the library working with > 2 displays. Thanks to Evanrich, I have got a third 3216 display. But I'm noticing enigmatic issues: maybe hardware problems with > 2 displays cascades... (just connecting the third display, the second display stop working  I'm waiting for someone here lending me a logic analyzer or an oscilloscope...) NB: There is a little change in instantiang the class ht1632c(): the first parameter now is a pointer to port address. eg: ht1632c dotmatrix = ht1632c(&PORTD, 7, 6, 4, 5, GEOM_32x16, 2); Can you test the actual code with 3-4 displays to confirm or to controvert what it's occurring to me? As promised long time ago, I have the fancy to port the library to other "Arduinos"... I have a ChipKit Uno32 (PIC32) and already done a test with a scratch code (absolutly not optimized) and reached the astonishing speed of 480fps with two displays  Due to weird hardware design pin numbers, pin bitmasks and pin<--->port correspondence aren't consistent as in the original AVR Arduino... so the low level code is really difficult to optimize... (...after I leaned AVR assembler, it will be an opportunity to learn PIC32 assembler too!  )
|
|
|
|
« Last Edit: March 06, 2012, 06:57:58 pm by lonewolf »
|
Logged
|
|
|
|
|
Sunnyvale, CA
Offline
Full Member
Karma: 0
Posts: 139
|
 |
« Reply #211 on: March 09, 2012, 06:31:21 pm » |
Excellent news! I'll try and give it a try this weekend, I've been busy collecting parts to build my bluetooth controller for these boards, recieved solder stencils the other day, just waiting on about 4 more things before i can put them in the toaster. I also discovered a possible design problem in my controller, I built it to handle only about 1A, but 3-4 displays will require 2-4A, so I'm working on a different layout that can use a larger capacity battery. I'm about 1/3 done building my custom 9616 display, I'll attempt the code on the 3 displays I've got on hand in the mean time while I continue building. 384x 0603 resistors and 12x 52 pin TQFP's are painful to hand-solder  not to mention that I'm checking every connection by multimeter by hand before soldering the displays in. Needless to say, I will not be building multiples of these displays.
|
|
|
|
|
Logged
|
|
|
|
|
Sunnyvale, CA
Offline
Full Member
Karma: 0
Posts: 139
|
 |
« Reply #212 on: March 12, 2012, 09:33:02 pm » |
good news! Tested your code, and it works for 3 displays. I can't really tell a speed increase or not, but with 3 panels it scrolls across all 3 in the correct order, and the issue with the dots trailing the text when scrolling right is gone as well! Congrats!
Now for the bad news. I completed a third of my custom 9616 board, and after soldering in the remaining 8 HT1632C's and testing the next third, I had issues. The 2nd and 3rd set of LEDs don't light up. I've been trying to troubleshoot for the last few hours, and this is what I've come to figure out so far:
* Data, WR, and CLK are all connected correctly between HT1632C and each section of board (tested with continuity meter across various pins. * Data seems to be passing across all pins correctly, as I can get tones when the connection goes through * HT1632C chips all have +5V going to the correct pins
I'm not sure what the issue is, without a logic probe or o-scope, its gonna be hard to troubleshoot. Right now, I'm thinking one of two things. Either the 8 remaining HT1632C chips are all bad (unlikely) or something with DATA,WR, or CLK is not correct. The connections are all fine, so that narrows it down to the 74HCT164D and 74HCT04D chips between the sections. I'll try to get a logic analyzer or oscope at work and do some checking...other than that, I'm confused.
anyway congrats on the library!
|
|
|
|
|
Logged
|
|
|
|
|
Transient Explorer
Offline
Jr. Member
Karma: 0
Posts: 82
Arduino rocks (by default)
|
 |
« Reply #213 on: March 13, 2012, 02:16:36 pm » |
Have you guys put a font selection in the library? From what I've seen it looks like you have to set it in the library if you want to change it. I was going to add that in if you haven't.
|
|
|
|
|
Logged
|
|
|
|
|
Sunnyvale, CA
Offline
Full Member
Karma: 0
Posts: 139
|
 |
« Reply #214 on: March 13, 2012, 03:15:14 pm » |
you can specify font by doing dotmatrix.setfont(n); where n is a number from the font.h file
|
|
|
|
|
Logged
|
|
|
|
|
Transient Explorer
Offline
Jr. Member
Karma: 0
Posts: 82
Arduino rocks (by default)
|
 |
« Reply #215 on: March 13, 2012, 03:30:52 pm » |
Mmmm, must have passed over that, thanks.
|
|
|
|
|
Logged
|
|
|
|
|
Sunnyvale, CA
Offline
Full Member
Karma: 0
Posts: 139
|
 |
« Reply #216 on: March 13, 2012, 03:40:24 pm » |
Take a look at the ht1632c.h file for the #'s, for example, FONT_4x6 is #1, 8x8 is 16, etc... so if you wanted a 4x6 font, type dotmatrix.setfont(1);
|
|
|
|
|
Logged
|
|
|
|
|
Italy
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #217 on: March 13, 2012, 05:03:18 pm » |
good news! Tested your code, and it works for 3 displays. I can't really tell a speed increase or not, but with 3 panels it scrolls across all 3 in the correct order, and the issue with the dots trailing the text when scrolling right is gone as well! Congrats!
This is a really good news for me  I cannot get rid of the issue with 3 panels. It doesn't seems to be an hardware problem: the same code perfectly works with 3 display in ChipKIT Uno32!  Nobody here lent me an oscilloscope... the thing I should try is to add pullup resistors at least on CS and CLK (the issues w/ > 2 panels is related to chip selection thru 74164, not the ht1632c themselves).
|
|
|
|
|
Logged
|
|
|
|
|
Italy
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #218 on: March 13, 2012, 05:05:43 pm » |
Take a look at the ht1632c.h file for the #'s, for example, FONT_4x6 is #1, 8x8 is 16, etc... so if you wanted a 4x6 font, type dotmatrix.setfont(1);
...or you can use dotmatrix.setfont(FONT_5x7); directly, the compiler will translate into the corresponding number for you 
|
|
|
|
|
Logged
|
|
|
|
|
Sunnyvale, CA
Offline
Full Member
Karma: 0
Posts: 139
|
 |
« Reply #219 on: March 13, 2012, 06:09:55 pm » |
good news! Tested your code, and it works for 3 displays. I can't really tell a speed increase or not, but with 3 panels it scrolls across all 3 in the correct order, and the issue with the dots trailing the text when scrolling right is gone as well! Congrats!
This is a really good news for me  I cannot get rid of the issue with 3 panels. It doesn't seems to be an hardware problem: the same code perfectly works with 3 display in ChipKIT Uno32!  Nobody here lent me an oscilloscope... the thing I should try is to add pullup resistors at least on CS and CLK (the issues w/ > 2 panels is related to chip selection thru 74164, not the ht1632c themselves). you could do what I'm about to do, make an oscilloscope out of an arduino https://code.google.com/p/arduinoscope/
|
|
|
|
|
Logged
|
|
|
|
|
Offline
Newbie
Karma: 0
Posts: 3
|
 |
« Reply #220 on: March 14, 2012, 02:52:01 pm » |
Dear all,
What a great work you have done. I am trying to build a project to with 2 sure electronica 32X16 5mm displays. Where can i find the best and latest library for the display. I couldn´t find it on the other pages.
thanks in advance
Best regards
|
|
|
|
|
Logged
|
|
|
|
|
Transient Explorer
Offline
Jr. Member
Karma: 0
Posts: 82
Arduino rocks (by default)
|
 |
« Reply #221 on: March 14, 2012, 03:01:23 pm » |
Check out evanrich's page on github. He's got it linked under all of his posts, or use this https://github.com/evanrich/Bluetooth-LED-Sign. You can find the files on the google page for the ht1632c library page here: http://code.google.com/p/ht1632c/source/browse/. The library uploaded there seems current, and is what I'm using.
|
|
|
|
|
Logged
|
|
|
|
|
Sunnyvale, CA
Offline
Full Member
Karma: 0
Posts: 139
|
 |
« Reply #222 on: March 15, 2012, 12:44:56 pm » |
thanks for the plug double daffy. I'm basically mirroring the code from lonewolf's googlecode page, whenever he updates his code I plug it into my project and update my git repo, so either location works. If you look at my git code though you can see how to use it.
|
|
|
|
|
Logged
|
|
|
|
|
Italy
Offline
Newbie
Karma: 0
Posts: 41
|
 |
« Reply #223 on: March 17, 2012, 02:47:31 pm » |
Interesting  I have to try!
|
|
|
|
|
Logged
|
|
|
|
|
Transient Explorer
Offline
Jr. Member
Karma: 0
Posts: 82
Arduino rocks (by default)
|
 |
« Reply #224 on: March 19, 2012, 02:39:03 pm » |
So I'm trying to add this function to my sketch: void Displayer(char *text, int y=0, boolean xcentered=false, int x=0, int delaytime=25, int times=1, int color=1, boolean ycentered=true){ //Determine Font with int len = strlen(text); int textlength=fontwidth*len; if(xcentered==true){ x=round((max_x-textlength)/2); } if(ycentered==true){ y=mid_y; } if(textlength>max_x){ dotmatrix.hscrolltext(y, text, color, delaytime, times); }else{ StaticText(x,y,text,color,fontwidth); } x=0; y=0; } void StaticText(int x, int y, char *text, byte color, byte w){ int len = strlen(text); for (int i = 0; i < len; i++){ dotmatrix.putchar(x + w * i, y, text[i], color); } dotmatrix.sendframe(); } which basically just decides to scroll the text if it's too long for the display setup (depending on the # of modules used). I haven't had to prototype any of my functions before, but the compiler has a problem with this one. Any idea why it wants me to prototype this one? Is it because of the default values? Thanks Oh, and let me know if this is too out of context and you need more code.
|
|
|
|
« Last Edit: March 19, 2012, 02:40:34 pm by doubledaffy »
|
Logged
|
|
|
|
|
|