Pages: 1 ... 13 14 [15] 16 17 ... 19   Go Down
Author Topic: Sure Electronics new 32x16 bi-color display: 3216 RG -Cont. from read only forum  (Read 59117 times)
0 Members and 1 Guest are viewing this topic.
Italy
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-roll-sweat 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:
Code:
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 smiley-eek 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!  smiley-grin)

« Last Edit: March 06, 2012, 06:57:58 pm by lonewolf » Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-sad  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

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

Transient Explorer
Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
Arduino rocks (by default)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

you can specify font by doing dotmatrix.setfont(n); where n is a number from the font.h file
Logged

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

Transient Explorer
Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
Arduino rocks (by default)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Mmmm, must have passed over that, thanks.
Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

Italy
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-lol 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!  smiley-eek
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 Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Code:
dotmatrix.setfont(FONT_5x7);
directly, the compiler will translate into the corresponding number for you  smiley-wink
Logged

Sunnyvale, CA
Offline Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley-lol 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!  smiley-eek
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 smiley
https://code.google.com/p/arduinoscope/
Logged

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

Offline Offline
Newbie
*
Karma: 0
Posts: 3
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Jr. Member
**
Karma: 0
Posts: 82
Arduino rocks (by default)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 Offline
Full Member
***
Karma: 0
Posts: 147
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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

My first major project (looking for people who would like to help contribute) Bluetooth Sure 32x16 LED Displays!: https://github.com/evanric

Italy
Offline Offline
Newbie
*
Karma: 0
Posts: 41
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

you could do what I'm about to do, make an oscilloscope out of an arduino smiley
https://code.google.com/p/arduinoscope/


Interesting  smiley-cool I have to try!
Logged

Transient Explorer
Offline Offline
Jr. Member
**
Karma: 0
Posts: 82
Arduino rocks (by default)
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

So I'm trying to add this function to my sketch:
Code:
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

Pages: 1 ... 13 14 [15] 16 17 ... 19   Go Up
Jump to: