bluehash 1,581 Posted April 23, 2011 Author Share Posted April 23, 2011 Thanks NTM. Not a misprint. It would get carried over to the next month if there were I'll put up a poll in a few minutes. Link to post Share on other sites
RobG 1,892 Posted April 23, 2011 Share Posted April 23, 2011 Damn you NatureTM, you got my vote. Link to post Share on other sites
timotet 44 Posted April 23, 2011 Share Posted April 23, 2011 that starwars outro is awesome LOL! Link to post Share on other sites
MystBoy 5 Posted April 26, 2011 Share Posted April 26, 2011 hey NatureTM! You also get my vote!! i tried something simmilar but i discontinued it... Link to post Share on other sites
bluehash 1,581 Posted May 1, 2011 Author Share Posted May 1, 2011 Voting closed. Congratulations to NatureTM on his "Polyphonic MIDI Dynth" project. He wins this April 2011 Project of the Month Contest. Runner up is the "Serial to 7 segment LED display driver v1" by Rob. A big thank you to PhirePhly, GeoNomad and SugarAddict for participating. Wish you all luck in the upcoming contests. Link to post Share on other sites
NatureTM 100 Posted May 1, 2011 Share Posted May 1, 2011 Yay! Thanks for organizing this bluehash, and thanks to the other participants. Also, thanks to George Lucas and John Williams! Oh, thanks TI as well. I'm excited to do some wireless stuff. Link to post Share on other sites
bluehash 1,581 Posted May 1, 2011 Author Share Posted May 1, 2011 Pleasure. Ahh! yes. Thanks to them too. Link to post Share on other sites
NatureTM 100 Posted May 9, 2011 Share Posted May 9, 2011 Got my prize in the mail today! I wish I could start using it right away, but I decided to not keep up with my calculus class for the past month. My exam is the day after tomorrow. I did 3 weeks worth of units today, and I get to do another two weeks worth tomorrow. "Dave, my mind is going. I can feel it. I can feel it. My mind is going. There is no question about it." Link to post Share on other sites
bluehash 1,581 Posted May 9, 2011 Author Share Posted May 9, 2011 phew! Studies first. Link to post Share on other sites
joeynational 0 Posted February 15, 2012 Share Posted February 15, 2012 SugarAddict's submission:viewtopic.php?f=8&t=732&hilit=tlc5940#p4986 Ok... here's something much nicer... still horribly commented code with some stuff that could be cleaned up or improved... [attachment=0]MSP430_LED_Control_tlc5940.png[/attachment] // I know that my commenting sucks ass... I'm not exactly working on a team project here :-P #define SetLow(port, pin) (port &= ~pin) #define SetHigh(port, pin) (port |= pin) #define Pulse(port, pin) do{SetHigh(port, pin);SetLow(port, pin);} while(0) #define DELTA_1MHZ 244 // 244 x 4096Hz = 999.4Hz #define DELTA_8MHZ 1953 // 1953 x 4096Hz = 7.99MHz #define DELTA_12MHZ 2930 // 2930 x 4096Hz = 12.00MHz #define DELTA_16MHZ 3906 // 3906 x 4096Hz = 15.99MHz #define DELTA_18MHZ 4395 // 4395 x 4096Hz = 18.00MHz #define DELTA_20MHZ 4883 // 4883 x 4096Hz = 20.00MHz #define DELTA_24MHZ 5859 // 5859 x 4096Hz = 23.99MHz #include "msp430g2252.h" void Rotate(void); void Bounce(void); void Set_DCO(unsigned int Delta); // Set DCO to selected frequency void SendDotCorrectionData(void); void SendGreyScaleData(void); int dcdata[] = {0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF, 0xFFFF}; int gsdata[] = { 0x0001, 0x0002, 0x0004, 0x0008, 0x0010, 0x0020, 0x0040, 0x0080, 0x0100, 0x0200, 0x0400, 0x0800, 0x1000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000}; char CntrA = 0, CntrB = 0, dcsent = 0, rotator = 0, bounce = 12, bouncedir = 0; int Counter = 0, data = 0, data2 = 0; void main(void) { WDTCTL = WDTPW + WDTHOLD; // Stop WDT // BCSCTL1 = CALBC1_16MHZ; // Set range // DCOCTL = CALDCO_16MHZ; // Set DCO step + modulation Set_DCO(4639); // 19 MHz // 1.6 DCPRG, 1.7 GSCLK // 2.0 VPRG, 2.1/2.2 SIN, 2.3 XLAT. 2.4 SCLK, 2.5 BLANK P1DIR |= (BIT6|BIT7); P2DIR |= (BIT0|BIT1|BIT2|BIT3|BIT4|BIT5); P1OUT &= ~(BIT7); P1OUT |= (BIT6); P2OUT &= ~(BIT1|BIT2|BIT3|BIT4); P2OUT |= (BIT0|BIT5); CCTL0 = CCIE; // CCR0 interrupt enabled CCR0 = 56; TACTL = TASSEL_2 + MC_1 + ID_0; // SMCLK, Up TACTL |= MC_0; // Stop SendDotCorrectionData(); SendGreyScaleData(); TACTL &= ~MC_0; // Start _bis_SR_register(LPM0_bits + GIE); // Enter LPM0 w/ interrupt } // Timer A0 interrupt service routine #pragma vector = TIMER0_A0_VECTOR __interrupt void Timer_A (void) { Counter++; if(Counter>4095) { TACTL |= MC_0; // Stop Counter = 0; CntrA = 0; CntrB = 0; SetHigh(P2OUT,BIT5); Pulse(P2OUT,BIT3); rotator++; if(rotator>3) { //Rotate(); Bounce(); rotator = 0; } SendGreyScaleData(); TACTL &= ~MC_0; // Start } Pulse(P1OUT, BIT7); } void Rotate(void) { data = gsdata[31]; for(CntrA = 31;CntrA > 0;CntrA--) { gsdata[CntrA] = gsdata[CntrA-1]; } gsdata[0] = data; data = 0; CntrA = 0; } void Bounce(void) { char i = 0; if(bounce == 31) bouncedir = 1; if(bounce == 0) bouncedir = 0; if(bouncedir == 0) // Up { for(i=0;i<32;i++) { gsdata[i] >>= 1; } bounce++; gsdata[bounce] = 0x1000; } else // down { for(i=0;i<32;i++) { gsdata[i] >>= 1; } bounce--; gsdata[bounce] = 0x1000; } } void Set_DCO(unsigned int Delta) // Set DCO to selected frequency { unsigned int Compare, Oldcapture = 0; BCSCTL1 |= DIVA_3; // ACLK = LFXT1CLK/8 TACCTL0 = CM_1 + CCIS_1 + CAP; // CAP, ACLK TACTL = TASSEL_2 + MC_2 + TACLR; // SMCLK, cont-mode, clear while (1) { while (!(CCIFG & TACCTL0)); // Wait until capture occured TACCTL0 &= ~CCIFG; // Capture occured, clear flag Compare = TACCR0; // Get current captured SMCLK Compare = Compare - Oldcapture; // SMCLK difference Oldcapture = TACCR0; // Save current captured SMCLK if (Delta == Compare) break; // If equal, leave "while(1)" else if (Delta < Compare) { DCOCTL--; // DCO is too fast, slow it down if (DCOCTL == 0xFF) // Did DCO roll under? if (BCSCTL1 & 0x0f) BCSCTL1--; // Select lower RSEL } else { DCOCTL++; // DCO is too slow, speed it up if (DCOCTL == 0x00) // Did DCO roll over? if ((BCSCTL1 & 0x0f) != 0x0f) BCSCTL1++; // Sel higher RSEL } } TACCTL0 = 0; // Stop TACCR0 TACTL = 0; // Stop Timer_A BCSCTL1 &= ~DIVA_3; // ACLK = LFXT1CLK } void SendDotCorrectionData(void) { CntrA = 0; CntrB = 0; data = dcdata[CntrA]; while(CntrA<6) { if(CntrB<16) { if(data & 0x8000) { SetHigh(P2OUT,BIT1); SetHigh(P2OUT,BIT2); } else { SetLow(P2OUT,BIT1); SetLow(P2OUT,BIT2); } data <<= 1; CntrB++; Pulse(P2OUT,BIT4); } else { CntrA++; if(CntrA<6) { CntrB = 1; data = dcdata[CntrA]; if(data & 0x8000) { SetHigh(P2OUT,BIT1); SetHigh(P2OUT,BIT2); } else { SetLow(P2OUT,BIT1); SetLow(P2OUT,BIT2); } data <<= 1; Pulse(P2OUT,BIT4); } } } Pulse(P2OUT,BIT3); CntrA = 0; CntrB = 0; dcsent = 1; SetLow(P2OUT,BIT0); } void SendGreyScaleData(void) { CntrA = 0; CntrB = 0; data = gsdata[CntrA]; data2 = gsdata[(CntrA+16)]; while(CntrA<16) { if(CntrB<12) { if(data & 0x1000) SetHigh(P2OUT,BIT1); else SetLow(P2OUT,BIT1); if(data2 & 0x1000) SetHigh(P2OUT,BIT2); else SetLow(P2OUT,BIT2); data <<= 1; data2 <<= 1; CntrB++; Pulse(P2OUT,BIT4); } else { CntrA++; if(CntrA<16) { CntrB = 1; data = gsdata[CntrA]; data2 = gsdata[(CntrA+16)]; if(data & 0x1000) SetHigh(P2OUT,BIT1); else SetLow(P2OUT,BIT1); if(data2 & 0x1000) SetHigh(P2OUT,BIT2); else SetLow(P2OUT,BIT2); data <<= 1; data2 <<= 1; Pulse(P2OUT,BIT4); } } } Pulse(P2OUT,BIT3); SetLow(P2OUT,BIT5); if(dcsent == 1) { Pulse(P2OUT,BIT4); dcsent = 2; } } Can someone help me with this, I'm playing around with this project and I keep getting "identifier "TIMER0_A0_VECTOR" is undefined" and I can't figure out why, it looks defined to me? I'm using the G2231 and I have changed it accordingly in the code, but is there something else i need to change to make this work with the G2231?? Thanks! Link to post Share on other sites
RobG 1,892 Posted February 15, 2012 Share Posted February 15, 2012 Look at the include file for the specific device: 2553: TIMER0_A0_VECTOR 2231: TIMERA0_VECTOR Link to post Share on other sites
joeynational 0 Posted February 16, 2012 Share Posted February 16, 2012 Look at the include file for the specific device: 2553: TIMER0_A0_VECTOR 2231: TIMERA0_VECTOR ahhh, i knew it was something small! Thank you so much!! Link to post Share on other sites
Recommended Posts