Jump to content

Search the Community

Showing results for tags 'MSP430G'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • News
    • Announcements
    • Suggestions
    • New users say Hi!
  • Spotlight!
    • Sponsor Spotlight
    • Sponsor Giveaways
  • Energia
    • Energia - MSP
    • Energia - TivaC/CC3XXX
    • Energia - C2000
    • Energia Libraries
  • MSP Technical Forums
    • General
    • Compilers and IDEs
    • Development Kits
    • Programmers and Debuggers
    • Code vault
    • Projects
    • Booster Packs
    • Energia
  • Tiva-C, Hercules, CCXXXX ARM Technical Forums
    • General
    • SensorTag
    • Tiva-C, Hercules, CC3XXX Launchpad Booster Packs
    • Code Vault
    • Projects
    • Compilers and IDEs
    • Development Kits and Custom Boards
  • Beagle ARM Cortex A8 Technical Forums
    • General
    • Code Snippets and Scripts
    • Cases, Capes and Plugin Boards
    • Projects
  • General Electronics Forum
    • General Electronics
    • Other Microcontrollers
  • Connect
    • Embedded Systems/Test Equipment Deals
    • Buy, Trade and Sell
    • The 43oh Store
    • Community Projects
    • Fireside Chat
  • C2000 Technical Forums
    • General
    • Development Kits
    • Code Vault
    • Projects
    • BoosterPacks

Calendars

There are no results to display.


Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests


Sparkfun


Github

