MSP430 - external timing wint CCR 
    /* 
* TA0CCTL0, Capture/Compare Control Register 0
*
* CM_1 -- Rising Edge
* CCIS_0 -- CCIxA
* ~SCS -- Asynchronous Capture
* ~SCCI -- Latched capture signal (read)
* ~CAP -- Compare mode
* OUTMOD_0 -- PWM output mode: 0 - OUT bit value
*
* Note: ~<BIT> indicates that <BIT> has value zero
*/
TA0CCTL0 = CM_1 | CCIS_0 | OUTMOD_0 | CCIE;

/* TA0CCR0, Timer_A Capture/Compare Register 0 */
TA0CCR0 = 31;

/*
* TA0CTL, Timer_A3 Control Register
*
* TASSEL_0 -- TACLK
* ID_0 -- Divider - /1
* MC_1 -- Up Mode
*/
TA0CTL = TASSEL_0 | ID_0 | MC_1;


[ add comment ]   |  [ 0 trackbacks ]   |  permalink
MSP430 interrupt - timer 
TIMER0_A1_VECTOR handles all Timer A0 interrupts except CCR0. TIMER0_A0_VECTOR handles the CCR0 interrupt.

Code for the TIMER0_A1_VECTOR should read TA0IV to clear the source of the interrupt (and perhaps decode it when multiple sources are enabled).

Code for the TIMER0_A0_VECTOR doesn't need to clear the source of its interrupt because the hardware automatically clears the single source.


/*
* ======== Timer0_A3 Interrupt Service Routine ========
*/
#pragma vector=TIMER0_A1_VECTOR
__interrupt void TIMER0_A1_ISR_HOOK(void)
{
/* USER CODE START (section: TIMER0_A1_ISR_HOOK) */
switch( TAIV ) {
case 2:
P1OUT ^= BIT0; /* Toggle LED on P1.0 */
break; // CCR1 not used
case 4: break; // CCR2 not used
case 10: break; // overflow break; }
}


/* USER CODE END (section: TIMER0_A1_ISR_HOOK) */
}




#pragma vector = TIMER0_A1_VECTOR
__interrupt void TIMER0_A1_ISR()
{
switch (__even_in_range(TA0IV, TA0IV_TAIFG)) // recommended syntax for TAIV handling
{
case TA0IV_TACCR1: // CCR1
count1++;
if (count1 == 25)
{
P1OUT ^= 0X01;
count1 = 0;
}
break;
case TA0IV_TACCR2: // CCR2 - unused
case TA0IV_6: // Reserved
case TA0IV_8: // Reserved
case TA0IV_TAIFG: // Timer overflow - unused
break;
}
}


The MSP430 uses various clock sources from external XTAL's and internal oscillators such as the DCO (Digital Control Oscillator), VLO (Very low frequency Oscillator) etc to generate 3 internal clock sources.




-------------------------------------------

internal clocks (ACLK, SMCLK)

ACLK (TACLK/ACKL)
The ACLK clock can be sourced from the external 32 KHz XTAL or internal 10 KHz VLO Oscillator.

SMCLK
Usually sourced from the MCLK

(MCLK Can be sourced from the external High frequency XTAL or internal DCO)

-------------------------------------------

external clocks ()
The above is general however other possibities exist and differ from device to device. Newer 5x parts have many more clocking options.



The timers on the MSP430 can be clocked from various internal clocks such as the ACLK, SMCLK etc. These can be divided down if required. The TACLK is an external pin that can be used to clock the internal timer.


[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
TI Series Launchpads 
http://www.ti.com/ww/en/launchpad/launchpad.html

[ 1 comment ] ( 6 views )   |  [ 0 trackbacks ]   |  permalink  |  related link
Blog Yoa01's Life  
http://siryoa.blogspot.cz/

[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
Current Sources 
<iframe width="420" height="315" src="//www.youtube.com/embed/411f0DvXu18" frameborder="0" allowfullscreen></iframe>

http://electronicdesign.com/analog/volt ... wo-op-amps

[ add comment ]   |  [ 0 trackbacks ]   |  permalink
Getting Started with the MSP430 LaunchPad Workshop 
with MSP430FR5969 FRAM Launchpad

[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
MSP430ware's DriverLib 
MSP430ware's DriverLib

[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
MSP430 hardware I2C + UART example 
msp430 i2cslave
MSP430 I2C slave example (for MSP430G2553 on Launchpad) including master example (e.g. for TP-Link MR3020)

https://github.com/wendlers/msp430-i2cslave


msp430 harduart
Hardware UART example for MSP430G2553 on TI Launchpad using mps430-gcc on Linux

https://github.com/wendlers/msp430-harduart


[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
I lived so selfishly, the ordered video : D 
http://m.youtube.com/watch?v=cAVx9RKaLPUhttp://m.youtube.com/watch?v=cAVx9RKaLPUhttp://m.youtube.com/watch?v=cAVx9RKaLPUhttp://m.youtube.com/watch?v=cAVx9RKaLPU

[ add comment ]   |  [ 0 trackbacks ]   |  permalink  |  related link
MSP430 
Pokud začínáte nebo už programujete mikrokontroléry od firmy Texas Instruments, určitě by se vám mohl hodit tento skutečně povedený tutoriál o programování rodiny mikrokontrolérů MSP430. http://energia.nu/

link: http://www.argenox.com/library/msp430/
taken from: http://chiptron.petus.cz/news.php?readmore=119

Get familiar with MSP430 today using code examples available for a variety of applications.
http://www.ti.com/lsds/ti/microcontroll ... .page#code

MSP430 Open Source Tool Chain:
http://processors.wiki.ti.com/index.php ... s_-_MSP430

MSP430 Timers In-Depth:
http://www.ti.com/lit/ml/slap113/slap113.pdf

MSP430 Timers and PWM:
http://homepages.ius.edu/RWISMAN/C335/H ... 0Timer.HTM

A Simple LaunchPad DAC:
http://www.msp430launchpad.com/2011/06/ ... d-dac.html

buy MSP-EXP430G2 - MSP430 LaunchPad Value Line Development kit:
https://estore.ti.com/MSP-EXP430G2-MSP430-LaunchPad-Value-Line-Development-kit-P2031.aspx

farnell:
http://cz.farnell.com/jsp/displayProduc ... ch|p|plid|
(+cad soft eagle)

i2c:
http://www.instructables.com/id/i2c-com ... d-Arduino/
http://www.meanpc.com/2012/10/i2c-commu ... o-uno.html

http://www.ti.com/product/msp430g2553


[ add comment ]   |  [ 0 trackbacks ]   |  permalink

<<First <Back | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | Next> Last>>