Pages: [1] 2 3 ... 19   Go Down
Author Topic: Sure Electronics new 32x16 bi-color display: 3216 RG -Cont. from read only forum  (Read 58804 times)
0 Members and 2 Guests are viewing this topic.
0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Here is the "old" read only forum link to be used as reference to continue discussions about the Sure Electronics 3216 RG display (both 3 and 5 mm versions):

http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1292604415/0

Here are the Sure Electronic links on where to purchase them:

3mm: http://www.sureelectronics.net/goods.php?id=1095

5mm: http://www.sureelectronics.net/goods.php?id=1122

Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I ordered the remaining 6 additional P7 (5mm LED version) 3216 RG displays this week to complete my 2 sets of 4 (8 total) display. I hope that a single Arduino can handle this many displays.

[1][2][3][4]
[5][6][7][8]

How do I program in a configuration like this with 2 sets of 4 displays (as far as the clocking, etc.)?
Logged

Milano, Italy
Offline Offline
Faraday Member
**
Karma: 11
Posts: 3091
Sideralis Arduino!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the library for the green version fully working?
Logged

Federico - Sideralis
Arduino &C: http://www.sideralis.org
Foto: http://blackman.amicofigo.com

São Paulo/SP/Brazil
Offline Offline
Sr. Member
****
Karma: 2
Posts: 305
Brazilian Arduino Team
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Is the library for the green version fully working?

I don't know! We are using a different type of LED Matrix that has dual-color leds.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wagner,

Can you look over the latest code again? As you stated earlier, I did make the change here: #define X_MAX 32*Number_of_Displays -1

I have added 2 additional displays (total of 4) and if I set #define Number_of_Displays 6 I can sort of see the display on all four of them but the scrolling routine is spliting the message in half. The bottom half of the message is scrolling across the top of the displays while the top half of the message is scrolling across the bottom of the displays. Something is wrong with the clocking or something and it is messed up with any displays more than 2 connected. If I use, #define Number_of_Displays 4 or #define Number_of_Displays 3 the 4th display is not even turned on.

Here is the non-working code for 4 displays: http://forums.parallax.com/showthread.php?128037-Sure-Electronics-new-32x16-bi-color-display-3216-RG&p=973058#post973058


Logged

São Paulo/SP/Brazil
Offline Offline
Sr. Member
****
Karma: 2
Posts: 305
Brazilian Arduino Team
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Tim,

I looked to your code but I didn't see anything unusual. It's very difficult to debug without 4 displays here(I have only 2).

So, I'm figuring out. This code:
Code:
if (x>=32) {
    nChip = 3 + x/16 + (y>7?2:0);
  } else {
    nChip = 1 + x/16 + (y>7?2:0);
  }
has to be tweeked as you have more chips on 4 displays and you have to calculate nChip for x>=64 and x>=96.
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wagner and others,

I have the code working for 3 and 4 displays EXCEPT I see some random pixels in the last collumn of the first quadrant of displays 3 and 4.

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

Code:
#define Number_of_Displays 4
#define CHIP_MAX 4*Number_of_Displays //Four HT1632Cs on one board
#define X_MAX 32*Number_of_Displays -1
#define Y_MAX 15

Code:
//if (x>=32) {
//  nChip = 3 + x/16 + (y>7?2:0);
//} else {
//  nChip = 1 + x/16 + (y>7?2:0);
//}
 
  if (x>=96) {
    nChip = 7 + x/16 + (y>7?2:0);
  }
  else if (x>=64) {
    nChip = 5 + x/16 + (y>7?2:0);
  }   
   else if (x>=32) {
    nChip = 3 + x/16 + (y>7?2:0);
  } 
  else {
    nChip = 1 + x/16 + (y>7?2:0);
  }

Any ideass on what to do about the random pixels ?
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wagner and others,

I found another bug but this did not fix the random pixel issue but did somewhat clear up some clearing issues better than before.

When the Number_of_Displays was 2, it was ok but if Number_of_Displays increases then it affects the value of CHIP_MAX:

Code:
#define Number_of_Displays 4
#define CHIP_MAX 4*Number_of_Displays //Four HT1632Cs on one board
#define X_MAX 32*Number_of_Displays -1
#define Y_MAX 15

CHIP_MAX was used as a value of 8 (when you have 2 displays), but with 4 displays, then the value of CHIP_MAX increases to 16.

Code:
/*
 * ht1632_clear
 * clear the display, and the shadow memory, and the snapshot
 * memory.  This uses the "write multiple words" capability of
 * the chipset by writing all 96 words of memory without raising
 * the chipselect signal.
 */
void ht1632_clear()
{
  char i;
  //for (int i=1; i<=CHIP_MAX; i++)
  for (int i=1; i<=8; i++)
  {
    ChipSelect(-1);
    ht1632_writebits(HT1632_ID_WR, 1<<2);  // send ID: WRITE to RAM
    ht1632_writebits(0, 1<<6); // Send address
    for (i = 0; i < 96/2; i++) // Clear entire display
      ht1632_writebits(0, 1<<7); // send 8 bits of data
    ChipSelect(0);

    for (int j=0; j < 64; j++)
      ht1632_shadowram[j][i] = 0;
  }
}

However, Shadowram cant be higher than 64 x 8 but this would make it 64x16 causing issues.

Code:
byte ht1632_shadowram[64][4*2] = {0};

What do you think?
Logged