Found 5 results

  1. I'm trying to create a toggle button but the code is not working. The code is as shown below: #include <msp430g2553.h> int main(void) { WDTCTL = WDTPW + WDTHOLD; // stop watchdog timer P1DIR &= ~BIT3; //P1.3 i/p P1REN |= BIT3; //P1.3 enable pullup resistor P1IES |= BIT3; //P1.3 high to low transition P1IFG &= ~BIT3; //P1.3 clear interrupt flag P1IE |= BIT3; //enable P1.3 interrupt P1DIR |= BIT0; //P1.0 o/p P1OUT &= ~BIT0; //clear P1.0 _BIS_SR(LPM0_bits + GIE); //enter LPM0 with interrupts enabled } #pragma vector = PORT1_VECTOR __interrupt void Port1(void) { P1IFG &= ~BIT3; //clear P1IFG P1OUT ^= BIT0; //toggle LED at P1.0 } Please let me know why it is not working. I am using MS430G2553 launchpad kit. Thanks!
  2. This is a very simple enc28j60 library created by Renato Aloi for atmega modifed by me for MSP430G2553 and MSP430F5529 Please, check my latest master fork from Renato Aloi newMods branch or download directly v0.4.2: EtherEncLib-0.4.2.zip fix CS, fix examples, disable debug from tcpstack EtherEncLib-0.4.zip only harware SPI version (MSP430G2553 and MSP430F5529 tested) EtherEncLib_v03.zip - hard/soft spi version EtherEncLib_v2.zip - hardware spi version EtherEncLib_v01.zip - softspi version v03: selectable hardware/software spi all definitions moved to EtherEncLib.h lines 17,18 -> select between hard/soft spi lines 21,23-25 -> SPI pins definition for MSP430 lines 28,30-32,34 -> SPI pins definition for Stellaris & Tiva(?) v02: hardware spi version enctypes.h file contains CS pins definition (lines 247, 250) v01: init version At this moment, after my quick mod, spi communication work on softspi (shiftOut/shiftIn) and replace strange arduino access via registers like SPDR etc... So...shiftOut/shiftIn are not so fast enctypes.h file contains pins definition (lines 247-259) description from EtherEncLib.cpp file:
  3. good am everyone.. i've started using msp430g2553 to be used to interface lm35 and will give a pwm output depending on the PID results. here's my code: #include <msp430g2553.h> float act_temp; int des_temp = 5; float error = 0; float error_sum = 0; float error_prev = 0; float error_diff = 0; float kp = 10000; float ki = 50; float kd = 1; float dt = 1; float pid; int pwm; int k; char data[5]; void TX(char *tx_message); unsigned int measure; unsigned int measure_1; unsigned int measure_2; void main(void){ WDTCTL = WDTPW + WDTHOLD; // Stop WDT BCSCTL1 = CALBC1_1MHZ; // Set DCO to 1MHz DCOCTL = CALDCO_1MHZ; P1SEL = BIT1 + BIT2; P1SEL2 = BIT1 + BIT2; UCA0CTL1 |= UCSSEL_2; UCA0BR0 = 104; UCA0BR1 = 0; UCA0MCTL = UCBRS0; UCA0CTL1 &= ~UCSWRST; ADC10CTL0 |= SREF_0|ADC10ON|ADC10SHT_2;//ADC setup ADC10CTL1 |= INCH_4|ADC10SSEL_1|CONSEQ_1; ADC10AE0 |= BIT0; ADC10CTL0 |= ENC|ADC10SC; TACTL = TASSEL_1|ID_3|MC_1|TAIE; TA0CCTL1 = OUTMOD_7; TACCR0 = 50000; for(; { ADC10CTL0 |= ENC + ADC10SC; int raw_temp = ADC10MEM; float temp = (ADC10MEM*350)/1024; // des_temp = UCA0RXBUF; act_temp = temp; error = (act_temp - des_temp); error_sum = error_sum + error; error_diff = (error - error_prev)/dt; pid = (kp*error) + (ki*error_sum) + (kd*error_diff); pwm = (int)pid; error_prev = error; P1SEL |= BIT6; P1OUT |= BIT6; TACCR1 = pwm; if (pwm < 0){pwm = 0;} if (pwm > TACCR0){pwm = TACCR0;} //sending data to uart int measure1000; //declare measure1000 as interger int measure100; //declare measure100 as interger int measure10; //declare measure10 as interger int measure1; //declare measure1 as interger measure1000 = ((raw_temp)/1000)%10; // measure10 is the 10's place digit measure100 = ((raw_temp)/100)%10; // measure100 is the 100's place digit measure10 = ((raw_temp)/10)%10; // measure10 is the 10's place digit measure1 = (raw_temp)%10; // measure1 is the 1's place digit data[0] = (char)(((int)'0')+measure1000); //measure10 - 2nd char string data[1] = (char)(((int)'0')+measure100); //measure1 - 3rd char string data[2] = (char)(((int)'0')+measure10); //measure10 - 2nd char string data[3] = (char)(((int)'0')+measure1); //measure1 - 3rd char string data[4]='\0'; //end of character string //send data TX(data); TX("\r"); __delay_cycles(1000000); } } void TX(char *tx_message) { unsigned int i=0; //Define end of string loop int char *message; // message variable unsigned int message_num; // define ascii int version variable message = tx_message; // move tx_message into message while(1) { if(message[i]==0) // If end of input string is reached, break loop. { break; } message_num = (int)message[i]; //Cast string char into a int variable UCA0TXBUF = message_num; // write INT to TX buffer i++; // increase string index __delay_cycles(250000); //transmission delay if(i>50) //prevent infinite transmit { P1OUT |= BIT6; //P1OUT LED will indicate error break; //Break the transmit } } // End TX Main While Loop } // End TX Function // ADC10 interrupt service routine #pragma vector=ADC10_VECTOR __interrupt void ADC10_ISR(void) { __bic_SR_register_on_exit(CPUOFF); // Clear CPUOFF bit from 0(SR) } P1.0 is the input from lm35, P1.6 is the pwm output... but i've the raw_temp is not changing at all, even if the temperature sensor is placed to a different environment. could you give me some advice and tips to improve my code.. thank you very much..
  4. Hi all, I have seen that the MSP430TCH5E HAPTOUCH Boosterpack is already available. Through Element 14, and not from TI eStore, but it is what it is. http://www.ti.com/devnet/docs/catalog/thirdpartydevtoolfolder.tsp?actionPerformed=productFolder&productId=17680 Sorry for not putting it in the blog but either I'm too stupid to get a simple sum, or the captcha code is not working. Gast
  5. Antscran

    State Machine Tutorial

    Hi all, Just put together a basic state machine tutorial with portable C programming code, I have also made a small 4 state project with a basic user interface (LCD and 4 buttons), all based on a MSP430G2234. Would be interested in anyone's views on it's readability and maybe even improvements? State machine tutorial and C programming code: http://coder-tronics.com/state-machine-tutorial-pt1/ http://coder-tronics.com/state-machine-tutorial-pt2/ Youtube video with MSP430 state machine (tutorial and all code to follow) : https://www.youtube.com/watch?v=JzDn6SKjBxE Cheers, Ant
×