sucotronic 6 Posted February 12, 2011 Share Posted February 12, 2011 I've written a simple program adapted from the rttl example in the Arduino Tone library. It only need a launchpad, a piezo buzzer and a compiler (in my case mspgcc). You take a look in my blog(I don't want to seem spam, only want to share with others my madness .P). /* Buzzer example */ #include #include typedef unsigned char byte; #define NOTE_B0 31 #define NOTE_C1 33 #define NOTE_CS1 35 #define NOTE_D1 37 #define NOTE_DS1 39 #define NOTE_E1 41 #define NOTE_F1 44 #define NOTE_FS1 46 #define NOTE_G1 49 #define NOTE_GS1 52 #define NOTE_A1 55 #define NOTE_AS1 58 #define NOTE_B1 62 #define NOTE_C2 65 #define NOTE_CS2 69 #define NOTE_D2 73 #define NOTE_DS2 78 #define NOTE_E2 82 #define NOTE_F2 87 #define NOTE_FS2 93 #define NOTE_G2 98 #define NOTE_GS2 104 #define NOTE_A2 110 #define NOTE_AS2 117 #define NOTE_B2 123 #define NOTE_C3 131 #define NOTE_CS3 139 #define NOTE_D3 147 #define NOTE_DS3 156 #define NOTE_E3 165 #define NOTE_F3 175 #define NOTE_FS3 185 #define NOTE_G3 196 #define NOTE_GS3 208 #define NOTE_A3 220 #define NOTE_AS3 233 #define NOTE_B3 247 #define NOTE_C4 262 #define NOTE_CS4 277 #define NOTE_D4 294 #define NOTE_DS4 311 #define NOTE_E4 330 #define NOTE_F4 349 #define NOTE_FS4 370 #define NOTE_G4 392 #define NOTE_GS4 415 #define NOTE_A4 440 #define NOTE_AS4 466 #define NOTE_B4 494 #define NOTE_C5 523 #define NOTE_CS5 554 #define NOTE_D5 587 #define NOTE_DS5 622 #define NOTE_E5 659 #define NOTE_F5 698 #define NOTE_FS5 740 #define NOTE_G5 784 #define NOTE_GS5 831 #define NOTE_A5 880 #define NOTE_AS5 932 #define NOTE_B5 988 #define NOTE_C6 1047 #define NOTE_CS6 1109 #define NOTE_D6 1175 #define NOTE_DS6 1245 #define NOTE_E6 1319 #define NOTE_F6 1397 #define NOTE_FS6 1480 #define NOTE_G6 1568 #define NOTE_GS6 1661 #define NOTE_A6 1760 #define NOTE_AS6 1865 #define NOTE_B6 1976 #define NOTE_C7 2093 #define NOTE_CS7 2217 #define NOTE_D7 2349 #define NOTE_DS7 2489 #define NOTE_E7 2637 #define NOTE_F7 2794 #define NOTE_FS7 2960 #define NOTE_G7 3136 #define NOTE_GS7 3322 #define NOTE_A7 3520 #define NOTE_AS7 3729 #define NOTE_B7 3951 #define NOTE_C8 4186 #define NOTE_CS8 4435 #define NOTE_D8 4699 #define NOTE_DS8 4978 #define OCTAVE_OFFSET 0 int notes[] = { 0, NOTE_C4, NOTE_CS4, NOTE_D4, NOTE_DS4, NOTE_E4, NOTE_F4, NOTE_FS4, NOTE_G4, NOTE_GS4, NOTE_A4, NOTE_AS4, NOTE_B4, NOTE_C5, NOTE_CS5, NOTE_D5, NOTE_DS5, NOTE_E5, NOTE_F5, NOTE_FS5, NOTE_G5, NOTE_GS5, NOTE_A5, NOTE_AS5, NOTE_B5, NOTE_C6, NOTE_CS6, NOTE_D6, NOTE_DS6, NOTE_E6, NOTE_F6, NOTE_FS6, NOTE_G6, NOTE_GS6, NOTE_A6, NOTE_AS6, NOTE_B6, NOTE_C7, NOTE_CS7, NOTE_D7, NOTE_DS7, NOTE_E7, NOTE_F7, NOTE_FS7, NOTE_G7, NOTE_GS7, NOTE_A7, NOTE_AS7, NOTE_B7 }; //char *song = "The Simpsons:d=4,o=5,b=160:c.6,e6,f#6,8a6,g.6,e6,c6,8a,8f#,8f#,8f#,2g,8p,8p,8f#,8f#,8f#,8g,a#.,8c6,8c6,8c6,c6"; //char *song = "Indiana:d=4,o=5,b=250:e,8p,8f,8g,8p,1c6,8p.,d,8p,8e,1f,p.,g,8p,8a,8b,8p,1f6,p,a,8p,8b,2c6,2d6,2e6,e,8p,8f,8g,8p,1c6,p,d6,8p,8e6,1f.6,g,8p,8g,e.6,8p,d6,8p,8g,e.6,8p,d6,8p,8g,f.6,8p,e6,8p,8d6,2c6"; //char *song = "TakeOnMe:d=4,o=4,b=160:8f#5,8f#5,8f#5,8d5,8p,8b,8p,8e5,8p,8e5,8p,8e5,8g#5,8g#5,8a5,8b5,8a5,8a5,8a5,8e5,8p,8d5,8p,8f#5,8p,8f#5,8p,8f#5,8e5,8e5,8f#5,8e5,8f#5,8f#5,8f#5,8d5,8p,8b,8p,8e5,8p,8e5,8p,8e5,8g#5,8g#5,8a5,8b5,8a5,8a5,8a5,8e5,8p,8d5,8p,8f#5,8p,8f#5,8p,8f#5,8e5,8e5"; //char *song = "Entertainer:d=4,o=5,b=140:8d,8d#,8e,c6,8e,c6,8e,2c.6,8c6,8d6,8d#6,8e6,8c6,8d6,e6,8b,d6,2c6,p,8d,8d#,8e,c6,8e,c6,8e,2c.6,8p,8a,8g,8f#,8a,8c6,e6,8d6,8c6,8a,2d6"; //char *song = "Muppets:d=4,o=5,b=250:c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,8a,8p,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,8e,8p,8e,g,2p,c6,c6,a,b,8a,b,g,p,c6,c6,a,8b,a,g.,p,e,e,g,f,8e,f,8c6,8c,8d,e,8e,d,8d,c"; //char *song = "Xfiles:d=4,o=5,b=125:e,b,a,b,d6,2b.,1p,e,b,a,b,e6,2b.,1p,g6,f#6,e6,d6,e6,2b.,1p,g6,f#6,e6,d6,f#6,2b.,1p,e,b,a,b,d6,2b.,1p,e,b,a,b,e6,2b.,1p,e6,2b."; //char *song = "Looney:d=4,o=5,b=140:32p,c6,8f6,8e6,8d6,8c6,a.,8c6,8f6,8e6,8d6,8d#6,e.6,8e6,8e6,8c6,8d6,8c6,8e6,8c6,8d6,8a,8c6,8g,8a#,8a,8f"; //char *song = "20thCenFox:d=16,o=5,b=140:b,8p,b,b,2b,p,c6,32p,b,32p,c6,32p,b,32p,c6,32p,b,8p,b,b,b,32p,b,32p,b,32p,b,32p,b,32p,b,32p,b,32p,g#,32p,a,32p,b,8p,b,b,2b,4p,8e,8g#,8b,1c#6,8f#,8a,8c#6,1e6,8a,8c#6,8e6,1e6,8b,8g#,8a,2b"; //char *song = "Bond:d=4,o=5,b=80:32p,16c#6,32d#6,32d#6,16d#6,8d#6,16c#6,16c#6,16c#6,16c#6,32e6,32e6,16e6,8e6,16d#6,16d#6,16d#6,16c#6,32d#6,32d#6,16d#6,8d#6,16c#6,16c#6,16c#6,16c#6,32e6,32e6,16e6,8e6,16d#6,16d6,16c#6,16c#7,c.7,16g#6,16f#6,g#.6"; //char *song = "MASH:d=8,o=5,b=140:4a,4g,f#,g,p,f#,p,g,p,f#,p,2e.,p,f#,e,4f#,e,f#,p,e,p,4d.,p,f#,4e,d,e,p,d,p,e,p,d,p,2c#.,p,d,c#,4d,c#,d,p,e,p,4f#,p,a,p,4b,a,b,p,a,p,b,p,2a.,4p,a,b,a,4b,a,b,p,2a.,a,4f#,a,b,p,d6,p,4e.6,d6,b,p,a,p,2b"; //char *song = "StarWars:d=4,o=5,b=45:32p,32f#,32f#,32f#,8b.,8f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32e6,8c#.6,32f#,32f#,32f#,8b.,8f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32c#6,8b.6,16f#.6,32e6,32d#6,32e6,8c#6"; //char *song = "GoodBad:d=4,o=5,b=56:32p,32a#,32d#6,32a#,32d#6,8a#.,16f#.,16g#.,d#,32a#,32d#6,32a#,32d#6,8a#.,16f#.,16g#.,c#6,32a#,32d#6,32a#,32d#6,8a#.,16f#.,32f.,32d#.,c#,32a#,32d#6,32a#,32d#6,8a#.,16g#.,d#"; //char *song = "TopGun:d=4,o=4,b=31:32p,16c#,16g#,16g#,32f#,32f,32f#,32f,16d#,16d#,32c#,32d#,16f,32d#,32f,16f#,32f,32c#,16f,d#,16c#,16g#,16g#,32f#,32f,32f#,32f,16d#,16d#,32c#,32d#,16f,32d#,32f,16f#,32f,32c#,g#"; //char *song = "A-Team:d=8,o=5,b=125:4d#6,a#,2d#6,16p,g#,4a#,4d#.,p,16g,16a#,d#6,a#,f6,2d#6,16p,c#.6,16c6,16a#,g#.,2a#"; //char *song = "Flinstones:d=4,o=5,b=40:32p,16f6,16a#,16a#6,32g6,16f6,16a#.,16f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c6,d6,16f6,16a#.,16a#6,32g6,16f6,16a#.,32f6,32f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c6,a#,16a6,16d.6,16a#6,32a6,32a6,32g6,32f#6,32a6,8g6,16g6,16c.6,32a6,32a6,32g6,32g6,32f6,32e6,32g6,8f6,16f6,16a#.,16a#6,32g6,16f6,16a#.,16f6,32d#6,32d6,32d6,32d#6,32f6,16a#,16c.6,32d6,32d#6,32f6,16a#,16c.6,32d6,32d#6,32f6,16a#6,16c7,8a#.6"; //char *song = "Jeopardy:d=4,o=6,b=125:c,f,c,f5,c,f,2c,c,f,c,f,a.,8g,8f,8e,8d,8c#,c,f,c,f5,c,f,2c,f.,8d,c,a#5,a5,g5,f5,p,d#,g#,d#,g#5,d#,g#,2d#,d#,g#,d#,g#,c.7,8a#,8g#,8g,8f,8e,d#,g#,d#,g#5,d#,g#,2d#,g#.,8f,d#,c#,c,p,a#5,p,g#.5,d#,g#"; //char *song = "Gadget:d=16,o=5,b=50:32d#,32f,32f#,32g#,a#,f#,a,f,g#,f#,32d#,32f,32f#,32g#,a#,d#6,4d6,32d#,32f,32f#,32g#,a#,f#,a,f,g#,f#,8d#"; //char *song = "Smurfs:d=32,o=5,b=200:4c#6,16p,4f#6,p,16c#6,p,8d#6,p,8b,p,4g#,16p,4c#6,p,16a#,p,8f#,p,8a#,p,4g#,4p,g#,p,a#,p,b,p,c6,p,4c#6,16p,4f#6,p,16c#6,p,8d#6,p,8b,p,4g#,16p,4c#6,p,16a#,p,8b,p,8f,p,4f#"; //char *song = "MahnaMahna:d=16,o=6,b=125:c#,c.,b5,8a#.5,8f.,4g#,a#,g.,4d#,8p,c#,c.,b5,8a#.5,8f.,g#.,8a#.,4g,8p,c#,c.,b5,8a#.5,8f.,4g#,f,g.,8d#.,f,g.,8d#.,f,8g,8d#.,f,8g,d#,8c,a#5,8d#.,8d#.,4d#,8d#."; //char *song = "LeisureSuit:d=16,o=6,b=56:f.5,f#.5,g.5,g#5,32a#5,f5,g#.5,a#.5,32f5,g#5,32a#5,g#5,8c#.,a#5,32c#,a5,a#.5,c#.,32a5,a#5,32c#,d#,8e,c#.,f.,f.,f.,f.,f,32e,d#,8d,a#.5,e,32f,e,32f,c#,d#.,c#"; char *song = "MissionImp:d=16,o=6,b=95:32d,32d#,32d,32d#,32d,32d#,32d,32d#,32d,32d,32d#,32e,32f,32f#,32g,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,g,8p,g,8p,a#,p,c7,p,g,8p,g,8p,f,p,f#,p,a#,g,2d,32p,a#,g,2c#,32p,a#,g,2c,a#5,8c,2p,32p,a#5,g5,2f#,32p,a#5,g5,2f,32p,a#5,g5,2e,d#,8d"; volatile unsigned int time = 0; #define isdigit(n) (n >= '0' && n <= '9') /** Delay function. **/ delay(unsigned int ms) { volatile unsigned int i,ms2; i = time; ms2 = ms*2; while ((time-i) < ms2) { nop(); } } play(unsigned int hz){ CCR0 = (1000000/hz) -1; CCR1 = (1000000/hz)/2; TACTL = TASSEL_2 + MC_1; } stop(){ TACTL = TASSEL_2 + MC_3; //stop CCR0 = 0; } int main(void) { WDTCTL = WDTPW+WDTTMSEL+WDTCNTCL+WDTIS1; // Set interval mode, set to zero and interval to 0.5 ms IE1 |= WDTIE; // Enable WDT interrupt BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; eint(); P1DIR |= BIT2; // P1.2 to output P1DIR |= BIT1; // P1.1 to output P1OUT |= ~BIT1; P1SEL |= BIT2; // P1.2 to TA0.1 CCTL1 = OUTMOD_7; // CCR1 reset/set byte default_dur = 4; byte default_oct = 6; int bpm = 63; int num; long wholenote; long duration; byte note; byte scale; char *p=song; while(*p != ':') p++; // ignore name p++; // skip ':' // get default duration if(*p == 'd') { p++; p++; // skip "d=" num = 0; while(isdigit(*p)) { num = (num * 10) + (*p++ - '0'); } if(num > 0) default_dur = num; p++; // skip comma } // get default octave if(*p == 'o') { p++; p++; // skip "o=" num = *p++ - '0'; if(num >= 3 && num <=7) default_oct = num; p++; // skip comma } // get BPM if(*p == 'b') { p++; p++; // skip "b=" num = 0; while(isdigit(*p)) { num = (num * 10) + (*p++ - '0'); } bpm = num; p++; // skip colon } // BPM usually expresses the number of quarter notes per minute wholenote = (60 * 1000L / bpm) * 4; // this is the time for whole note (in milliseconds) // now begin note loop while(*p) { // first, get note duration, if available num = 0; while(isdigit(*p)) { num = (num * 10) + (*p++ - '0'); } if(num) duration = wholenote / num; else duration = wholenote / default_dur; // we will need to check if we are a dotted note after // now get the note note = 0; switch(*p) { case 'c': note = 1; break; case 'd': note = 3; break; case 'e': note = 5; break; case 'f': note = 6; break; case 'g': note = 8; break; case 'a': note = 10; break; case 'b': note = 12; break; case 'p': default: note = 0; } p++; // now, get optional '#' sharp if(*p == '#') { note++; p++; } // now, get optional '.' dotted note if(*p == '.') { duration += duration/2; p++; } // now, get scale if(isdigit(*p)) { scale = *p - '0'; p++; } else { scale = default_oct; } scale += OCTAVE_OFFSET; if(*p == ',') p++; // skip comma for next note (or we may be at the end) // now play the note if(note) { play(notes[(scale - 4) * 12 + note]); delay(duration); stop(); } else { delay(duration); } } dint(); _BIS_SR(LPM4_bits); } interrupt(WDT_VECTOR) watchdog_timer (void) //__interrupt void watchdog_timer { time++; } jsolarski, gatesphere, bluehash and 3 others 6 Quote Link to post Share on other sites
bluehash 1,581 Posted February 12, 2011 Share Posted February 12, 2011 Nice work! Quote Link to post Share on other sites
GeekDoc 226 Posted February 12, 2011 Share Posted February 12, 2011 Very cool! I particularly like your choice of tunes! BTW: Linking to a relevant post on your blog is definitely okay! Many (like me) have a link to the home page of their blog in their 'signature' that shows up in every post. You can add it in the "User Control Panel" (link in the forum header). Quote Link to post Share on other sites
OCY 19 Posted February 12, 2011 Share Posted February 12, 2011 Very interesting project. I did something with those same hardware Quote Link to post Share on other sites
gatesphere 45 Posted February 12, 2011 Share Posted February 12, 2011 This is very cool. Keep up the good work! Quote Link to post Share on other sites
JMLB 24 Posted March 20, 2011 Share Posted March 20, 2011 Just thought I would let you know. I took some of your code to make an awesome St-Pats hat. I found the notes to rocky road to Dublin (not sure if it was exact though) put it in a hat. I also added some lights that attempt to flash with the beat. I had only 1 evening to get this going. Thanks for the code bud made me a star jsolarski 1 Quote Link to post Share on other sites
timotet 44 Posted April 27, 2011 Share Posted April 27, 2011 Ive been trying to get this to compile with CCS, with no luck. could someone give some advice on what to change? this is the error: run placement fails for object ".stack", size 0x32 (page 0). Available ranges: RAM size: 0x80 unused: 0x12 max hole: 0x12 sofar Ive changed: eint(); changed to _BIS_SR(GIE); //enable interrupts nop(); changed to return dint(); I dont know what this does so I commented it out thanks tim maybe someday when I feel like I have a small grasp on what Im doing with CCS and coding in general Ill give mspgcc a shot. Quote Link to post Share on other sites
bluehash 1,581 Posted April 27, 2011 Share Posted April 27, 2011 run placement fails for object ".stack", size 0x32 (page 0). Available ranges: RAM size: 0x80 unused: 0x12 max hole: 0x12 Looks like you are running out of stack space. Your project compiled fine, but was unable to link it to memory as it ran out of space. See second post: http://e2e.ti.com/support/microcontroll ... 71835.aspx I don't knwo ow much you need, as you have not attached the .MAP file. If you do not know where it is, it is in the same folder as your .out file. Quote Link to post Share on other sites
timotet 44 Posted April 27, 2011 Share Posted April 27, 2011 thanks bluehash I tried increasing the stack size , to no avail. What exactly am I looking for in the map file? here is what it says for RAM: name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- RAM 00000200 00000080 0000006e 00000012 RWIX thanks Quote Link to post Share on other sites
bluehash 1,581 Posted April 27, 2011 Share Posted April 27, 2011 Attach your map file. Quote Link to post Share on other sites
timotet 44 Posted April 27, 2011 Share Posted April 27, 2011 here it is : ****************************************************************************** MSP430 Evaluation Linker PC v3.3.3 ****************************************************************************** >> Linked Wed Apr 27 12:40:40 2011 OUTPUT FILE NAME: ENTRY POINT SYMBOL: "_c_int00" address: 0000fc80 MEMORY CONFIGURATION name origin length used unused attr fill ---------------------- -------- --------- -------- -------- ---- -------- SFR 00000000 00000010 00000000 00000010 RWIX PERIPHERALS_8BIT 00000010 000000f0 00000000 000000f0 RWIX PERIPHERALS_16BIT 00000100 00000100 00000000 00000100 RWIX RAM 00000200 00000080 0000006e 00000012 RWIX INFOD 00001000 00000040 00000000 00000040 RWIX INFOC 00001040 00000040 00000000 00000040 RWIX INFOB 00001080 00000040 00000000 00000040 RWIX INFOA 000010c0 00000040 00000000 00000040 RWIX FLASH 0000f800 000007e0 00000676 0000016a RWIX INT00 0000ffe0 00000002 00000000 00000002 RWIX INT01 0000ffe2 00000002 00000000 00000002 RWIX INT02 0000ffe4 00000002 00000000 00000002 RWIX INT03 0000ffe6 00000002 00000000 00000002 RWIX INT04 0000ffe8 00000002 00000000 00000002 RWIX INT05 0000ffea 00000002 00000000 00000002 RWIX INT06 0000ffec 00000002 00000000 00000002 RWIX INT07 0000ffee 00000002 00000000 00000002 RWIX INT08 0000fff0 00000002 00000000 00000002 RWIX INT09 0000fff2 00000002 00000000 00000002 RWIX INT10 0000fff4 00000002 00000002 00000000 RWIX INT11 0000fff6 00000002 00000000 00000002 RWIX INT12 0000fff8 00000002 00000000 00000002 RWIX INT13 0000fffa 00000002 00000000 00000002 RWIX INT14 0000fffc 00000002 00000000 00000002 RWIX RESET 0000fffe 00000002 00000002 00000000 RWIX SECTION ALLOCATION MAP output attributes/ section page origin length input sections -------- ---- ---------- ---------- ---------------- .stack 0 00000000 00000064 FAILED TO ALLOCATE .pinit 0 0000f800 00000000 UNINITIALIZED .bss 0 00000200 0000006e UNINITIALIZED 00000200 00000066 music.obj (.bss) 00000266 00000004 rts430.lib : _lock.obj (.bss) 0000026a 00000004 : boot.obj (.bss) .text 0 0000f800 000004fc 0000f800 00000334 music.obj (.text:main) 0000fb34 00000058 rts430.lib : div32u.obj (.text) 0000fb8c 00000046 : autoinit.obj (.text:_auto_init) 0000fbd2 00000042 music.obj (.text:play) 0000fc14 00000040 rts430.lib : div32s.obj (.text) 0000fc54 0000002c music.obj (.text:delay) 0000fc80 00000026 rts430.lib : boot.obj (.text:_c_int00_noexit) 0000fca6 00000014 : mult16.obj (.text) 0000fcba 00000012 : memcpy.obj (.text:memcpy) 0000fccc 00000010 : epilog.obj (.text) 0000fcdc 0000000c music.obj (.text:stop) 0000fce8 0000000a music.obj (.text:WDT_ISR) 0000fcf2 00000004 rts430.lib : pre_init.obj (.text:_system_pre_init) 0000fcf6 00000004 : exit.obj (.text:abort) 0000fcfa 00000002 : _lock.obj (.text:_nop) .const 0 0000fcfc 00000106 0000fcfc 00000106 music.obj (.const:.string) .cinit 0 0000fe02 00000074 0000fe02 00000072 music.obj (.cinit) 0000fe74 00000002 --HOLE-- [fill = 0] .int10 0 0000fff4 00000002 0000fff4 00000002 music.obj (.int10) .reset 0 0000fffe 00000002 0000fffe 00000002 rts430.lib : boot.obj (.reset) GLOBAL SYMBOLS: SORTED ALPHABETICALLY BY Name address name -------- ---- 00000200 .bss 0000f800 .text 00000057 BCSCTL1 00000058 BCSCTL2 00000053 BCSCTL3 0000fcf6 C$$EXIT 000010ff CALBC1_1MHZ 000010fe CALDCO_1MHZ 00000056 DCOCTL 00000128 FCTL1 0000012a FCTL2 0000012c FCTL3 00000000 IE1 00000002 IFG1 00000022 P1DIR 00000025 P1IE 00000024 P1IES 00000023 P1IFG 00000020 P1IN 00000021 P1OUT 00000027 P1REN 00000026 P1SEL 0000002a P2DIR 0000002d P2IE 0000002c P2IES 0000002b P2IFG 00000028 P2IN 00000029 P2OUT 0000002f P2REN 0000002e P2SEL 00000172 TACCR0 00000174 TACCR1 00000162 TACCTL0 00000164 TACCTL1 00000160 TACTL 0000012e TAIV 00000170 TAR 00000120 WDTCTL 0000fce8 WDT_ISR 00000064 __STACK_END 00000064 __STACK_SIZE 00000001 __TI_args_main 00000001 __TI_auto_init 00000001 __TI_exit ffffffff __binit__ 00000200 __bss__ ffffffff __c_args__ 0000fe02 __cinit__ 0000fc14 __divli 0000fb34 __divul 0000026e __end__ 0000fcfc __etext__ 0000fca6 __mpyi ffffffff __pinit__ 0000fc14 __remli 0000fb34 __remul 0000f800 __text__ 0000fb8c _auto_init 0000fc80 _c_int00 0000fc80 _c_int00_noexit 0000026a _cleanup_ptr 0000026c _dtors_ptr 00000266 _lock 0000fcfa _nop 0000fffe _reset_vector 00000000 _stack 0000fcf2 _system_pre_init 00000268 _unlock 0000fcf6 abort ffffffff binit 0000fe02 cinit 0000fc54 delay 0000026e end 0000fcfc etext 0000fcd8 func_epilog_1 0000fcd6 func_epilog_2 0000fcd4 func_epilog_3 0000fcd2 func_epilog_4 0000fcd0 func_epilog_5 0000fcce func_epilog_6 0000fccc func_epilog_7 0000f800 main 0000fcba memcpy 00000202 notes ffffffff pinit 0000fbd2 play 00000264 song 0000fcdc stop 00000200 time GLOBAL SYMBOLS: SORTED BY Symbol Address address name -------- ---- 00000000 IE1 00000000 _stack 00000001 __TI_args_main 00000001 __TI_auto_init 00000001 __TI_exit 00000002 IFG1 00000020 P1IN 00000021 P1OUT 00000022 P1DIR 00000023 P1IFG 00000024 P1IES 00000025 P1IE 00000026 P1SEL 00000027 P1REN 00000028 P2IN 00000029 P2OUT 0000002a P2DIR 0000002b P2IFG 0000002c P2IES 0000002d P2IE 0000002e P2SEL 0000002f P2REN 00000053 BCSCTL3 00000056 DCOCTL 00000057 BCSCTL1 00000058 BCSCTL2 00000064 __STACK_END 00000064 __STACK_SIZE 00000120 WDTCTL 00000128 FCTL1 0000012a FCTL2 0000012c FCTL3 0000012e TAIV 00000160 TACTL 00000162 TACCTL0 00000164 TACCTL1 00000170 TAR 00000172 TACCR0 00000174 TACCR1 00000200 .bss 00000200 __bss__ 00000200 time 00000202 notes 00000264 song 00000266 _lock 00000268 _unlock 0000026a _cleanup_ptr 0000026c _dtors_ptr 0000026e __end__ 0000026e end 000010fe CALDCO_1MHZ 000010ff CALBC1_1MHZ 0000f800 .text 0000f800 __text__ 0000f800 main 0000fb34 __divul 0000fb34 __remul 0000fb8c _auto_init 0000fbd2 play 0000fc14 __divli 0000fc14 __remli 0000fc54 delay 0000fc80 _c_int00 0000fc80 _c_int00_noexit 0000fca6 __mpyi 0000fcba memcpy 0000fccc func_epilog_7 0000fcce func_epilog_6 0000fcd0 func_epilog_5 0000fcd2 func_epilog_4 0000fcd4 func_epilog_3 0000fcd6 func_epilog_2 0000fcd8 func_epilog_1 0000fcdc stop 0000fce8 WDT_ISR 0000fcf2 _system_pre_init 0000fcf6 C$$EXIT 0000fcf6 abort 0000fcfa _nop 0000fcfc __etext__ 0000fcfc etext 0000fe02 __cinit__ 0000fe02 cinit 0000fffe _reset_vector ffffffff __binit__ ffffffff __c_args__ ffffffff __pinit__ ffffffff binit ffffffff pinit [89 symbols] didnt post it before because its kinda long thanks Quote Link to post Share on other sites
bluehash 1,581 Posted April 27, 2011 Share Posted April 27, 2011 What did you increase the size to? Write in hex and decimal. Quote Link to post Share on other sites
timotet 44 Posted April 27, 2011 Share Posted April 27, 2011 as per the instructions in the post you sent me to ,I looked up the stack size for my project and it said 50. So I then changed it to 80, didnt work, so I tried 100 and that didnt work either. The map file I posted is for my project with the stack set back to 50. decimal 50 == 0x32 decimal 80 == 0x50 decimal 100 == 0x64 Is this what you were looking for? does mspgcc allocate more stack than ccs? thanks Quote Link to post Share on other sites
bluehash 1,581 Posted April 27, 2011 Share Posted April 27, 2011 Thats what I wanted. Your map file says: .stack 0 00000000 00000064 FAILED TO ALLOCATE So stack needs 64h. Put in decimal 150 or 96 hex does mspgcc allocate more stack than ccs? Probably. I haven't had a chance to use it. Quote Link to post Share on other sites
timotet 44 Posted April 27, 2011 Share Posted April 27, 2011 ok changed from 50 to 150 and from 50 to 0x96. error reads: run placement fails for object ".stack", size 0x96 (page 0). Available ranges: RAM size: 0x80 unused: 0x12 max hole: 0x12 music line 0 1303938456021 813 now map file reads: .stack 0 00000000 00000096 FAILED TO ALLOCATE thanks Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.