Jump to content

lastaid

Members
  • Content Count

    73
  • Joined

  • Last visited

  1. At least you are smart enough to use transistors from the start ... i once blew a pin on the launchpad trying to drive some leds in tri-state mode ...
  2. used tristate mode, only the pins got fried. one of the bigger problems is that sometimes the power of the mcu doesn't cut it [ or the delay between "move clockhand" is just to short ]. in this case it does not move the clockhand. unfortunatly this only occured after a few weeks ... don't think it was the batteries. will do a version with a proper hbridge.
  3. can confirm the voltage spikes, build one of those for a friend, broke after one and a half month.
  4. Hey is it ok to join this with a project i already posted? Have not used it for any contests ^^ http://forum.43oh.com/topic/4262-annoy-a-tron-20/ Have fun!
  5. Hey, Detected SW delay loop using empty loop. Recommend using a timer module this is because you are using a while loop and ccs is warning you that this might not be energy efficient, in this case its ok (imo) For the other Error message, can you tell me what msp you are using and what header file you have included? -lastaid
  6. lastaid

    Annoy A Tron 2.0

    I might need to completly rework this thing. It seems like a problem you might only confronted with in warfare, but if a friend finds this annoyatron and deploys it in your flat, which is way messier due to electronic projects and part bins lying around, you're fucked. i am currently thinking about making an enclosure that is conductive, uses a pin with cap touch capabilities to check if the device was found and then writes a certain value to flash which disables the annoyatron even if it is restartet. that way only someone with a programmer could re-use it. this on the other hand might interfere with the low power idea, but i don't have any idea how much energy touch i/o actually eats. any suggestions? lastaid
  7. I do realize that it might be unwise to power an led through a port using this setup, but a transistor might work and solve this problem, at least for my use cases [ see http://forum.43oh.com/topic/4262-annoy-a-tron-20/ ] what i was asking for is your suggestion how to connect everything. tst to tst, rst to rst, but where to connect power and where to connect ground? could it just be any pin? thanks -lastaid
  8. Wait ... how exactly would i use such a device considering 2 scenarios I want that 6 pin device in my launchpad and still program it. I want that 6 pin device in my breadboard and use it. this is quite interesting if i want to minify a project and am incapable/uninterested of creating custom boards and/or soldering small packages thanks, -lastaid
  9. lastaid

    Annoy A Tron 2.0

    Hey , Ok, i am currently building 2 kinds of annoyatrons, one being very small an having a high annoy frequency ( delay between beeps) and the other one a huge annoyatron that rarely beebs but is insanly loud and has oversized batteries because i was afraid that a coincell might not provide enough juice and the mcu would brownout. the big version can be attached to anything metal thanks to a harddrive donored magnet. the small one will fit in a matchbox so it can be hidden in plain sight. http://youtu.be/90sXqgu-0XA here is a video of the breadboard circuit in action, the beep is somewhere around 0:53 and might not be audible on some speakers. still wondering how much power this circuit really draws. -lastaid
  10. lastaid

    Annoy A Tron 2.0

    And yet again, i had to rework it a little. Features now include : Adjustable delay before device becomes armed LED indicator that the device has power and has entered sleep mode The seed for the PRNG are sourced from a a floating pin, Its a state machine As with the last post, i'd really welcome some ideas especially concerning accuracy of the clock and power saving. But i think it might run a while on a cr2032 coincell. #include "msp430g2231.h" #define PIEZO BIT6 #define LED1 BIT0 #define TRUE 1 #define FALSE 0 #define STATE_SLEEPING 1 #define STATE_NOTIFY 2 #define STATE_ARMED 3 #define STATE_ANNOYING 4 unsigned short lfsr = 0xACE1u; short hours = 0; short minutes = 10; short seconds = 0; short state = 0; unsigned int getRnd (void); void timer (void); void initPWM (void); short getRandom(void); unsigned i=0; int LPMMode = 0; void main(void) { state = STATE_NOTIFY; BCSCTL3 |= LFXT1S_2; // Set VLO WDTCTL = WDT_ADLY_250; // Set WDT to timer mode at 250ms, with VLO this is 2740 / 4ms IE1 |= WDTIE; // Enable WDT+ interrupt P1DIR |= PIEZO + LED1; // P1.2 PWM output/P1.6 constant output P1OUT = 0; lfsr = getRandom(); // initiate lfsr randomly unsigned int delay = 1; while(TRUE) { switch( state ) { case STATE_SLEEPING : LPMMode = 0; i = 0; // keeps or counter from overflowing // without having to put more stuff into the isr seconds -= 3; if ( seconds <= 0) { // count down timer until deployment // we are compensating for the LARGELY inaccurate vlo seconds = 60; if (minutes--<= 0) { minutes = 60; if (hours-- <= 0) { state = STATE_ARMED; // time has run out, lets go to armed P1SEL |= PIEZO; CCR0 = 42; // Set PWM parameters, CCR0 is PWM Period/2 CCR1 = 21; // Duty cycle TACTL = TASSEL_2 + MC_3; } } } break; case STATE_NOTIFY : P1OUT ^= LED1; if (i++ >= 5) { state = STATE_SLEEPING; P1OUT &= ~LED1; i = 0; WDTCTL = WDT_ADLY_1000; // Set WDT to timer mode at 1000ms, with VLO this is 2740ms } break; case STATE_ARMED : if ( i++ >= delay ) state = STATE_ANNOYING; break; case STATE_ANNOYING : state = STATE_SLEEPING; CCTL1 = OUTMOD_6; // Start P1.2 PWM output // WDTCTL = WDT_ADLY_250; // Reset WDT+ timer to 250ms, with VLO source this is 685ms LPMMode = 0; _BIS_SR(LPM0_bits + GIE); // Go to sleep CCTL1 = OUTMOD_0; i=0; delay = (getRnd() >> 7); break; } LPMMode = 3; _BIS_SR(LPM3_bits + GIE);// Enter LPM3 w/ interrupt } } // WDT+ ISR for time between beeps and reset for beep length #pragma vector=WDT_VECTOR __interrupt void watchdog_timer (void) { if(LPMMode == 3) _BIC_SR_IRQ(LPM3_bits); else if(LPMMode == 0) _BIC_SR_IRQ(LPM0_bits); } unsigned int getRnd (void) { lfsr = (lfsr >> 1) ^ (-(lfsr & 1u) & 0xB400u); return lfsr; } short getRandom(void){ ADC10CTL1 |= INCH_5; ADC10CTL0 |= SREF_1 + ADC10SHT_1 + REFON + ADC10ON; ADC10CTL0 |= ENC + ADC10SC; while(ADC10CTL1 & ADC10BUSY); return ADC10MEM; } considering flash size, the 2231 is providing quite a lot of room for improvement. Text: 724 bytes Data: 4 bytes. you guys have fun, lastaid main.c
  11. Hey guys Prank Wars started early this year, so i tried to improve upon my old annoyatron. main differences are: only one unified timer interrupt using WDT and WDT_ADLY_1000 and the possibility to put the thing into sleep mode e.g. you can set a time in hours minutes and seconds until the annoyatron becomes active. good for hiding. my main concerns are : is there any way to improve the WDT timer accuracy without using ACLK is the code energy efficient? how much current does it eat, i don't have a scope and cannot check things like that how would one immitate a locust chirp ? any feedback is welcome #include "msp430g2231.h" #define PIEZO BIT6 #define LED1 BIT0 #define TRUE 1 #define FALSE 0 unsigned short lfsr = 0xACE1u; short hours = 0; short minutes = 10; short seconds = 0; short sleeping = TRUE; unsigned int getRnd (void); void timer (void); void initPWM (void); unsigned i=0; int LPMMode = 0; void main(void) { BCSCTL3 |= LFXT1S_2; // Set VLO WDTCTL = WDT_ADLY_1000; // Set WDT to timer mode at 1000ms, with VLO this is 2740ms IE1 |= WDTIE; // Enable WDT+ interrupt P1DIR |= PIEZO + LED1; // P1.2 PWM output/P1.6 constant output P1OUT = 0; unsigned int delay = 1; while(TRUE) { if (sleeping) { P1OUT ^= LED1; } else { P1OUT ^= LED1; } if (i>delay && !sleeping ) { CCTL1 = OUTMOD_6; // Start P1.2 PWM output // WDTCTL = WDT_ADLY_250; // Reset WDT+ timer to 250ms, with VLO source this is 685ms LPMMode = 0; _BIS_SR(LPM0_bits + GIE); // Go to sleep CCTL1 = OUTMOD_0; i=0; delay = (getRnd() >> 7); } LPMMode = 3; _BIS_SR(LPM3_bits + GIE);// Enter LPM3 w/ interrupt } } // WDT+ ISR for time between beeps and reset for beep length #pragma vector=WDT_VECTOR __interrupt void watchdog_timer (void) { if (sleeping) { LPMMode = 0; i = 0; // keeps or counter from overflowing // without having to put more stuff into the isr seconds -= 3; if ( seconds <= 0) { // count down timer until deployment // we are compensating for the LARGELY inaccurate vlo seconds = 60; if (minutes--<= 0) { minutes = 60; if (hours-- <= 0) { sleeping = seconds = minutes = hours = FALSE; P1SEL |= PIEZO; CCR0 = 42; // Set PWM parameters, CCR0 is PWM Period/2 CCR1 = 21; // Duty cycle TACTL = TASSEL_2 + MC_3; } } } } else { i++; } if(LPMMode == 3) _BIC_SR_IRQ(LPM3_bits); else if(LPMMode == 0) _BIC_SR_IRQ(LPM0_bits); } unsigned int getRnd () { lfsr = (lfsr >> 1) ^ (-(lfsr & 1u) & 0xB400u); return lfsr; } thanks, lastaid main.c
  12. lastaid

    gscope

    thanks! will try it once i have some time
  13. Thank you Larisan for this wonder, as well as thoughful gift A friend, studying electronical engineering, took a look at it and said "If you have the knowledge in this book, you are an engineering god". Thank you
  14. Hey, sorry for being way too late, though about fixing my camera first, but this will not happen so i will present to you stock images I've already read a few chapters of this wonderful book and cannot imagine anything better suited for me then this book [ finally understood opamps ]. But who was my secret santa? Thank you alot, as a beginner and Computer Science rather then Electronics student, this is really helpful. sorry for being so late, lastaid @bluehash hope you like it. I fixed up the screen and might even added an slightly improved soundport. Did it arrive unharmed? I could even imagine a project for you, reverse engineer the External Port Protocol and implement an AI enemy ;-)
  15. I just soldered a crystal to a 2x1 pin header ... quite convenient this way, and distance is maybe longer then oPossum's nice solution, but i can reuse the crystal.
×
×
  • Create New...