São Paulo/SP/Brazil
Offline Offline
Sr. Member
****
Karma: 2
Posts: 305
Brazilian Arduino Team
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
What do you think?

I really don't know. shadowRam is a "copy" of ht1632c memory. maybe the code is not working as expected, you need to debug and understand better how the bitwise operations work and simmulate on paper to see what's wrong.

I'm telling to you but I have this difficult too. It's very, VERY hard to me to find out what's happening with these bitwise operations on shadowRam.
Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 39
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

@Tim Gilmore,
However, Shadowram cant be higher than 64 x 8 but this would make it 64x16 causing issues.

Code:
byte ht1632_shadowram[64][4*2] = {0};

What do you think?

Did you try to change data type from byte to int, i.e. int ht1632_shadowram.., because byte is only until 255 and you would have higher values with 64x16. Maybe you should change all values from byte to int.

I hope this helps.

Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Wagner,

Thanks for your help on this. All I was saying about the shadowram was that their was an inconsistancy I saw if the value of Number_of_Displays gets changed from 2 to something else.

If Number_of_Displays was to stay at 2, then the following would occur:

Code:
#define Number_of_Displays 2
#define CHIP_MAX 4*Number_of_Displays //Four HT1632Cs on one board
#define X_MAX 32*Number_of_Displays -1
#define Y_MAX 15

CHIP_MAX would have a value of 4*Number_of_Displays being 8.

But later in the program Shadowram is a 2 dimensional array of [64][4*2].
Code:
byte ht1632_shadowram[64][4*2] = {0};

Further in the program in the HT1632_Clear routine, Shadowram is now set by the value of CHIP_MAX and if CHIP_MAX is 8 then the 2nd array [4*2] is ok but if CHIP_MAX gets changed to 16 because the Number_of_Displays get's is now 4, this will make CHIP_MAX's value 4*4 or 16. 16 does not match up to the original byte declaration of

Code:
byte ht1632_shadowram[64][4*2] = {0};
as seen below in CHIP_MAX. I hope this makes sense. So all I am saying is that in the HT1632_Clear routine, that it needs not to use the value of CHIP_MAX in the counter routine of 'i'.

Code:
void ht1632_clear()
{
  char i;
  //for (int i=1; i<=CHIP_MAX; i++) COMMENT OUT THIS LINE AND REPLACE WITH LINE BELOW SO i GOES to 8 and not the CHANGED VALUE OF CHIP_MAX WHICH COULD BE 16 NOW
  for (int i=1; i<=8; i++)
  {
    ChipSelect(-1);
    ht1632_writebits(HT1632_ID_WR, 1<<2);  // send ID: WRITE to RAM
    ht1632_writebits(0, 1<<6); // Send address
    for (i = 0; i < 96/2; i++) // Clear entire display
      ht1632_writebits(0, 1<<7); // send 8 bits of data
    ChipSelect(0);

    for (int j=0; j < 64; j++)
      ht1632_shadowram[j][i] = 0;
  }
}


Just a small point I wanted to make, thats is all.

Thanks.

My real issue with with the random pixels.

Tim.











« Last Edit: February 04, 2011, 05:31:37 am by Tim Gilmore » Logged

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I did not have a chance to play with 2 displays yet, maybe this weekend.

This is the idea behind the shadow ram data structure: you need 64 bytes for each individual HT1632 chip, used as a duplicate of the "video" memory of the chip (to get easier and faster access to the video memory, basically).

Code:
byte ht1632_shadowram[64][4] = {0};
defines the shadow ram for one 3216 display (with 4 chips).

To define the shadow ram for 2 displays, I would use either something like Tim's definition
Code:
byte ht1632_shadowram[64][4*2] = {0};
or
Code:
byte ht1632_shadowram[64][4][2] = {0};

For 8 displays, this would extend to:
Code:
byte ht1632_shadowram[64][4][8] = {0};


« Last Edit: April 13, 2011, 08:57:44 pm by florinc » Logged

São Paulo/SP/Brazil
Offline Offline
Sr. Member
****
Karma: 2
Posts: 305
Brazilian Arduino Team
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

florinc,

I'm reading the ht1632c datasheet http://www.holtek.com/pdf/consumer/1632cv100.pdf and on display memory(page 5) you can see that it only has 32 x 8 bytes, so why are you using [64][4]?

I saw on previous codes that they double to 64 to make a "snapshot" memory to manipulate before send all to display but if you do not use the matrix this way you can save half of your RAM memory.
Logged

0
Offline Offline
Edison Member
*
Karma: 8
Posts: 1411
Arduino rocks
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

From what I remember, the lower 4 bits are used for the actual shadow ram. The upper 4 bits are (sometimes, when you need it, like in the game of life for example) used as a "snapshot" (copy) of the shadow ram.
Put together, as a quantity, you would have 32 full bytes, but for easier addressing you use this structure of 64 half-bytes.
Confusing, I know smiley
Logged

0
Offline Offline
Jr. Member
**
Karma: 0
Posts: 59
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

florinc,

Thanks so much for your help in this forum especially along with Wagner and others. So shadowram should be:

Code:
byte ht1632_shadowram[64][4][8] = {0};

because I think it should just be:

Code:
byte ht1632_shadowram[64][4*Number_of_Displays] = {0};

which works now with no random pixel errors (as modified from my last posted code).
« Last Edit: February 05, 2011, 09:45:35 am by Tim Gilmore » Logged

Pages: [1] 2 3 ... 19   Go Up
Jump to: