Sure Electronics new 32x16 bi-color display: 3216 RG -Cont. from read only forum

I just submitted major updates to the repository. The library contains fixes and optimizations to the "old" code, and the alpha hw SPI code (to be tested, optimized, documented).
The "demo" now run a more accurate benchmark (method profile(), attribute fps)... unfortunaly the older benchmark code overestimated the fps speed :cold_sweat: Now I can reach 99fps with newest optimizations, using 2 x 3216 boards. The good news is that the new benchmark is really precise, you can see changes of 1 fps inserting some asm ("nop") in the code.

lonewolf,

Do you know if the code will scale linearly scale with frequency? if you run an arduino at 20mhz, would you get 25% more fps out of the displays? I'm looking to run my project at 20mhz to get the text as smooth as possible, as with 2+ displays and a large font it slows down a tiny bit

Will get the 3rd display mailed out to you tomorrow!

evanrich:
lonewolf,

Do you know if the code will scale linearly scale with frequency? if you run an arduino at 20mhz, would you get 25% more fps out of the displays? I'm looking to run my project at 20mhz to get the text as smooth as possible, as with 2+ displays and a large font it slows down a tiny bit

Will get the 3rd display mailed out to you tomorrow!

Yep, the code will scale linearly. But don't worry: tomorrow I found a way to gain further 15% speed. Using two separate framebuffers for green and red planes is possibile to avoid some math with addresses in sendframe() and plot(). I'm deeply testing the code, then I'll release it on the repository.

Thank for the display :grin:

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 :cold_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: 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 :astonished: 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! :D)

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 :frowning: 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.

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!

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.

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

Mmmm, must have passed over that, thanks.

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);

evanrich:
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 XD 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! :astonished:
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).

evanrich:
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 :wink:

lonewolf:

evanrich:
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 XD 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! :astonished:
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 :slight_smile:
https://code.google.com/p/arduinoscope/

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

Check out evanrich's page on github. He's got it linked under all of his posts, or use this GitHub - evanrich/Bluetooth-LED-Sign: Control either custom built LED matrix signs (HT1632C drivers) or Sure 3216 displays via bluetooth from PC or android phones. Includes .NET app, Android Code, Schematics, and more..

You can find the files on the google page for the ht1632c library page here: GitHub - wildstray/ht1632c: HT1632C dotmatrix display library for Arduino (and AVR/ARM/PIC clones). The library uploaded there seems current, and is what I'm using.

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.

evanrich:
you could do what I'm about to do, make an oscilloscope out of an arduino :slight_smile:
Google Code Archive - Long-term storage for Google Code Project Hosting.

Interesting 8) I have to try!

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.

It's a good practice to declare the functions in the header file. Sometimes, for compilation reasons, these function declarations are mandatory.

Hi all i am fairly new to arduino and i have an arduino uno R3 and the 32x16 matrix from sure electronics.

I used tihs code: Google Code Archive - Long-term storage for Google Code Project Hosting....

I tried this post

Re: SureElectronics 3216 Led Matrix
Reply #26 - 20.12.2010 at 13:38:08
florinc,

I tried your code and it did nothing that I could see. I am using the latest Arduino 021 environment. I connected the pins as follows:

ht1632_data = 6; // Data pin (pin 7 of display connector)
ht1632_wrclk = 7; // Write clock pin (pin 5 of display connector)
ht1632_cs = 8; // Chip Select (pin 1 of display connnector)
ht1632_clk = 9; // clock pin (pin 2 of display connector)
and POWER 5V to (pin 16 of the display connector)
and POWER GND to (pin 15 of the display connector)

I am using USB for power to my Arduino Duemilanove w/328 also.

I did a 'Verify/Compile' command in the Arduino 021 environment displaying a Binary sketch size: 3950 bytes and also did a 'Upload' and the RX TX LEDS on the Arduino were turning on and off as they should during the upload but nothing was displayed.

I also used 2 different known working connectors and neither work in this setup with the display being blank.

From what I can tell from your code, it looks like the Void demo_filler() routine should be running in a loop.

Is there anything I am missing here?

Thanks again!

But i get this error:

HT1632.cpp:12:22: error: WProgram.h: No such file or directory
HT1632.cpp: In function 'void ht1632_putchar(byte, byte, char, byte)':
HT1632.pde:-1: error: 'myfont' was not declared in this scope

Edit: I found solution for HT1632.cpp:12:22: error: WProgram.h: No such file or directory

WProgram.h had to be Arduino.h

I do not know where to start/look for the problem.
Can someone please help me?

Thanks!