Shop OBEX P1 Docs P2 Docs Learn Events
SX controlled 6432 Dot Matrix Bi/Tri-Color LED Display - Page 2 — Parallax Forums

SX controlled 6432 Dot Matrix Bi/Tri-Color LED Display

2»

Comments

  • Andrew E MileskiAndrew E Mileski Posts: 77
    edited 2008-11-14 01:15
    I keep doing the math and running logic simulations, and it seems the Parallax Propeller at 80 MHz may in theory be able to handle up to a 75.41 Hz refresh of a 64x32 bi-colour display with 8 bits of PWM (256 levels of brightness per color).

    Right now I'm trying to see if I can write the assembly code to get this done.· It isn't easy; it's a timing and synchronization nightmare, but I know of no other microcontroller that has the speed and capabilities to even attempt this!

    My current logic simulator is attached·(Perl script) in case anyone is curious how the panel will be driven.· The ouput can be downloaded from here.

    I added in an extra cycle so that the shift clock (S) could be free running.· As a side effect, I split the row latch (L) and power (E)·transitions into the two cycles.· The power is still left on though during PWM data writes, and only turned off before latching a row for the first PWM period.

    Summary of simulation:
    ## Total Cycles Required for Refresh = 1060800 ##
    ## Minimum Cycle Frequency For 70 Hz Refresh Rate = cycle * 70 Hz = 74.256 MHz ##
    ## Minimum Data Rate For 70 Hz Refresh Rate = cycle / 2 * 70 Hz = 37.128 MHz ##
    ## Refresh Rate with an 80 MHz Cycle Frequency = 80 MHz / cycles = 75.41 Hz ##


    Post Edited (Andrew E Mileski) : 11/14/2008 1:21:22 AM GMT
  • THHTHH Posts: 3
    edited 2009-01-01 11:08
    Hello
    Thank you for the realization of this project.

    I come from Germany, where the date DDMMJJJJ usual, the hour display in 24 hour format, it eliminates the presentation for AM or PM. After understanding your programming, I have the AM / PM message disappears, the date display and the days of the week on the German spelling changed, if necessary, I am glad they are available. This amendment is now the 2nd Line blank. My question is, there is in the U.S. also a calendar week calculation, as in Germany? This could be the 2nd Line, but unfortunately I have not enough experience in programming.
    P.S. Sorry for my bad English smurf.gif
    1024 x 768 - 179K
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-01-01 23:10
    I'm not quite understanding what you are asking for as your english is broken somewhat. Do you mean like there is 52 weeks in a year so you would want to list that it is let's say week 1 in the new year. Perhaps you might also list the day of the year (e.g. 365 days in a year).

    Can you better explain what you want to do. If it is just manipulating the date, it should be possible.

    Thanks.
  • THHTHH Posts: 3
    edited 2009-01-03 13:48
    Hello
    It`s only an Idea, we have in Germany a Calculation of the Calendarweek, that means, the Year has 52-53 Weeks.To example, I order a Car, the Car Dealer tells me, your Car is her in the 43. Week . I have seen in Wikipedia its any different between German or USA Calendarweek (in USA Week number). I mean, its not easy to programming this function in your Clock.

    Thanks

    Torsten
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-01-03 21:00
    Im working on some code over the next few days to·count the·week (at least for 2009 to start). There will be alot of IF THEN statements so it will get messy. Perhaps there is a way once this works to clean it up. I have to take a break for a while and get back to it later.

    Basically you look to see what month (1-12) that it is (e.g. TimeDate(Month) or [noparse][[/noparse]m_lin3(PosMonth) and m_lin3(PosMonth2)]) and then check the m_lin3(PosDate) and m_lin3(PosDate2) for it's digits in that month and let a variable such as WkDig1 and WkDig2 determine the week counter from 01 to 53 (53 weeks in 2009). I'm gettting close but still have lots of testing to get it right.

    Be back later....
  • THHTHH Posts: 3
    edited 2009-01-03 21:55
    Thank you for the quick Answer.

    Greetings

    Torsten
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-01-04 17:02
    I got it working to display the weeks in 2009 (1-53). The software has been updated to v2. I had to add to modify some variables because it was running out of variable space. All is good now. I also added a routine BCD2DEC that JonnyMac wrote. The core subroutine is: WriteWeekToLED2009

    It will also only display·a single digit·week if the first digit is 0 as seen in the attached picture.



    Enjoy.
    640 x 480 - 137K
    640 x 480 - 138K
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-04-14 01:08
    Here are some pics I took of a dual 5mm 6432 display in a case. Expensive $300+ project.

    The case was custom made by Mark Morales from his website:· http://www.markm330.fatcow.com/

    or email at·markm330@gmail.com·. He did an excellent job for about $80 including shipping. The dimensions are roughly 39" x 20" x 4".
    512 x 384 - 57K
    512 x 384 - 55K
    512 x 384 - 49K
    512 x 384 - 51K
  • mparkmpark Posts: 1,305
    edited 2009-10-06 21:38
    Did this ever get published in N&V?
  • T&E EngineerT&E Engineer Posts: 1,396
    edited 2009-10-06 22:16
    No. Another forum member worked on this project with me and he did not like the idea of getting it published (even though I wrote the article and gave him substantial and fair credit).

    He threatened Nuts and Volts with legal action if they did publish my article and they did not want to pursue it further.

    I have tried to make amends with him but he remains bitter about it.

    I would probably have to re-write his portion of the code if anything will ever come of this. Its a shame.

    I have since blocked him on this forum as not to get any more hassle from him.
  • RobotWorkshopRobotWorkshop Posts: 2,307
    edited 2009-10-07 20:52
    It's a shame you two couldn't have worked out the differences. Hope you can re-write the code so that we'll be able to see this project in Nuts'N'Volts.
  • PJAllenPJAllen Banned Posts: 5,065
    edited 2009-10-07 23:31
    I'm so glad you brought the matter up, T&E Engineer.

    I am, obviously, the "other person."· Nobody has to be a logician to figure that out.

    That these damned boards work at all, let alone so well, is solely a product of my effort and creativity.

    T&E·struggled with these units for more than a year.· Exasperated by several dozen fruitless PMs with him, I said, "send me one and I'll make it work."· It wasn't going to happen any other way.· And by God they were working after two days, one day of research and another night of programming and applying myself.

    Your·contribution to the project was the EEPROM SUBroutine which·you glommed from Bean.·
    Instead of downloading via serial,·because you didn't know how to do that, you wanted to use a 4x20 LCD and some mini-keypad, because JonnyMac had written some "code" for it already and·you didn't want to "re-invent the wheel" (a common lament of yours.)· In·"your" version·you included a serial SUBroutine written by JonnyMac.· That's the sum of what·you call "learning."
    ···
    I even had to write a sensible serial SUBroutine, which is included in my version.· Unsoundcode utilized it to write a nice application for it, too (it's up there.)

    I am not, God forbid, T&E's employ or aide.· In the spirit of friendship, as they say,·I wanted this to get resolved.· Naturally, I did not work on this for more than a week in all, refining and improving, so that T&E or anybody else could brazenly·sneak some article off to·Nuts_&_Volts and claim it for his own work.· Everyone can understand that.· If his article was about how to use tupperware and other household junk as project enclosures I would not care one wit.· Carving up a tupperware container and jury-rigging a display board into the thing and explaining the firmware with my words, doesn't give·T&E or anybody else the right to call the project his own; no, far from it.· And that, friends and lovers, is what's a "shame" here.· See what happens when you try and be a nice guy?

    I have made several further improvements, 10-characters per line and four colors (red, orange, yellow, and green) and I will NOT divulge that information on the Forum.· Lesson learned -- It's the looters, you know.· If you ever help anybody to any substantial degree, make sure they understand that it's not theirs to pillage.

    I sincerely hope that this is the end of the matter.· However, I have a butt-load of emails and PMs that I will post here if there is any need.

    I will re-state: That these damned boards work at all, let alone so well, is solely a product of my effort and creativity.

    N.B., one and all, I had offered, in the spirit of friendship and before alerting N_&_V,·to split the billing for the article, but T&E stubbornly refused.· Because he composed the PDF,·being my firmware and explanation notwithstanding, and took a box-cutter knife to a scrotty piece of tupperware then it's somehow "his" work and that's revolting.
  • jwflammerjwflammer Posts: 3
    edited 2010-04-06 17:30
    Hey i just bought my LED matrix and in using the 6432 3mm matrix how do i get it to work?? im using the arduino mega and i have had no luck, this is not my code but it works for there the 5mm board.
    /*
    Code to drive the 6432 bi-color display from Sure Electronics
    
    By: Roshan Sembacuttiaratchy - http://roshan.info
    
    */
    
    #define A_pin 2 // Row selection A
    #define B_pin 3 // Row selection B
    #define C_pin 4 // Row selection C
    #define D_pin 5 // Row selection D
    
    #define G1_pin 9 // Green top
    #define G2_pin 10 //Green bottom
    #define R1_pin 11 //Red top
    #define R2_pin 12 //Red Bottom
    
    #define CLOCK_pin 8 //Clock pin
    #define LATCH_pin 6 //Latch pin
    #define ENABLE_pin 7 //Enable pin
    
    byte redBuffer[noparse][[/noparse]32 * 8];
    byte greenBuffer[noparse][[/noparse]32 * 8];
    
    void setup() {
      pinMode(A_pin, OUTPUT);
      pinMode(B_pin, OUTPUT);
      pinMode(C_pin, OUTPUT);
      pinMode(D_pin, OUTPUT);
      pinMode(G1_pin, OUTPUT);
      pinMode(G2_pin, OUTPUT);
      pinMode(R1_pin, OUTPUT);
      pinMode(R2_pin, OUTPUT);
      pinMode(CLOCK_pin, OUTPUT);
      pinMode(LATCH_pin, OUTPUT);
      pinMode(ENABLE_pin, OUTPUT);
      // Empty out the buffers
      setBuffer(&redBuffer, 0);
      setBuffer(&greenBuffer, 0);
    }
    
    void setBuffer(void *buffer, byte value) {
      memset(buffer, value, 32 * 8);
    }
    
    void setPixelGreen(byte x, byte y, byte c) {
      setBufferPixel(x, c, &greenBuffer[noparse][[/noparse]y * 8 +x / 8]);
    }
      
    void setPixelRed(byte x, byte y, byte c) {
      setBufferPixel(x, c, &redBuffer[noparse][[/noparse]y * 8 + x / 8]);
    }
      
    void setBufferPixel(byte x, byte c, byte *buffer) {
      byte bitPos = (7 - x % 8);
      *buffer &= 0xFF - (1 << bitPos);
      *buffer |= c << bitPos;
    }
    
    void enableRow(byte row) {
      byte portD = PORTD;
      portD &= B11000011;
      // The A..D pins are connected on pins 2..5, which map to
      // bits 2..5 on PORTD
      portD |= (row & 0x0F) << 2; 
      PORTD = portD;
    }
    
    void refreshScreen() {
      byte srDataRow, xByte, xMask;
      int bufferPos = 0;
      for (byte row = 0; row < 16; row++) {
        // Disable display
        PORTD &= B01111111;
        for (byte xByte = 0; xByte < 8; xByte++) {
          for (byte xBit = 0; xBit < 8; xBit++) {
            xMask = 1 << (7 - xBit);
            // Digital pins 9..11 are bits 1..3 (0-based) on PORTB
            // As the 6432 display uses inverted logic, inverts the values at this step.
            // The following step could be seriously optimized by having the framebuffer
            // store pixel information in a bit array of the same format as below, and simply
            // masking off the entire pixel data and doing a single negate and shift here.
            srDataRow = (!(  redBuffer[noparse][[/noparse]bufferPos] & xMask) ?  8 : 0) | // R1
                        (!(  redBuffer[noparse][[/noparse]bufferPos + 128] & xMask) ? 16 : 0) | // R2
                        (!(greenBuffer[noparse][[/noparse]bufferPos] & xMask) ?  2 : 0) | // G1
                        (!(greenBuffer[noparse][[/noparse]bufferPos + 128] & xMask) ?  4 : 0);  // G2
            // Send out the data and clock-down
            PORTB = srDataRow;
            // Clock high
            PORTB = srDataRow | 1;
          }
          bufferPos++;
        }
        // Latch the data
        PORTD &= B10111111;
        PORTD |= B01000000;
        enableRow(row);
        // Enable display
        PORTD |= B10000000;
        delayMicroseconds(2);
      }
    }
    
    long nextUpdate = 0;
    int color = 1;
    int pos = 0;
    
    void modPixels() {
      setPixelGreen(pos % 64, pos / 64, color);
      setPixelRed(pos / 32, pos % 32, color);
      pos++;
      pos%=2048;
      if (pos == 0) {
        color = 1 - color;
      }
    }
    
    int textSet = 0;
    int scrollCount = 0;
    char digitBuffer[noparse][[/noparse]8];
    
    void scrollUp() {
      char tmpBuffer[noparse][[/noparse]8];
      memcpy(tmpBuffer, redBuffer, 8);
      memmove(redBuffer, &redBuffer[noparse][[/noparse]8], 31 * 8);
      memcpy(&redBuffer[noparse][[/noparse]31 * 8], tmpBuffer, 8);
    
      memcpy(tmpBuffer, greenBuffer, 8);
      memmove(greenBuffer, &greenBuffer[noparse][[/noparse]8], 31 * 8);
      memcpy(&greenBuffer[noparse][[/noparse]31 * 8], tmpBuffer, 8);
    }
    
    void scrollLeft() {
      shiftBufferLeft(greenBuffer);
      shiftBufferLeft(redBuffer);
    }
    
    void shiftBufferLeft(byte buffer[noparse][[/noparse]]) {
      int bufPos = 0;
      for (byte row = 0; row < 32; row++) {
        for (byte col = 0; col < 7; col++) {
          buffer[noparse][[/noparse]bufPos] = (buffer[noparse][[/noparse]bufPos] << 1) | (buffer[noparse][[/noparse]bufPos + 1] >> 7);
          bufPos++;
        }
        buffer[noparse][[/noparse]bufPos] = (buffer[noparse][[/noparse]bufPos] << 1);
        bufPos++;
      }
    }
    
    void loop() {
      refreshScreen();
      if (millis() > nextUpdate) {
        modPixels();
        nextUpdate = millis() + 125;
      }
    }
    
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2010-04-06 17:42
    JWFLAMMER,

    This is not an Arduino forum but is focused on the Parallax SX micro-controllers such as the SX28 and SX48. I have an Arduino but not up to speed due to my limited C programming experience. The SX chips use SX/B which is a form of a BASIC like language. I suggest that you go to the Arduino forum such as http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1249604378·and do a search for 6432 and there should be some good resources for you.

    BTW: There should be no difference in programming for the 3mm nor the 5mm 6432 displays.

    Sorry.

    Tim
  • jwflammerjwflammer Posts: 3
    edited 2010-04-06 22:24
    no problem.... its all good i have tried the arduino site and...... well they don't want to reply or something [noparse]:([/noparse] .
    so yeah how is yours wired i know basic and can easily change the code to suite me if need be. how is yours set up?
    like i have the 16 pin cable hooked up to the micro controller and all the pins connected to out ports,
    the ground pins are connected to the 5v 3.5amp power supply which is connected to the separate power connectors.
    thats the hardware setup. is that wrong ??


    any help will greatly be appreciated thank you john F.

    the pictures are how its wired the pin outs are not exact, for it was a quick put together since your the first to reply in a month of posting on the arduino site
    768 x 1024 - 222K
    1024 x 768 - 222K
    768 x 1024 - 218K
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2010-04-07 11:21
    Your wiring sounds correct. The projects I have listed in the post are for primarily a clock that uses a DS1302 chip, and is set to the clocks date and time via a quick hyperterminal connection and then disconnected once set. I use the 1 amp power supply from the micro-controller (SX52 proto board which is now obsolete or an SX48 proto board will also work). I will see if I can dig up any schematics for you.
  • jwflammerjwflammer Posts: 3
    edited 2010-04-08 09:56
    Thank you

    i have a the power supply needed so we know that works how dose all the data work? ..... to translate i think i need to have a continues clock and on every low latch the data in a binary type format which i don't under stand. were i think im getting lost is, i have built my own 8x8 LED matrix and how i got it to work is one row high rest of the rows low, then one column low and the rest of the columns high, in this case i think im getting lost. im thinking that i need to send a high to this pin and low to that pin kinda thing how do i get this to work?

    thanks John.

    if you have a free day at any time i don't sleep let me know i could use a skype buddy to kinda walk me trough the steps and knock some thing out
  • T&amp;E EngineerT&amp;E Engineer Posts: 1,396
    edited 2010-04-08 10:57
    John,

    I have sent you a private message with my email and cell number if you wish to contact me.

    First let me say that the 6432 displays have some extra circuitry in them that requires the line scanning of the rows (top to bottom)·is fast enough·before the display will even turn on. Do you have any particular application? Are you working with the Arduino or SX chips? If you are working with just the arduino then we should probably not continue in this forum but via email and phone calls. I have not spent much time with the arduino because of my limited self taught C language skills with them and my Mikroelektronica BigAVR2. However, I would like to further develop·my C skills·so we can help each other out in that aspect. Reply here with your immediate needs and also email me and later call as needed.

    Tim
Sign In or Register to comment.