Jump to content
43oh

mbonnin

Members
  • Content Count

    5
  • Joined

  • Last visited

Reputation Activity

  1. Like
    mbonnin reacted to voelker in Launchpad Geocache box   
    When i developped the code i tried to use the libc function from math.h but cos, sin, sqrt would take too much space (i still don't really understand why ..). Only the atan2 function would work fine, but i decided to use a fast implementation found on internet. More over using my own function allows me to play with precision (i 'm only doing the relative positionning with a 100m precision). Even if my function are not optimized i have no problem, as i compute the distance and bearing only at 1hz.I also have implemented my own configurable parser for the gps stream, and my own sprintf routine to fit my small 2x8 lcd. I still have problem with the LCD that sometimes freezes (i may need to reset it at some point), but i have no time to work on it ...
  2. Like
    mbonnin reacted to voelker in [ ENDED ] Nov-Dec 2011 - 43oh Project of the Month Contest   
    Here is my entry to the project of the month contest, my geocache box. This box is an MSP430 based implementation of the reverse geocache puzzle. I will give this box to one of my cousin for christmas. To get the box to open, he will have to go through seven different locations using distance and bearing information. When all the destination will be completed the box can either be used as a development kit (gps+servo+display+switch), or serve as a personnal safe that remain closed for one year.
    All the code can be downloaded from http://code.google.com/p/msp430-reverse-geocache/. Video and schematic soon to come.

  3. Like
    mbonnin reacted to username in Laser Security V2 Msp430   
    yup, its 110mA at 9V. Got the ebay link below. There probably better options out there but this worked for me and was under 7usd. http://www.ebay.com/itm/120741728178?ss ... 1497.l2649
  4. Like
    mbonnin got a reaction from RobG in [ ENDED ] Nov-Dec 2011 - 43oh Project of the Month Contest   
    My entry for the POTM is the screaming tea timer I posted a few days ago.http://www.43oh.com/forum/viewtopic.php?f=9&t=1788
     
    It uses a MSP430G2553 to make a raving rabbids inspired tea timer that screams when the countdown reaches 0.
     
    Features:
    * ~2s scream output by PWM
    * 4xLR44 batteries
    * 2 input buttons
    * 1 line SPLC780D character display
    * baking time from 1s to 3 hours
    * 4 neodynium magnets to make it stick on the fridge
     



     
     
    All comments welcome.
  5. Like
    mbonnin reacted to username in Laser Security V2 Msp430   
    Hey All,
    Nate here. I'm currently a junior in EE and decided to use the msp430 in my Design 1 project(not senior design).
    Built a PCB and finalized most of the design.
    -Some basic features : LCD 16x2
    -120 db alarm (freaking loud)
    -1 5mw legal red laser
    -1 red led recieving diode
    -2 push buttons to enter in a code on the lcd screen
    Here some pics: (will upload a video of the operation when I get some time)
     


     

     

     

     

     
    Here is the schematic: (to big for site)
    http://img254.imageshack.us/img254/9838/lasersspdf.png
     
    and source code ( still in beta... needs abit of work as you tell)
     
    main.c

    // Laser Security System: // Code By Natahn Zimmerman // 11/9/11 /////////////Includes/////////////////// #include "msp430g2231.h" #include "lcd.h" /////////////LCD Defines//////////////// #define DATAPIN BIT6 #define CLOCKPIN BIT5 #define ENABLEPIN BIT4 //////////Other Micro Defines/////////// #define GLED BIT6 // Green LED saying that SS is good and active #define RLED BIT7 // Red LED saying that SS has been breached and alarm is high #define ALARM BIT7 // Also attached to RLED. #define TXD BIT0 // Serial Output #define RXD BIT1 // Serial Input #define SW1 BIT2 // Disable SS #define SW2 BIT3 // Disable SS //////////////Variables///////////////// volatile unsigned int i=1; // Variable for TXD Funciton. If this value goes above a certain point, security is breached. volatile unsigned int j=0; // Low State Check variable. This variable should increment to a certain point, if not, security is breached. volatile unsigned int t=0; // For loop variable for j. volatile unsigned int ticks=0; // Variable for Timer function. After this gets to a certain point alarm sounds. volatile unsigned int password=0; // value for number being keyed in on keypad. volatile unsigned int a = 0; // Password compare value volatile unsigned int c = 0; // Increment based upon password being correct. volatile unsigned int b = (0x80 | 0x40 | 0xA); // HD44780 Cursor location. char ptext[2]; // Password Char array. Bit 1 = password #, Bit 2 = null. //////////////PROTOS//////////////////// void TXD_RXD(void); // Prototype TXD Function void dis_alarm(void); //////////////Main////////////////////// void main(void) { _delay_cycles(20000); // debug delay WDTCTL = WDTPW + WDTHOLD; // turn off watchdog so micro does not reset _delay_cycles(100000); // debug delay P1OUT &= ~(CLOCKPIN + DATAPIN + RLED); //Set these pins low (ensures low when defined as output) P1OUT |= ENABLEPIN; // Set enable pin high. (ensures high when defined as output) P1DIR |= ENABLEPIN + CLOCKPIN + DATAPIN +RLED; // Define as outputs P1DIR &= ~(SW2 + SW1); // Define as perm inputs P1IE |= (SW1); // P1.2 interrupt enabled P1IFG &= ~(SW1); // P1.2 IFG cleared P1IE |= (SW2); // P1.3 interrupt enabled P1IFG &= ~(SW2); // P1.3 IFG cleared __enable_interrupt(); // enable all interrupts P2SEL = 0x00; // Set functionality of Port 2 to GPIO P2DIR |= GLED; // Set Green LED, AKA P2.6 AKA XIN to a output. P2OUT = 0; // Set all outputs on port 2 to 0. AKA GLED. P1DIR |= ( RLED + TXD); // All outputs except DIS_ALARM and RXD P1OUT &= ~(RLED +TXD); // All bits set high initally, need to set all bits low. P2OUT |= GLED; // Turns Green LED ON initDisplay(); // Turn on display. clearDisplay(); // Clear Display Print_Screen("Zalous Laser"); second_line(); Print_Screen("Security System"); _delay_cycles(5000000); clearDisplay(); Print_Screen("Laser System"); second_line(); Print_Screen("Now Activated"); _delay_cycles(20000); TXD_RXD(); // Should always stay in this state unless TXD != RXD. In which case the following happens: P2OUT &= ~GLED; // Green LED Turns off clearDisplay(); // Clear display for new text Print_Screen("Security System"); second_line(); Print_Screen("Breached! "); while(1) { P2OUT ^= GLED; // Blink Green LED CCTL0 = CCIE; // CCR0 interrupt enabled ( TIMER 1) CCR0 = 50000; // Set Timer Value TACTL = TASSEL_2 + MC_1; // Initialize Timer _delay_cycles(5000000); //Pause before enter password screen. clearDisplay(); Print_Screen("Please Enter"); second_line(); Print_Screen("Password: "); while(1) { if(ticks>500) // Ticks is a Timer Variable. User has 30 seconds to enter password before alarm sounds. { while(1) { P1OUT ^= RLED; //Pulse alarm. _delay_cycles(500000); } } } } } // End main void TXD_RXD(void) { while(i < 10) { P1OUT |= TXD; __delay_cycles(5); if((RXD & P1IN)==0) { i++; } P1OUT &= ~TXD; __delay_cycles(20); for(t=0;t<10;t++) { if((RXD & P1IN)==0) { j++; } } if(j>5) { j=0; } else { i++; } __delay_cycles(20); } // End While } // End Function void dis_alarm(void) { P1OUT &= ~TXD; for(i=0;i<10;i++) { _delay_cycles(300000); P2OUT ^= GLED; } WDTCTL = WDT_MRST_32 + ~WDTHOLD; } // Port 1 interrupt service routine #pragma vector=PORT1_VECTOR __interrupt void Port_1(void) { _delay_cycles(10); if(((SW1 & P1IN)) == 0) { password++; ptext[0] = password + '0'; ptext[1] = 0; _delay_cycles(2000); sendInstruction(b+a); _delay_cycles(2000); Print_Screen(ptext); _delay_cycles(2000); P2OUT ^= GLED; } if(((SW2 & P1IN)) == 0) { a++; _delay_cycles(2000); sendInstruction(b+a); _delay_cycles(2000); P2OUT ^= GLED; Print_Screen("_"); if(a==1) { if(password==3) { c++; } } if(a==2) { if(password==8) { c++; } } if(a==3) { if(password==9) { c++; } } if(a==4) { if(password==1) { c++; } } if(a==4) { if(password==2) { c++; c++; } } if(c==4) { CCTL0 &= ~CCIE; _delay_cycles(20000); __disable_interrupt(); _delay_cycles(120000); WDTCTL = WDT_MRST_32 + ~WDTHOLD; _delay_cycles(120000); } if(c==5) // debug feature. laser = always on. useful for { P1OUT = TXD; } // end if(a==4) { sendInstruction(b+a); Print_Screen(" "); a=0; c=0; sendInstruction(b+a); Print_Screen("_"); } // End If a == 4 password=0; } _delay_cycles(200000); P1IFG &= ~SW1; // P1.2 IFG cleared P1IFG &= ~SW2; // P1.3 IFG cleared } // End ISR #pragma vector=TIMERA0_VECTOR __interrupt void Timer_A (void) { P2OUT ^= GLED; // Toggle P1.0 ticks++; }
     
    and lcd.h (many thanks to RobG for his LCD code. Modified it abit and it works incredibly well! )
     

    #ifndef LCD_H_ #define LCD_H_ #define sendData(data) send(data, 1) #define sendInstruction(data) send(data, 0) #define initDisplay() sendInstruction(0x3C); sendInstruction(0x0C); clearDisplay(); sendInstruction(0x06) #define clearDisplay() sendInstruction(0x01); _delay_cycles(2000) #define second_line() sendInstruction((0x80 | 0x40)); _delay_cycles(2000) #define DATAPIN BIT6 #define CLOCKPIN BIT5 #define ENABLEPIN BIT4 void send(char data, char registerSelect); void sendDataArray(char data[], char length); void Print_Screen(char *texts); char charIndex = 0; char bitCounter = 0; void sendDataArray(char data[], char length) { charIndex = 0; while(charIndex < length) { sendData(data[charIndex]); charIndex++; } } void send(char data, char registerSelect) { bitCounter = 0; while(bitCounter < 8) { (data & BIT7) ? (P1OUT |= DATAPIN) : (P1OUT &= ~DATAPIN); data <<= 1; P1OUT |= CLOCKPIN; P1OUT &= ~CLOCKPIN; bitCounter++; } registerSelect ? (P1OUT |= DATAPIN) : (P1OUT &= ~DATAPIN); P1OUT &= ~ENABLEPIN; P1OUT |= ENABLEPIN; } void Print_Screen(char *texts) { volatile int i=0; char *h; h=texts; for(i=0;i<16;i++) { if(h[i]==0) { break; } } sendDataArray(h, i); } #endif /*LCD_H_*/

  6. Like
    mbonnin got a reaction from gordon in Screaming Teaaa timer   
    This is my first project with a MSP430. It uses a MSP430G2553 to make a tea timer (or cake timer or whatever that needs baking timer...) in form a a raving rabbit that screams when the countdown reaches 0.
     

     
    The sound is output using PWM and stored inside the internal flash. It is 8kHz/8 bit and lasts for a bit less than 2 seconds to keep some space for the program code. The display is a 1 line LCD character display.
     

     
    The timer is powered by 4 x LR44 batteries so that the board can fit inside a small form factor. The time is set using 2 buttons and the countdown starts as soon as a button is released. When idle, the MSP is in LPM4 and consumes almost nothing. When screaming on the other hand, the circuit eats 80mA, so I am not sure how long the batteries will last. I have found it quite difficult to have a decent audio output level with these little batteries so I might try something else in the future (anyone tried LiPo ?)
     
    Source code/schematics, details are on my blog at mbonnin. I'll post the exact link once I can add external links to my posts. In the meantime, you can download them here:timer.tar.gz
     
    Schematics are a bit messy but should more or less work. All comment welcome.
  7. Like
    mbonnin got a reaction from oPossum in Screaming Teaaa timer   
    This is my first project with a MSP430. It uses a MSP430G2553 to make a tea timer (or cake timer or whatever that needs baking timer...) in form a a raving rabbit that screams when the countdown reaches 0.
     

     
    The sound is output using PWM and stored inside the internal flash. It is 8kHz/8 bit and lasts for a bit less than 2 seconds to keep some space for the program code. The display is a 1 line LCD character display.
     

     
    The timer is powered by 4 x LR44 batteries so that the board can fit inside a small form factor. The time is set using 2 buttons and the countdown starts as soon as a button is released. When idle, the MSP is in LPM4 and consumes almost nothing. When screaming on the other hand, the circuit eats 80mA, so I am not sure how long the batteries will last. I have found it quite difficult to have a decent audio output level with these little batteries so I might try something else in the future (anyone tried LiPo ?)
     
    Source code/schematics, details are on my blog at mbonnin. I'll post the exact link once I can add external links to my posts. In the meantime, you can download them here:timer.tar.gz
     
    Schematics are a bit messy but should more or less work. All comment welcome.
  8. Like
    mbonnin got a reaction from bluehash in Screaming Teaaa timer   
    This is my first project with a MSP430. It uses a MSP430G2553 to make a tea timer (or cake timer or whatever that needs baking timer...) in form a a raving rabbit that screams when the countdown reaches 0.
     

     
    The sound is output using PWM and stored inside the internal flash. It is 8kHz/8 bit and lasts for a bit less than 2 seconds to keep some space for the program code. The display is a 1 line LCD character display.
     

     
    The timer is powered by 4 x LR44 batteries so that the board can fit inside a small form factor. The time is set using 2 buttons and the countdown starts as soon as a button is released. When idle, the MSP is in LPM4 and consumes almost nothing. When screaming on the other hand, the circuit eats 80mA, so I am not sure how long the batteries will last. I have found it quite difficult to have a decent audio output level with these little batteries so I might try something else in the future (anyone tried LiPo ?)
     
    Source code/schematics, details are on my blog at mbonnin. I'll post the exact link once I can add external links to my posts. In the meantime, you can download them here:timer.tar.gz
     
    Schematics are a bit messy but should more or less work. All comment welcome.
×
×
  • Create New...