2193 views|3 replies

2

Posts

0

Resources
The OP
 

430 MCU Programming Help [Copy link]

void Init_Timer0_A5(void) { TA0CTL = 0 // Reset Timer0_A5, set the frequency division coefficient to 1 | (1 << 2) // Clear the counter to 0 | (2 << 8) ; // Set the counting clock to SMCLK ; TA0CCR0 = 16000 - 1 ; // SMCK=EX2=16MHz, set the counter overflow time to 1ms TA0CCTL0 = 0 // Initialize capture control | (1 << 4) ; // Enable compare interrupt TA0CTL |= (1 << 4) ; // Set the counter to count up and start} I am a newbie. I don't know how to understand the above program. TA0CCR0 = 16000 - 1; // SMCK=EX2=16MHz, set the counter overflow time to 1ms Mainly, I don't know how to understand this expression. I would like to ask for help from netizens. Thank you in advance.

This post is from Microcontroller MCU

Latest reply

The value of ccr0 will enter an interrupt when the timer overflows this value  Details Published on 2018-4-3 21:46
 

3471

Posts

11

Resources
2
 
TA0CCR0 = 16000 - 1; Find the development manual. Find the corresponding register. Look at this assignment statement. Assign each bit to a certain value. Look at the register description. The meaning of each bit will be clear.
This post is from Microcontroller MCU
 
 

1059

Posts

1

Resources
3
 
The parameter configuration is shown in the 430 specific register. The counting cycle is calculated by TA0CCR0 and SMCK.
This post is from Microcontroller MCU
 
 
 

12

Posts

0

Resources
4
 
The value of ccr0 will enter an interrupt when the timer overflows this value
This post is from Microcontroller MCU
 
 
 

Guess Your Favourite
Just looking around
Find a datasheet?

EEWorld Datasheet Technical Support

Copyright © 2005-2024 EEWORLD.com.cn, Inc. All rights reserved 京B2-20211791 京ICP备10001474号-1 电信业务审批[2006]字第258号函 京公网安备 11010802033920号
快速回复 返回顶部 Return list