Jump to content
43oh

mcookieman

Members
  • Content Count

    4
  • Joined

  • Last visited

Reputation Activity

  1. Like
    mcookieman reacted to jbremnant in MSP430 and Nokia 6100 LCD   
    Here's a preview of my msp430 project.
     


     
    Just started mucking around with sparkfun lcd breakout board.
    Managed to take the code they had for arduino and made it work with msp430g2211 on mini breadboard.
     

     
    Next steps:
     
    - use simpleavr's i2c library to interface against wii nunchuck
    - make a simplegame that uses wii nunchuck for user input and lcd display for graphics
    - thinking about making the system modular by breaking functionality into 2 msp430g2211 chips:
    one handling lcd graphics and the other on game logic and wii nunchuck.
    the chips would communicate over SPI.
    - replace sparkfun's lcd breakout with low cost soloution: custom made pcb, and a few components.
     
    As time permits, I'll post the code, etc...
    I'll attempt to fit everything on a mini breadboard. (inspiration from simpleavr's projects)
    Let's see how this goes.
     
    EDIT: dang, you can hear my baby crying in the background in the video. what a nice dad. 8-)
  2. Like
    mcookieman got a reaction from hiatus138 in RCremote (Can also be used to control 8(+?) servos)   
    First post! Hello, I'm currently making a RC remote for my quadcopter which I am in the process of building. The idea is to output a ppm frame which then goes into a FrSky module which beams it to a receiver on my quadcopter. I currently have the code for ppm generation done. I am reading up on i2c with the UCSI module in the msp430g2553 right now and will hook it up to a wii nunchuk for testing. The end product will have recycled gymbals from an esky transmitter remote hooked up to it's own microcontroller acting as an i2c slave to the ppm generation microcontroller.
     

    #include #include int Pnum = 1; //Stores the number of pulses triggered so far in current ppm frame int servo[8] = {1000,1150,1300,1450,1500,1750,1900,2000}; // Servo pulse values void main(void) { WDTCTL = WDTPW|WDTHOLD; //stop watchdog timer BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; P1OUT = BIT6|BIT0; //Preload P1.2 on P1DIR = BIT6|BIT0; //Set P1.2 to output TA0CCR0 = 100; //Timerinitiallycountsuptothisvalue.Mustbelongenoughforeverythingtosetup TA0CCTL0 = CCIE; //Enable interrupts on CCR0 TA1CCR0 = 20000; //Length of PPM frame minus one TA0CTL = MC_1|ID_0|TASSEL_2|TACLR; //Setup TimerA0 (up mode|clock divide by 1|SMCLK|Clear timer) TA1CTL = MC_1|ID_0|TASSEL_2|TACLR; //Setup TimerA1 (up mode|clock divide by 1|SMCLK|Clear timer) __enable_interrupt(); //enable interrupts for(; //infinite loop { } } #pragma vector = TIMER0_A0_VECTOR //T0A0_ISR __interrupt void T0A0_ISR (void) { P1OUT &= ~BIT6; _delay_cycles(300); P1OUT |= BIT6; if(Pnum != 9) { TA0CCR0 = servo[(Pnum-1)]; //Servo pulse Pnum++; //increment Pnum } else { TA0CCR0 = (20000-(TA1R)); //Sync pulse Pnum = 1; //Reset Pnum } }
    This is the code I have right now. The way it works is Timer0 is set to count up to the value in TA0CCR0 (the length of the servo pulse). When TA0CCR0 overflows an interuppt is requested and the interrupt service routine T0A0_ISR runs. T0A0_ISR changes the value of TA0CCR0 to the next value in the array servo. After 8 pulses TA0CCR0 is set to fill in the time remaining until 20ms has passed since the start of the ppm frame. This is done by setting Timer1 to count up to 20 000 (TA1CCR0), after the 8th pulse TA0CCR0 is set to 20 000 minus the amount that Timer1 has currently counted up to, thus giving the time remaing until the end of the 20 ms.
     
    The positions of the servos are stored in the array servo as the length of each servo pulse. This array can be modified in the main loop.
     
    This code can also be used to control 8 or more(i think, depends how many pulses you can fit in a 20ms period) servos through 1 pin (selectable). All that is required is a 4017 decade counter to demultiplex the ppm signal into standard servo pwm.
     
    But there's a catch. I actually haven't tested any of this code in real life. (I accidentally killed 3 servos somehow before making this) My pickit2 logic analyzer shows me that everything is working fine though.
     
    Thanks for reading.
     
    edit: fixed array values, should range from 1000 - 2000 not 500 - 1500
  3. Like
    mcookieman reacted to RobG in Using 3 wires to control parallel LCD display   
    I have seen this done other ways, but I didn't want to deal with 7 pins, or 4 bits, etc., so I did it my way.
    You send 8 bits to shift register, then set data out to whatever RS should be, and finally pulse E, that simple.
    I will add my code later, once I clean it up.
    BTW, if you are interested, the display is LMB162 and was purchased from ebay for $7.99 with free S/H to US of A (it took a week to get to NC.)
    It requires 3.3V Vcc with 5V BL, that's why I like it (well, I don't like the fact that I need separate power for BL.)
     


     

     
    My next step is to reduce number of required pins to 2 by adding missing pulse detector (555 I think will do well here.)

  4. Like
    mcookieman reacted to oPossum in RCremote (Can also be used to control 8(+?) servos)   
    Thanks for sharing your code.
     
    I made a PPM decoder board a few months ago, but have not had time to write the code and test it.
     
    Here are the EAGLE files for anyone who may be interested...
    servo_ppm.brd
    servo_ppm.sch



  5. Like
    mcookieman got a reaction from bluehash in RCremote (Can also be used to control 8(+?) servos)   
    First post! Hello, I'm currently making a RC remote for my quadcopter which I am in the process of building. The idea is to output a ppm frame which then goes into a FrSky module which beams it to a receiver on my quadcopter. I currently have the code for ppm generation done. I am reading up on i2c with the UCSI module in the msp430g2553 right now and will hook it up to a wii nunchuk for testing. The end product will have recycled gymbals from an esky transmitter remote hooked up to it's own microcontroller acting as an i2c slave to the ppm generation microcontroller.
     

    #include #include int Pnum = 1; //Stores the number of pulses triggered so far in current ppm frame int servo[8] = {1000,1150,1300,1450,1500,1750,1900,2000}; // Servo pulse values void main(void) { WDTCTL = WDTPW|WDTHOLD; //stop watchdog timer BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; P1OUT = BIT6|BIT0; //Preload P1.2 on P1DIR = BIT6|BIT0; //Set P1.2 to output TA0CCR0 = 100; //Timerinitiallycountsuptothisvalue.Mustbelongenoughforeverythingtosetup TA0CCTL0 = CCIE; //Enable interrupts on CCR0 TA1CCR0 = 20000; //Length of PPM frame minus one TA0CTL = MC_1|ID_0|TASSEL_2|TACLR; //Setup TimerA0 (up mode|clock divide by 1|SMCLK|Clear timer) TA1CTL = MC_1|ID_0|TASSEL_2|TACLR; //Setup TimerA1 (up mode|clock divide by 1|SMCLK|Clear timer) __enable_interrupt(); //enable interrupts for(; //infinite loop { } } #pragma vector = TIMER0_A0_VECTOR //T0A0_ISR __interrupt void T0A0_ISR (void) { P1OUT &= ~BIT6; _delay_cycles(300); P1OUT |= BIT6; if(Pnum != 9) { TA0CCR0 = servo[(Pnum-1)]; //Servo pulse Pnum++; //increment Pnum } else { TA0CCR0 = (20000-(TA1R)); //Sync pulse Pnum = 1; //Reset Pnum } }
    This is the code I have right now. The way it works is Timer0 is set to count up to the value in TA0CCR0 (the length of the servo pulse). When TA0CCR0 overflows an interuppt is requested and the interrupt service routine T0A0_ISR runs. T0A0_ISR changes the value of TA0CCR0 to the next value in the array servo. After 8 pulses TA0CCR0 is set to fill in the time remaining until 20ms has passed since the start of the ppm frame. This is done by setting Timer1 to count up to 20 000 (TA1CCR0), after the 8th pulse TA0CCR0 is set to 20 000 minus the amount that Timer1 has currently counted up to, thus giving the time remaing until the end of the 20 ms.
     
    The positions of the servos are stored in the array servo as the length of each servo pulse. This array can be modified in the main loop.
     
    This code can also be used to control 8 or more(i think, depends how many pulses you can fit in a 20ms period) servos through 1 pin (selectable). All that is required is a 4017 decade counter to demultiplex the ppm signal into standard servo pwm.
     
    But there's a catch. I actually haven't tested any of this code in real life. (I accidentally killed 3 servos somehow before making this) My pickit2 logic analyzer shows me that everything is working fine though.
     
    Thanks for reading.
     
    edit: fixed array values, should range from 1000 - 2000 not 500 - 1500
  6. Like
    mcookieman got a reaction from oPossum in RCremote (Can also be used to control 8(+?) servos)   
    First post! Hello, I'm currently making a RC remote for my quadcopter which I am in the process of building. The idea is to output a ppm frame which then goes into a FrSky module which beams it to a receiver on my quadcopter. I currently have the code for ppm generation done. I am reading up on i2c with the UCSI module in the msp430g2553 right now and will hook it up to a wii nunchuk for testing. The end product will have recycled gymbals from an esky transmitter remote hooked up to it's own microcontroller acting as an i2c slave to the ppm generation microcontroller.
     

    #include #include int Pnum = 1; //Stores the number of pulses triggered so far in current ppm frame int servo[8] = {1000,1150,1300,1450,1500,1750,1900,2000}; // Servo pulse values void main(void) { WDTCTL = WDTPW|WDTHOLD; //stop watchdog timer BCSCTL1 = CALBC1_1MHZ; DCOCTL = CALDCO_1MHZ; P1OUT = BIT6|BIT0; //Preload P1.2 on P1DIR = BIT6|BIT0; //Set P1.2 to output TA0CCR0 = 100; //Timerinitiallycountsuptothisvalue.Mustbelongenoughforeverythingtosetup TA0CCTL0 = CCIE; //Enable interrupts on CCR0 TA1CCR0 = 20000; //Length of PPM frame minus one TA0CTL = MC_1|ID_0|TASSEL_2|TACLR; //Setup TimerA0 (up mode|clock divide by 1|SMCLK|Clear timer) TA1CTL = MC_1|ID_0|TASSEL_2|TACLR; //Setup TimerA1 (up mode|clock divide by 1|SMCLK|Clear timer) __enable_interrupt(); //enable interrupts for(; //infinite loop { } } #pragma vector = TIMER0_A0_VECTOR //T0A0_ISR __interrupt void T0A0_ISR (void) { P1OUT &= ~BIT6; _delay_cycles(300); P1OUT |= BIT6; if(Pnum != 9) { TA0CCR0 = servo[(Pnum-1)]; //Servo pulse Pnum++; //increment Pnum } else { TA0CCR0 = (20000-(TA1R)); //Sync pulse Pnum = 1; //Reset Pnum } }
    This is the code I have right now. The way it works is Timer0 is set to count up to the value in TA0CCR0 (the length of the servo pulse). When TA0CCR0 overflows an interuppt is requested and the interrupt service routine T0A0_ISR runs. T0A0_ISR changes the value of TA0CCR0 to the next value in the array servo. After 8 pulses TA0CCR0 is set to fill in the time remaining until 20ms has passed since the start of the ppm frame. This is done by setting Timer1 to count up to 20 000 (TA1CCR0), after the 8th pulse TA0CCR0 is set to 20 000 minus the amount that Timer1 has currently counted up to, thus giving the time remaing until the end of the 20 ms.
     
    The positions of the servos are stored in the array servo as the length of each servo pulse. This array can be modified in the main loop.
     
    This code can also be used to control 8 or more(i think, depends how many pulses you can fit in a 20ms period) servos through 1 pin (selectable). All that is required is a 4017 decade counter to demultiplex the ppm signal into standard servo pwm.
     
    But there's a catch. I actually haven't tested any of this code in real life. (I accidentally killed 3 servos somehow before making this) My pickit2 logic analyzer shows me that everything is working fine though.
     
    Thanks for reading.
     
    edit: fixed array values, should range from 1000 - 2000 not 500 - 1500
×
×
  • Create New...