Search the Community

Showing results for tags 'matrix'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

  • Community Calendar

Found 4 results

  1. Hey Guys, Exam times again, so I feel like I have a tonne of time for my projects. This is a project I started in February 2014. I found a very nice 8x8 dual colour LED display. I designed a PCB for them when I ordered them, instead of when I actually had them. I had built a PCB up with a G2542 8kb / 512b (Mem/RAM) but didn't manage to get it working. Over the last few weeks I got back into this project, and low and behold it did actually work!! I built up a new PCB because it was designed as a common cathode driver, but the displays were common anode.... (on the first board, I had bridged the common mosfets.) of course using 0402 parts. (this display need 64 of these O_O) back of PCB contains clock, half a DCDC stepup and a BMA222 accelerometer. Front & back Now I needed a case, this is my first project I decided to actually make use of a cheap chinesse laser cutter I now own. The piece with all the slits in it create a "living hinge" which creates a cool organic looking case. as opposed to a rectangle. I'm still working on improving code. Basic clock functionality is in. lastly I'll leave you with my dud designs. which while not very practical. are actually 100% useful. A failed design can teach you alot! I will be making this open source, I would like to make more in the future, which may involve buying more displays from china (if there is interest maybe even a group buy?? )
  2. A quick port to Energia of the famous LedControl library for Arduino. Download: https://github.com/elpaso/ledcontrol-energia Original library: http://playground.arduino.cc/Main/LedControl Enjoy!
  3. Created as part of GB#11, this booster pack uses 5050 RGB LEDs with integrated WS2811. Will post code examples later on. BTW, I cannot get a preview of this YouTube video to show up, can you check it out B#?
  4. Hello everyone! I'm continuing my project of creating an RGB LED matrix capable of displaying live images being transmitted from a laptop via a serial cable to the MSP430G2553. At the moment, I'm coding four 8x8 Common Anode RGB LED matrices joined together to create a 16x16 display. Hardware I'm using: - 3 * TLC5940s (one for each colour) - 2 * 74HC595 shift registers (drives the columns/anodes) I'm using code provided by RobG from this link <http://forum.43oh.com/topic/2315-tlc5940-examples/> and this one <http://forum.43oh.com/topic/3328-rgb-to-hsv-conversion-with-msp430g2231-help/#entry29106> in order to drive the LEDs with PWM enabled. BUT, the problem I'm having is that I'm trying to allow every pixel to have different colours, but when running, the microcontroller isn't refreshing the pixels fast enough so there is MASSIVE flickering - which isn't ideal.... Here is the code from which I am working : feel free to insult :-P #include <msp430g2553.h> #include <msp430.h> // Need to sort hsv2rgb because yellow is pish... // u_long is 32 bits so 2^32 - 1 is max value. Need more for 32x32 matrix // TLC inputs #define VPRG_PIN BIT0 // TIE TO GND? #define GSCLK_PIN BIT4 #define SCLK_PIN BIT5 #define DATA BIT6 // DS -> 1.6 | 595 DATA PIN #define MOSI_PIN BIT7 #define MOSI595 BIT2 // 595 data pin ? THIS ISNT DOING ANYTHING #define DCPRG_PIN BIT0 // TIE IT TO GND? #define XLAT_PIN BIT1 #define BLANK_PIN BIT2 #define CLOCK BIT3 // SH 11 -> 2.3 // 595 OUTPUTS #define LATCH BIT4 // ST 12 -> 2.4t typedef unsigned char u_char; typedef unsigned int u_int; typedef unsigned short u_short; typedef unsigned long u_long; // ================================// // Prototypes // // ================================// void init( void ); void SPI_setup( void ); void updateTLC( void ); void shiftOut( u_long ); void HSV2RGB( u_short*, u_short*, u_short*, short, u_char); void set_row_char_hue (u_char, u_long, short, u_char); void row_refresh(u_char,short,short,short,short,short,short,short,short,short,short,short,short,short,short,short,short); #define NUMBER_OF_OUTS 48 // TLC OUTPUTS #define NUMBER_OF_ROWS 8 #define NUMBER_OF_COLUMNS 16 #define max_COLUMN NUMBER_OF_COLUMNS-1 #define max_ROW NUMBER_OF_ROWS-1 #define OFF 0 u_short leds[NUMBER_OF_OUTS]; // 0 - 15 Red Rows, 16 - 31 Blue Rows, 32 - 47 Green Rows {0, } u_char timerCounter = 0; void init(void) { WDTCTL = WDTPW + WDTHOLD; // disable WDT BCSCTL1 = CALBC1_16MHZ; // 16MHz clock DCOCTL = CALDCO_16MHZ; BCSCTL2 |= DIVS_0; // divide clock by 1 P1OUT &= ~(VPRG_PIN); P1DIR |= (VPRG_PIN + GSCLK_PIN + DATA); // port 1.4 configured as SMCLK out P1SEL |= GSCLK_PIN; P2DIR |= (BLANK_PIN + XLAT_PIN + CLOCK + LATCH + DCPRG_PIN); P2OUT &= ~(BLANK_PIN + XLAT_PIN); P2OUT &= ~DCPRG_PIN; // setup timer CCR0 = 0xFFF; TACTL = TASSEL_2 + MC_1 + ID_0; // SMCLK, up mode, 1:1 CCTL0 = CCIE; // CCR0 interrupt enabled } void SPI_setup(void) { // setup UCA0 ----UCA0 ISNT DOING ANYTHING YET! SHOULD I CONFIGURE THE 595's TO BE CONTROLLED BY SPI? P1SEL |= MOSI595; // p1.2 P1SEL2 |= MOSI595; // UCA0SIMO UCA0CTL0 = UCCKPH + UCMSB + UCMST + UCSYNC; // data captured on 1st UCLK edge/changed on follwing edge, MSB first, master, 3-pin SPI,synchronous UCA0CTL1 |= UCSSEL_2; // SMCLK UCA0BR0 |= 0x01; // 1:1 UCA0BR1 = 0; UCA0CTL1 &= ~UCSWRST; // clear SW // setup UCB0 P1SEL |= SCLK_PIN + MOSI_PIN; // pins 5 + 7 P1SEL2 |= SCLK_PIN + MOSI_PIN; // UCB0CLK + UCB0SIMO UCB0CTL0 = UCCKPH + UCMSB + UCMST + UCSYNC; // data captured on 1st UCLK edge/changed on follwing edge, MSB first, master, 3-pin SPI,synchronous UCB0CTL1 |= UCSSEL_2; // SMCLK UCB0BR0 |= 0x01; // 1:1 UCB0BR1 = 0; UCB0CTL1 &= ~UCSWRST; // clear SW } void main(void) { init(); SPI_setup(); updateTLC(); P2OUT |= (XLAT_PIN); P2OUT &= ~(XLAT_PIN); short o = 240; short y = 60; // yellow short b = 240; // blue short hue = 0; _bis_SR_register(GIE); for(; { // creates box image row_refresh(0, b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,; row_refresh(1, b,y,y,y,y,y,y,y,y,y,y,y,y,y,y,; row_refresh(2, b,y,b,b,b,b,b,b,b,b,b,b,b,b,y,; row_refresh(3, b,y,b,y,y,y,y,y,y,y,y,y,y,b,y,; row_refresh(4, b,y,b,y,b,b,b,b,b,b,b,b,y,b,y,; row_refresh(5, b,y,b,y,b,y,y,y,y,y,y,b,y,b,y,; row_refresh(6, b,y,b,y,b,y,b,b,b,b,y,b,y,b,y,; row_refresh(7, b,y,b,y,b,y,b,y,y,b,y,b,y,b,y,; row_refresh(8, b,y,b,y,b,y,b,y,y,b,y,b,y,b,y,; row_refresh(9, b,y,b,y,b,y,b,b,b,b,y,b,y,b,y,; row_refresh(10, b,y,b,y,b,y,y,y,y,y,y,b,y,b,y,; row_refresh(11, b,y,b,y,b,b,b,b,b,b,b,b,y,b,y,; row_refresh(12, b,y,b,y,y,y,y,y,y,y,y,y,y,b,y,; row_refresh(13, b,y,b,b,b,b,b,b,b,b,b,b,b,b,y,; row_refresh(14, b,y,y,y,y,y,y,y,y,y,y,y,y,y,y,; row_refresh(15, b,b,b,b,b,b,b,b,b,b,b,b,b,b,b,; _bis_SR_register(LPM0_bits); // go to sleep } // end of for(; loop } void updateTLC(void) // RobG's code { u_char ledCounter = NUMBER_OF_OUTS >> 1; while (ledCounter-- > 0) { u_char i = ledCounter << 1; UCB0TXBUF = leds[i + 1] >> 4; while (!(IFG2 & UCB0TXIFG)); // TX buffer ready? u_char unib = leds[i + 1] << 4; u_char lnib = (leds[i] >> 8) & 0x0F; UCB0TXBUF = unib | lnib; while (!(IFG2 & UCB0TXIFG)) ; // TX buffer ready? UCB0TXBUF = leds[i]; while (!(IFG2 & UCB0TXIFG)); // TX buffer ready? } } void row_refresh(u_char row,short a,short b,short c,short d,short e,short f,short g,short h,short i,short j,short k,short l,short m,short n,short o,short p) { // this function checks if led is supposed to be ON // for example, if row = 0, and a = 360 then the top left led is OFF // if a = 120, then the led will be ON, and will be assigned the appropriate hue (green) u_long col_data = 0x0000; if(a < 360){col_data = 0x8000; set_row_char_hue(row,col_data,a,1);} // 0 if(b < 360){col_data = 0x4000; set_row_char_hue(row,col_data,b,1);} // 1 if(c < 360){col_data = 0x2000; set_row_char_hue(row,col_data,c,1);} // 2 if(d < 360){col_data = 0x1000; set_row_char_hue(row,col_data,d,1);} // 3 if(e < 360){col_data = 0x0800; set_row_char_hue(row,col_data,e,1);} // 4 if(f < 360){col_data = 0x0400; set_row_char_hue(row,col_data,f,1);} // 5 if(g < 360){col_data = 0x0200; set_row_char_hue(row,col_data,g,1);} // 6 if(h < 360){col_data = 0x0100; set_row_char_hue(row,col_data,h,1);} // 7 if(i < 360){col_data = 0x0080; set_row_char_hue(row,col_data,i,1);} // 8 if(j < 360){col_data = 0x0040; set_row_char_hue(row,col_data,j,1);} // 9 if(k < 360){col_data = 0x0020; set_row_char_hue(row,col_data,k,1);} // 10 if(l < 360){col_data = 0x0010; set_row_char_hue(row,col_data,l,1);} // 11 if(m < 360){col_data = 0x0008; set_row_char_hue(row,col_data,m,1);} // 12 if(n < 360){col_data = 0x0004; set_row_char_hue(row,col_data,n,1);} // 13 if(o < 360){col_data = 0x0002; set_row_char_hue(row,col_data,o,1);} // 14 if(p < 360){col_data = 0x0001; set_row_char_hue(row,col_data,p,1);} // 15 } void set_row_char_hue (u_char row, u_long col_data, short hue, u_char bool) { u_char led = 0; u_long byte; for(led = 0 ; led < 16 ; led++ ) { byte = (col_data>>led)&(0x01); if( byte ) { HSV2RGB( &leds[row], &leds[row + 32], &leds[row + 16], hue, bool); //on; shiftOut( col_data ); } } // turn off leds leds[row] = OFF; leds[row+32] = OFF; leds[row+16] = OFF; } void HSV2RGB(u_short* r, u_short* g, u_short* b, short h, u_char bool) { const u_char s = 255; u_char v = 255; u_char i, p, q, t; u_short fs; if (h < 60 ) i = 0; else if (h < 120) i = 1; else if (h < 180) i = 2; else if (h < 240) i = 3; else if (h < 300) i = 4; else if (h < 360) i = 5; else return; fs = ((h - i * 60) * s)/ 60; p = 255 - s; q = 255 - fs; t = 255 - s + fs; switch(i) { case 0: *r = 255;*g = t;*b = p;break; case 1: *r = q;*g = 255;*b = p;break; case 2: *r = p;*g = 255;*b = t;break; case 3: *r = p;*g = q;*b = 255;break; case 4: *r = t;*g = p;*b = 255;break; case 5: *r = 255;*g = p;*b = q;break; } if ( bool == 1 ) { *r *= v/16; *g *= v/16; *b *= v/16; } else { *r *= 0; *g *= 0; *b *= 0; } } #pragma vector = TIMER0_A0_VECTOR __interrupt void Timer_A0(void) { // 4096 GS clock cycles have been generated, time to restart PWM P2OUT |= (BLANK_PIN); P2OUT |= (XLAT_PIN); P2OUT &= ~(XLAT_PIN); P2OUT &= ~(BLANK_PIN); // increase timer counter timerCounter++; if (timerCounter == 1) // this is also from RobG, except updateTLC is every interrupt because otherwise it is far too slow { // is it time to for next frame? updateTLC(); // data was already prepared by main loop when it was awake last time timerCounter = 0; _bic_SR_register_on_exit(LPM0_bits); // wake up main loop so that it can prepare data for the next frame } } void shiftOut(u_long val) { P2OUT &= ~LATCH; int i; for (i = 0; i < 16; i++) // iterate over each bit 16 { if(val & (1 << i)) { P1OUT |= DATA; } else { P1OUT &= ~DATA; } P2OUT |= CLOCK; // PULSE CLOCK P2OUT ^= CLOCK; } // } P2OUT |= LATCH; // PULSE LATCH P2OUT &= ~LATCH; } If anyone has any suggestions on how to improve this code, it will be greatly appreciated, because I've really hit a wall with it. I did think that using SPI P1.2 for UCA0SIMO instead of the shiftOut() function might be a solution but I don't know how to go about doing that. Keep in mind that soon I'll be using P1.1 for RXD. Cheers!