Other Parts Discussed in Thread: MSP430FR5969
Tool/software: Code Composer Studio
Hi !
I'm use MSP430FR5972 - Timer0_B7
need Pin 26 for PWM (out pin) from TB0.0 to optoLED.
Clock form ACLK.
No interrups from TB0 !
Dont work... ;-(
my code is:
...
// === init TB0.0 === // SLASE66B --- Table 6-22. Port P3 (P3.4 to P3.7) Pin Functions P3DIR |= BIT4; P3OUT &= ~BIT4; // Set P3.4 to output direction === OC2A === P3SEL0 = 0; P3SEL1 = 0; P3SEL0 &= ~BIT4; // SLASE66B --- Table 6-22. Port P3 (P3.4 to P3.7) Pin Functions P3SEL1 |= BIT4; // Configure P3.4 for TB0.0 // --- Start init Timer0_B7 --------------------------------------------------------------------------- TB0CTL = 0; // All reset //TB0CTL &= ~TBCLGRP_0; // Timer0_B7 Group: 0 - individually //TB0CTL &= ~CNTL__16; // Counter lenght: 16 bit 00b = 16-bit, TBxR(max) = 0FFFFh --- 01b = 12-bit, TBxR(max) = 0FFFh // 10b = 10-bit, TBxR(max) = 03FFh --- 11b = 8-bit, TBxR(max) = 0FFh TB0CTL = TBSSEL__ACLK | MC__CONTINOUS; TB0CCTL0 = 0; TB0CCTL0 = CM_0 + CCIS_3 + CLLD_2 + OUTMOD_1; //TB0CCTL0 &= ~CCIFG; // Capture/compare interrupt flag 0b = No interrupt pending 1b = Interrupt pending //TB0CCTL0 &= ~CCIE; // TBCCR0 interrupt disabled //TB0CCTL0 &= ~TBIE; // TB0 interrupt disabled TB0EX0 = 0; TB0CCR0 = 0x00FF;
...
You can check the work of my code if you have a "test board" MSP430FR5969
MSP430FR5969 and MSP430FR5972 are almost identical, except for the memory size.
The Timers works the same there.