Go Down

Topic: Sure Electronics new 32x16 bi-color display: 3216 RG -Cont. from read only forum (Read 100535 times) previous topic - next topic

Tim Gilmore

I also found a couple of small issues in the h1632_putchar routine that works much better now. Before I would have left over random colored LEDs in the last row of the text messages displayed. Now they are correct.

This
Code: [Select]
for (char row=0; row <7; row++) {
was changed to this:
Code: [Select]
for (char row=0; row <=7; row++) {

Also in the void line, it had byte declarations for x and y which caused displaying issues especially in the scrolling routine. However, changing it to integer fixed this (as changed previously in past coding).

However, I would like some assistance in cleaning up the coding for char c as my bitwise coding is lacking (as there has to be a cleaner way for this).


Code: [Select]
//void ht1632_putchar(byte x, byte y, char c, byte color=GREEN)
void ht1632_putchar(int x, int y, char c, byte color=GREEN)
{
 byte dots;
 //if (c >= 'A' && c <= 'Z' ||
 //  (c >= 'a' && c <= 'z') ) {
 //  c &= 0x1F;   // A-Z maps to 1-26
 //}
 //else if (c >= '0' && c <= '9') {
 //  c = (c - '0') + 27;
 //}
 //else if (c == ' ') {
 //  c = 0; // space
 //}
 
 if (c == ' ') {c = 0;}
 else if (c == '!') {c = 1;}
 else if (c == '"') {c = 2;}
 else if (c == '#') {c = 3;}
 else if (c == '$') {c = 4;}
 else if (c == '%') {c = 5;}
 else if (c == '&') {c = 6;}
 //else if (c == ''') {c = 7;}
 else if (c == '(') {c = 8;}
 else if (c == ')') {c = 9;}
 else if (c == '*') {c = 10;}
 else if (c == '+') {c = 11;}
 else if (c == ',') {c = 12;}
 else if (c == '-') {c = 13;}
 else if (c == '.') {c = 14;}
 else if (c == '/') {c = 15;}  
 
 else if (c >= '0' && c <= '9') {
   c = (c - '0') + 16;
 }
 
 else if (c == ':') {c = 26;}
 else if (c == ';') {c = 27;}
 else if (c == '<') {c = 28;}
 else if (c == '=') {c = 29;}
 else if (c == '>') {c = 30;}
 else if (c == '?') {c = 31;}
 else if (c == '@') {c = 32;}  
 
 else if (c >= 'A' && c <= 'Z') {
   c = (c - 'A') + 33;
 }
 
 else if (c == '[') {c = 59;}
 //else if (c == '\') {c = 60;}
 else if (c == ']') {c = 61;}
 else if (c == '^') {c = 62;}
 else if (c == '_') {c = 63;}
 else if (c == '`') {c = 64;}
 
 else if (c >= 'a' && c <= 'z') {
   c = (c - 'a') + 65;
 }
 
 else if (c == '{') {c = 91;}
 else if (c == '|') {c = 92;}
 else if (c == '}') {c = 93;}
 
 for (char col=0; col< 6; col++) {
   dots = pgm_read_byte_near(&my3font[c][col]);
   for (char row=0; row <=7; row++) {
     if (dots & (64>>row))       // only 7 rows.
       plot(x+col, y+row, color);
     else
       plot(x+col, y+row, 0);
   }
 }
}


Overall the coding is working very well (except for the scrolling is still a bit slow even with the digitalwritefast routines) now thanks to everyones help.

Here is the latest code for up to 4 working displays:

http://forums.parallax.com/showthread.php?128037-Sure-Electronics-new-32x16-bi-color-display-3216-RG&p=974131#post974131

Tim Gilmore

I was slightly mistaken about having no random pixels. The display first starts with a scrolling of text from right to left and then displays the multicolored larger sized "2011" in the first display. It then displays multicolored inidividual lettered static text message. This is pretty good other than I would like to see a faster scroll but it is not too bad.

The problem with the random pixels comes out when the program is looped and it runs again. First the scrolling message runs and no problems there. Then the display of the multicolored larger size "2011" causes some pixels to be off. Then the multicolored individual lettered static text message shows some letters to be missing some LEDs. It always has the same LEDs off everytime.

As a test, I ran the large "Arduino rocks" scroll across the 4 displays (and then the normal other scrolling message, 2011 message and colored text)... This time the "Arduino rocks" scroll (although somewhat slow but reasonably ok), is good until you see a couple of LEDs turn on on the 1st and 2nd display on the very top row. However, after this is done, the normal sized other scrolling message comes out fine with no pixel issues, and the 2011 message is GOOD this time as well as the colored text display (no missing LED pixels). I don't quite understand what is happening here but could be related to the shaddow ram.

Tim Gilmore

I created another version of the program with the 'DigitalWriteFast' library routines commented out and used direct port access to digital pins 6,7,8,9 and it worked to see if this would caused the scrolling message to be any faster. Unfortunately, it was not any noticibly faster and the work based off of this link: http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&p=706055  was used to figure out how to do the direct port access.

The new code is listed here:

http://forums.parallax.com/showthread.php?128037-Sure-Electronics-new-32x16-bi-color-display-3216-RG&p=974440#post974440

Since, it did not show much of an improvement, I think I may just go back to the easier to use 'DigitalWriteFast' library routines. We'll see.

Let me know what you think.

Thanks,

Tim

florinc

Tim,
I looked briefly at the code you posted and noticed that you can still improve on the speed by adding a few lines in function ht1632_plot:
Code: [Select]
  if (x<0 || x>=X_MAX || y<0 || y>=Y_MAX)
    return;
 
  if (color != BLACK && color != GREEN && color != RED && color != ORANGE)
    return;
 
  byte existingPixel = get_shadowram(x, y);
  if (existingPixel == color)
    return; // nothing to change;
...



Tim Gilmore

Florinc,

Im not a good C programmer yet and did not quite follow the example. However, I wanted to post my latest accomplishments of the 3216 RG with 8 displays running on a Teensy++2.0 (www.pjrc.com/teensy) with the code: http://forums.parallax.com/showthread.php?128037-Sure-Electronics-new-32x16-bi-color-display-3216-RG&p=976869#post976869

and YouTube video: http://www.youtube.com/watch?v=TqZTBoepZsY

Now if I we can figure out how to clear all of those LEDs that turn back on after they have been cleared.

Thanks for all of your help and to everyone!

More to come...

florinc

Tim, this is great achievement.
Quote
with 8 displays

Did you mean 4 displays?

tdg8934

Florinc,

The code shows 2 sets of 4 pins used (8 total) for the Teensy++ 2.0. I have 2 sets of 4 displays or 8 total with the Teensy++ 2.0. The Teensy++ 2.0 has the DigitalWriteFast built in as the DigitalWrite standard command as seen on the Arduino (but it is much faster on the Teensy++ 2.0 than if using the Arduino). The hard part was cutting the lower 4 PCB tabs off on the Top 4 displays and cutting off the upper 4 PCB tabs on the bottom 4 displays with my Dremmel tool. This way they could fit together as an upper set of 4 displays against a lower set of 4 displays. I used strong velcro tape to hold them together in the middle. Screws to the aluminum case lid on the other ends. I have a smokey glass cover to allow it to be seen in all lighting conditions. This has been sealed with liquid nails clear sealant from Home Depot. When finished, the display cover will go over the aluminum enclosure I had custom built from a guy in OH.

florinc


Tim Gilmore

Florinc,

I see that I signed on before as tdg8934 which has an old email linked to it.

Anyway... I am using a 5vdc 20amp p/s I bought on eBay. I doubt I'm drawing that much current yet. However, I plan to ultimately use a much smaller power supply of 5vdc @ 25 amps (to be mounted inside the enclosure) that is inexpensive from Sure Electronics.

Tim

Phoenix_

Hi!

Nice work! I bought two green 3208 modules (NOT 0832) and managed to get the leds (well, at least a part of them) to light up using the HT1632_5 code from Tim Gilmore's link. I did some modifications because these use the old method to select the chip. I removed the PulseClk and altering ChipSelect (and the output function, OutputA_74164_2 addresses cs2 pin):
Code: [Select]
void ChipSelect(int select)
{
 unsigned char tmp = 0;
 if (select < 0) { // Enable all HT1632C
   OutputA_74164(0);
   OutputA_74164_2(0);
   
 } else if(select==0) { //Disable all HT1632Cs
   OutputA_74164(1);
   OutputA_74164_2(1);
   
 } else if(select==1) { //Disable all HT1632Cs
   OutputA_74164(0);  
   
 } else if(select==2) { //Disable all HT1632Cs
   OutputA_74164_2(0);
   
 } else {
   OutputA_74164(0);
   OutputA_74164_2(0);
 }
}


Basically it just writes low to cs or (now added) cs2 pin, depending on the input. I also altered the definitions:
Code: [Select]
#define Number_of_Displays 2
#define CHIP_MAX 1*Number_of_Displays //Four HT1632Cs on one board
#define X_MAX 32*Number_of_Displays -1
#define Y_MAX 7


I can now see the demo displaying some random pixels. Scrolling etc seems to work. I uploaded a short video of the action: http://www.flickr.com/photos/phoenix__/5454150661/ Apparently the 3216 uses different addressing for the matrix, as one HT1632C handles just a part of the matrix. These 3208s only have one chip each. I guess I could use the code as it is by changing the addressing and using only green colour, but could somebody point me in the right direction what to do next? The data sheet for the 3208 modules in question can be found here: http://www.sure-electronics.net/download/down.php?name=DE-DP13211_Ver1.0_EN.pdf I have really no clue, took me ages to even get these to light up at all.. I included my modified code as an attachment. Sorry again and pardon my bad English.

Tim Gilmore

Phoenix,

It looks like Sure Electronics has come out with a replacement board 3208 for their flatter display 0832. This code for this forum uses a different bi-color board called the 3216 RG. Although all 3 of these boards (3216 RG, 0832 and the new 3208) uses the HT1632C chip, the 3216 board has a chip select circuit (74HC164 chip) that is not on the 0832 nor the 3208 boards. It would be much easier to think of the 3208 as an 0832 board as there are lots of code examples for the 0832. You should probably first look at the Miles Burton Library which works well with the 0832 and Sure Electronics 2416 displays. Here is the link: http://milesburton.com/index.php/Arduino_&_the_Sure_2416_Information_Display

Good luck.

Tim Gilmore

Here is my latest modification which adds a PS2 Keyboard to the Teensy++ 2.0 and display.

http://forums.parallax.com/showthread.php?128037-Sure-Electronics-new-32x16-bi-color-display-3216-RG&p=978290#post978290

Something I don't like about it is after you Compile it, and press the Teensy++ 2.0 reset, you have to open the Arduino "Serial Monitor" before the PS2 keyboard entries will display correctly. However, I would like to get some help with the C coding to figure out how to change colors per letter, word, etc. and adding in PS2_BACKSPACE coding would be nice too. I got the PS2 information from here: http://www.pjrc.com/teensy/td_libs_PS2Keyboard.html

Let me know what you think.

Tim

kjus

Hi,

Here is a version (based in HT1632_7.zip from the parallax forum), which much improves the speed of the display. It achieves 62fps with two displays, and all pixels changing between two frames (the worst case).

Changelog against ht1632_kjus_1.zip posted in parallax forums:

* March 2011, kjus - more speed improvements
*   - Major speedup by always updating all pixels controlled by a single chip.
*     This can be done be sending in a stream all 4-bit words for the display area
*     controlled by a chip, from address 0 to 63. This way we avoid having to resend
*     the write command and the address each time we want to write a byte.
*   - Use bytes in relevant places (in particular, ht1632_get_chip) which allows
*     gaining 10 fps.
*   With two screens, and updating all pixels at each frame (the worst case), this
*   code achieves 62 fps with an arduino mega2560.
*   Note: These changes improve the raw display speed (i.e. ht1632_shadowram_plot() and
*         ht1632_update_display()). Not much attention was given to higher level functions
*         (scroll text, scroll bitmap..), and there are huge room for improvement there.
* Based from code HT1638_7.zip from:
* http://forums.parallax.com/showthread.php?128037-Sure-Electronics-new-32x16-bi-color-display-3216-RG
***********************************************************************/

Tim Gilmore

kjus,

Nice work on the code updates. I did run a test of your code with an Arduino with 2 displays and saw the 62 fps with a smoother faster scrolling. I then changes the number of boards from 2 to 4 and it changed (as expected) to 31 fps with a much slower but still 'ok' scroll.

I then used a Teensy++ 2.0 which has the DigitalWriteFastNoCheck and pinModeFast2 features built in as the normally listed digitalWrite and pinMode commands. I could not get it to work on the Teensy++ 2.0 using the digital WriteFastNoCheck and pinModeFast2 commands as seen from the digitalWriteFast.h file. What I saw using the digitalWrite and pinMode commands on the Teensy++ 2.0 was basically the same as the digitalWriteFastNoCheck and pinModeFast2 commands as seen on the Arduino (a speed of 31 fps with 4 displays).

So using the digitalWriteFast.h with an Arduino with your code is the same as not using it on the Teensy++ 2.0 with the expected frames per second being 62 fps for 2 displays and 31 fps for 4 displays.

Nice work.

Tim

vadimr


Hi,

Here is a version (based in HT1632_7.zip from the parallax forum), which much improves the speed of the display. It achieves 62fps with two displays, and all pixels changing between two frames (the worst case).

Changelog against ht1632_kjus_1.zip posted in parallax forums:

* March 2011, kjus - more speed improvements
*   - Major speedup by always updating all pixels controlled by a single chip.
*     This can be done be sending in a stream all 4-bit words for the display area
*     controlled by a chip, from address 0 to 63. This way we avoid having to resend
*     the write command and the address each time we want to write a byte.
*   - Use bytes in relevant places (in particular, ht1632_get_chip) which allows
*     gaining 10 fps.
*   With two screens, and updating all pixels at each frame (the worst case), this
*   code achieves 62 fps with an arduino mega2560.
*   Note: These changes improve the raw display speed (i.e. ht1632_shadowram_plot() and
*         ht1632_update_display()). Not much attention was given to higher level functions
*         (scroll text, scroll bitmap..), and there are huge room for improvement there.
* Based from code HT1638_7.zip from:
* http://forums.parallax.com/showthread.php?128037-Sure-Electronics-new-32x16-bi-color-display-3216-RG
***********************************************************************/


Hi,

Thank you very much for providing this code, it works great. I currently only have 5 display and been playing around with it and so far so good.
I do have one problem, the htl632_clear does not seem to work correctly. It seems to clear the screen temporaryly but when the next function is executed and begins to write something to the screen whatever it is not overwriting remains on the screen. Unfortantly my programming skills are a bit low and I was wondering if you can take a look?

Thanks,
Vadim

Go Up
 


Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

Arduino
via Egeo 16
Torino, 10131
Italy