The purpose of this group is to foster exchange of information on the Texas Instruments MSP430 family of microcontrollers and related tools. Everyone welcome, all levels of familiarity/expertise.
Timer B7 toggle problem - Dan Fat - Jun 2 15:47:22 2009
Hello.
I have a small problem regarding Timer B7 on my MSP430F169 board.
Having a 4096KHz crystal I'm trying to toggle 2 pins in order obtain two synchronous
clocks (at 2048KHz and 256KHz).
P4OUT = 0x00;
P4DIR = 0x7F; //P4.0, P4.1 output
P4SEL |= 0x7F;
//setup external oscilator
BCSCTL1 &= ~XT2OFF;
BCSCTL1 |= DIVA_3; //ACLK/8 = 32768/8 = 4096
do
{
IFG1 &= ~OFIFG; // Clear OSCFault flag
for (i = 0xFF; i > 0; i--); // Time for flag to set
} while ((IFG1 & OFIFG)); // OSCFault flag still set?
BCSCTL2 |= SELM_2 + SELS; //MCLK = SMCLK = XT2
//setup timer B
TBCCTL0 = OUTMOD_4; //toggle -> result will be at half the rate
TBCCR0 = 0x08; //count to 8 -> 512KHz
TBCCTL1 = OUTMOD_4;
TBCCR1 = 0x01; //count to 1 -> 4096KHz
TBCTL = TBSSEL_2 + MC_1 + ID_0; //SMCLK, count up, f/1
The problem is that on both pins I have the same waveforms, and, if I reverse TBCCR0 =
0x01 and TBCCR1 = 0x08 I don't have nothing on the second pin (P4.1).
Any help would be appreciated.
Thanks in advance.
With regards,
Dan Fat
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.
(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Timer B7 toggle problem - tintronic - Jun 2 16:33:30 2009
You don't understand how the timer works nor how the compare modules work. First read the
entire TimerB chapter, then seek previous posts on this forum.
I seriously doubt you can generate both high speed signals with the same timer, unless the
MSP does nothing else.
What you can do is use TimerA for one and TimerB for the other.
Another possibility is to configure any two of the clock sources (MCLK, SMCLK, ACLK) to
your desired frequency and output them on their corresponding pins.
Regards,
Michael K.
--- In m...@yahoogroups.com, "Dan Fat"
wrote:
>
> Hello.
> I have a small problem regarding Timer B7 on my MSP430F169 board.
> Having a 4096KHz crystal I'm trying to toggle 2 pins in order obtain two synchronous
clocks (at 2048KHz and 256KHz).
>
> P4OUT = 0x00;
> P4DIR = 0x7F; //P4.0, P4.1 output
> P4SEL |= 0x7F;
>
> //setup external oscilator
> BCSCTL1 &= ~XT2OFF;
> BCSCTL1 |= DIVA_3; //ACLK/8 = 32768/8 = 4096
> do
> {
> IFG1 &= ~OFIFG; // Clear OSCFault flag
> for (i = 0xFF; i > 0; i--); // Time for flag to set
> } while ((IFG1 & OFIFG)); // OSCFault flag still set?
> BCSCTL2 |= SELM_2 + SELS; //MCLK = SMCLK = XT2
>
> //setup timer B
> TBCCTL0 = OUTMOD_4; //toggle -> result will be at half the rate
> TBCCR0 = 0x08; //count to 8 -> 512KHz
> TBCCTL1 = OUTMOD_4;
> TBCCR1 = 0x01; //count to 1 -> 4096KHz
> TBCTL = TBSSEL_2 + MC_1 + ID_0; //SMCLK, count up, f/1
>
> The problem is that on both pins I have the same waveforms, and, if I reverse TBCCR0 =
0x01 and TBCCR1 = 0x08 I don't have nothing on the second pin (P4.1).
>
> Any help would be appreciated.
> Thanks in advance.
>
> With regards,
> Dan Fat
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: Timer B7 toggle problem - Dan Fat - Jun 3 3:00:17 2009
Hello, and thanks for your reply.
I have read the chapter(s) about timer and also some TI's application notes. I have also
searched for similar threads on the forum and I've got so far.
It's obvious that I don't understand because the device doesn't work as expected :)(I'm
more used to ATmega's timers).
I know that I can use the other timer but I don't want to. I have also tried interrupts,
but for the 2048KHz frequency it's too demanding.
So, again, can you please give me some pointers on how to configure this, if it's possible
? Should I try toggle for 2048KHz and interrupt for 256KHz ?
Thanks.
With regards,
Dan Fat
________________________________
From: tintronic
To: msp430@yahoogroups..com
Sent: Tuesday, June 2, 2009 23:32:29
Subject: [msp430] Re: Timer B7 toggle problem
You don't understand how the timer works nor how the compare modules work. First read the
entire TimerB chapter, then seek previous posts on this forum.
I seriously doubt you can generate both high speed signals with the same timer, unless the
MSP does nothing else.
What you can do is use TimerA for one and TimerB for the other.
Another possibility is to configure any two of the clock sources (MCLK, SMCLK, ACLK) to
your desired frequency and output them on their corresponding pins..
Regards,
Michael K.
--- In msp430@yahoogroups. com, "Dan Fat" wrote:
>
> Hello.
> I have a small problem regarding Timer B7 on my MSP430F169 board.
> Having a 4096KHz crystal I'm trying to toggle 2 pins in order obtain two synchronous
clocks (at 2048KHz and 256KHz).
>
> P4OUT = 0x00;
> P4DIR = 0x7F; //P4.0, P4.1 output
> P4SEL |= 0x7F;
>
> //setup external oscilator
> BCSCTL1 &= ~XT2OFF;
> BCSCTL1 |= DIVA_3; //ACLK/8 = 32768/8 = 4096
> do
> {
> IFG1 &= ~OFIFG; // Clear OSCFault flag
> for (i = 0xFF; i > 0; i--); // Time for flag to set
> } while ((IFG1 & OFIFG)); // OSCFault flag still set?
> BCSCTL2 |= SELM_2 + SELS; //MCLK = SMCLK = XT2
>
> //setup timer B
> TBCCTL0 = OUTMOD_4; //toggle -> result will be at half the rate
> TBCCR0 = 0x08; //count to 8 -> 512KHz
> TBCCTL1 = OUTMOD_4;
> TBCCR1 = 0x01; //count to 1 -> 4096KHz
> TBCTL = TBSSEL_2 + MC_1 + ID_0; //SMCLK, count up, f/1
>
> The problem is that on both pins I have the same waveforms, and, if I reverse TBCCR0 =
0x01 and TBCCR1 = 0x08 I don't have nothing on the second pin (P4.1).
>
> Any help would be appreciated.
> Thanks in advance.
>
> With regards,
> Dan Fat
>
Get your new Email address!
Grab the Email name you've always wanted before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
[Non-text portions of this message have been removed]
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: Timer B7 toggle problem - Dan Bloomquist - Jun 3 3:34:45 2009
Dan Fat wrote:
> Hello, and thanks for your reply.
> I have read the chapter(s) about timer and also some TI's application notes. I have also
searched for similar threads on the forum and I've got so far.
> It's obvious that I don't understand because the device doesn't work as expected :)(I'm
more used to ATmega's timers).
> I know that I can use the other timer but I don't want to. I have also tried interrupts,
but for the 2048KHz frequency it's too demanding.
> So, again, can you please give me some pointers on how to configure this, if it's
possible ? Should I try toggle for 2048KHz and interrupt for 256KHz ?
> Thanks.
>
You are running at ~4mhz processor. You want a ~2mhz output. There is no
way to be reasonable with software/ minus timers. Simply /2 somewhere in
hardware to provide this clock and live with the realestate/chip cost.
Consider the the ~.2mhz part of hardware if you don't need to 'control'
it. (I'm sure there is a divider out there for both, not my job to
research...)
What are you doing?
Best, Dan.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Re: Timer B7 toggle problem - Dan Fat - Jun 3 3:49:53 2009
Hi.
I'm trying to generate some clock signals for a PCM codec (TP3054). It requires specific
timing 2048KHz, 1544Khz or 1536KHz. Because of this I have changed the crystal on my board
from 8MHz to 4096KHz in order to obtain the exact frequencies (I haven't tried to put a
8192KHz because the F169 works with max 8MHz). After this I have to take the PCM data and
make some small processing. To take the overhead of the uC I'm trying to generate these 2
signals. Because the application is more complex, I didn't want to use the both timers
(timer A is already occupied with RTC), and didn't want to use interrupts because of the
latency and, at this high frequency, the code keeps interrupted.
Should I try then to find a frequency divider IC, supply it's clock with the 2048KHz
toggle and divide further from there ?
Thanks.
Dan Fat
________________________________
From: Dan Bloomquist
To: m...@yahoogroups.com
Sent: Wednesday, June 3, 2009 10:34:06
Subject: Re: [msp430] Re: Timer B7 toggle problem
Dan Fat wrote:
> Hello, and thanks for your reply.
> I have read the chapter(s) about timer and also some TI's application notes. I have also
searched for similar threads on the forum and I've got so far.
> It's obvious that I don't understand because the device doesn't work as expected :)(I'm
more used to ATmega's timers).
> I know that I can use the other timer but I don't want to. I have also tried interrupts,
but for the 2048KHz frequency it's too demanding.
> So, again, can you please give me some pointers on how to configure this, if it's
possible ? Should I try toggle for 2048KHz and interrupt for 256KHz ?
> Thanks.
>
You are running at ~4mhz processor. You want a ~2mhz output. There is no
way to be reasonable with software/ minus timers. Simply /2 somewhere in
hardware to provide this clock and live with the realestate/chip cost.
Consider the the ~.2mhz part of hardware if you don't need to 'control'
it. (I'm sure there is a divider out there for both, not my job to
research...)
What are you doing?
Best, Dan.
Get your preferred Email name!
Now you can @ymail.com and @rocketmail.com.
http://mail.promotions.yahoo.com/newdomains/aa/
[Non-text portions of this message have been removed]
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )RE: Re: Timer B7 toggle problem - "Redd, Emmett R" - Jun 3 8:40:01 2009
One-half of a 7474 (flip-flop, get the right voltage version) should be
able to make 4096 kHz into 2048 kHz.
Emmett Redd Ph.D. mailto:E...@missouristate.edu
Professor (417)836-5221
Department of Physics, Astronomy, and Materials Science
Missouri State University Fax (417)836-6226
901 SOUTH NATIONAL Dept (417)836-5131
SPRINGFIELD, MO 65897 USA
"In theory there is no difference between theory and practice. In
practice there is." -- Yogi Berra or Jan van de Snepscheut
> -----Original Message-----
> From: m...@yahoogroups.com [mailto:m...@yahoogroups.com]
> On Behalf Of Dan Fat
> Sent: Wednesday, June 03, 2009 2:48 AM
> To: m...@yahoogroups.com
> Subject: Re: [msp430] Re: Timer B7 toggle problem
>
> Hi.
> I'm trying to generate some clock signals for a PCM codec
> (TP3054). It requires specific timing 2048KHz, 1544Khz or
> 1536KHz. Because of this I have changed the crystal on my
> board from 8MHz to 4096KHz in order to obtain the exact
> frequencies (I haven't tried to put a 8192KHz because the
> F169 works with max 8MHz). After this I have to take the PCM
> data and make some small processing. To take the overhead of
> the uC I'm trying to generate these 2 signals. Because the
> application is more complex, I didn't want to use the both
> timers (timer A is already occupied with RTC), and didn't
> want to use interrupts because of the latency and, at this
> high frequency, the code keeps interrupted.
> Should I try then to find a frequency divider IC, supply it's
> clock with the 2048KHz toggle and divide further from there ?
>
> Thanks.
>
> Dan Fat
> ________________________________
> From: Dan Bloomquist
> To: m...@yahoogroups.com
> Sent: Wednesday, June 3, 2009 10:34:06
> Subject: Re: [msp430] Re: Timer B7 toggle problem
>
> Dan Fat wrote:
> > Hello, and thanks for your reply.
> > I have read the chapter(s) about timer and also some TI's
> application notes. I have also searched for similar threads
> on the forum and I've got so far.
> > It's obvious that I don't understand because the device
> doesn't work as expected :)(I'm more used to ATmega's timers).
> > I know that I can use the other timer but I don't want to.
> I have also tried interrupts, but for the 2048KHz frequency
> it's too demanding.
> > So, again, can you please give me some pointers on how to
> configure this, if it's possible ? Should I try toggle for
> 2048KHz and interrupt for 256KHz ?
> > Thanks.
> > You are running at ~4mhz processor. You want a ~2mhz output.
> There is no
> way to be reasonable with software/ minus timers. Simply /2
> somewhere in
> hardware to provide this clock and live with the
> realestate/chip cost.
> Consider the the ~.2mhz part of hardware if you don't need to
> 'control'
> it. (I'm sure there is a divider out there for both, not my job to
> research...)
>
> What are you doing?
>
> Best, Dan.
>
> Get your preferred Email name!
> Now you can @ymail.com and @rocketmail.com.
> http://mail.promotions.yahoo.com/newdomains/aa/
>
> [Non-text portions of this message have been removed]
>
> ------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: Timer B7 toggle problem - Greg Maki - Jun 3 8:50:31 2009
Dan,
I coded this up last night and was able to generate the correct frequencies. To
generate the 2.048 MHz signal I set SMCLK to be driven by MCLK with a
divide-by-2 and output the signal on P5.5.
For the 256KHz signal I set up TimerB to be clocked by SMCLK, set it for up mode
and to toggle TB0 and set TBCCR0 to 3. Output the TB0 signal on P4.0.
Best regards,
Greg
tintronic wrote:
>
> You don't understand how the timer works nor how the compare modules
> work. First read the entire TimerB chapter, then seek previous posts on
> this forum.
> I seriously doubt you can generate both high speed signals with the same
> timer, unless the MSP does nothing else.
> What you can do is use TimerA for one and TimerB for the other.
> Another possibility is to configure any two of the clock sources (MCLK,
> SMCLK, ACLK) to your desired frequency and output them on their
> corresponding pins.
>
> Regards,
> Michael K.
>
> --- In m...@yahoogroups.com
, "Dan
> Fat" wrote:
>>
>> Hello.
>> I have a small problem regarding Timer B7 on my MSP430F169 board.
>> Having a 4096KHz crystal I'm trying to toggle 2 pins in order obtain
> two synchronous clocks (at 2048KHz and 256KHz).
>>
>> P4OUT = 0x00;
>> P4DIR = 0x7F; //P4.0, P4.1 output
>> P4SEL |= 0x7F;
>>
>> //setup external oscilator
>> BCSCTL1 &= ~XT2OFF;
>> BCSCTL1 |= DIVA_3; //ACLK/8 = 32768/8 = 4096
>> do
>> {
>> IFG1 &= ~OFIFG; // Clear OSCFault flag
>> for (i = 0xFF; i > 0; i--); // Time for flag to set
>> } while ((IFG1 & OFIFG)); // OSCFault flag still set?
>> BCSCTL2 |= SELM_2 + SELS; //MCLK = SMCLK = XT2
>>
>> //setup timer B
>> TBCCTL0 = OUTMOD_4; //toggle -> result will be at half the rate
>> TBCCR0 = 0x08; //count to 8 -> 512KHz
>> TBCCTL1 = OUTMOD_4;
>> TBCCR1 = 0x01; //count to 1 -> 4096KHz
>> TBCTL = TBSSEL_2 + MC_1 + ID_0; //SMCLK, count up, f/1
>>
>> The problem is that on both pins I have the same waveforms, and, if I
> reverse TBCCR0 = 0x01 and TBCCR1 = 0x08 I don't have nothing on the
> second pin (P4.1).
>>
>> Any help would be appreciated.
>> Thanks in advance.
>>
>> With regards,
>> Dan Fat
>
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: Timer B7 toggle problem - Dan Fat - Jun 3 9:14:55 2009
Thank you all for your replies.
With regards,
Dan Fat
________________________________
From: Greg Maki
To: m...@yahoogroups.com
Sent: Wednesday, June 3, 2009 15:49:01
Subject: Re: [msp430] Re: Timer B7 toggle problem
Dan,
I coded this up last night and was able to generate the correct frequencies.. To
generate the 2.048 MHz signal I set SMCLK to be driven by MCLK with a
divide-by-2 and output the signal on P5.5.
For the 256KHz signal I set up TimerB to be clocked by SMCLK, set it for up mode
and to toggle TB0 and set TBCCR0 to 3. Output the TB0 signal on P4.0.
Best regards,
Greg
tintronic wrote:
>
> You don't understand how the timer works nor how the compare modules
> work. First read the entire TimerB chapter, then seek previous posts on
> this forum.
> I seriously doubt you can generate both high speed signals with the same
> timer, unless the MSP does nothing else.
> What you can do is use TimerA for one and TimerB for the other.
> Another possibility is to configure any two of the clock sources (MCLK,
> SMCLK, ACLK) to your desired frequency and output them on their
> corresponding pins.
>
> Regards,
> Michael K.
>
> --- In msp430@yahoogroups. com , "Dan
> Fat" wrote:
>>
>> Hello.
>> I have a small problem regarding Timer B7 on my MSP430F169 board.
>> Having a 4096KHz crystal I'm trying to toggle 2 pins in order obtain
> two synchronous clocks (at 2048KHz and 256KHz).
>>
>> P4OUT = 0x00;
>> P4DIR = 0x7F; //P4.0, P4.1 output
>> P4SEL |= 0x7F;
>>
>> //setup external oscilator
>> BCSCTL1 &= ~XT2OFF;
>> BCSCTL1 |= DIVA_3; //ACLK/8 = 32768/8 = 4096
>> do
>> {
>> IFG1 &= ~OFIFG; // Clear OSCFault flag
>> for (i = 0xFF; i > 0; i--); // Time for flag to set
>> } while ((IFG1 & OFIFG)); // OSCFault flag still set?
>> BCSCTL2 |= SELM_2 + SELS; //MCLK = SMCLK = XT2
>>
>> //setup timer B
>> TBCCTL0 = OUTMOD_4; //toggle -> result will be at half the rate
>> TBCCR0 = 0x08; //count to 8 -> 512KHz
>> TBCCTL1 = OUTMOD_4;
>> TBCCR1 = 0x01; //count to 1 -> 4096KHz
>> TBCTL = TBSSEL_2 + MC_1 + ID_0; //SMCLK, count up, f/1
>>
>> The problem is that on both pins I have the same waveforms, and, if I
> reverse TBCCR0 = 0x01 and TBCCR1 = 0x08 I don't have nothing on the
> second pin (P4.1).
>>
>> Any help would be appreciated.
>> Thanks in advance.
>>
>> With regards,
>> Dan Fat
>
New Email addresses available on Yahoo!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
[Non-text portions of this message have been removed]
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Re: Timer B7 toggle problem - Dan Bloomquist - Jun 3 21:26:39 2009
Dan Fat wrote:
> Hi.
> I'm trying to generate some clock signals for a PCM codec (TP3054). It requires specific
timing 2048KHz, 1544Khz or 1536KHz. Because of this I have changed the crystal on my board
from 8MHz to 4096KHz in order to obtain the exact frequencies (I haven't tried to put a
8192KHz because the F169 works with max 8MHz). After this I have to take the PCM data and
make some small processing. To take the overhead of the uC I'm trying to generate these 2
signals. Because the application is more complex, I didn't want to use the both timers
(timer A is already occupied with RTC), and didn't want to use interrupts because of the
latency and, at this high frequency, the code keeps interrupted.
> Should I try then to find a frequency divider IC, supply it's clock with the 2048KHz
toggle and divide further from there ?
>
>
Hi Dan,
Here is an app note that comes close, I think:
So I take it you are not doing a subscriber loop but something like a
message recorder/playback? Yea, if you can live without one timer and
SMCLK running at 2mhz, Greg's solution would work. One four bit divider
will also get you both clocks and you are free to do what you want with
the processor.
It also looks like you don't have to run MCLK from XT2CLK but can use
the DCO and keep your MCLK up at 8mhz for twice the horse power.
Best, Dan.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Timer B7 toggle problem - Mike - Jun 4 11:03:47 2009
Hi Dan,
the MSP430 allows you to divide the MCLK and send it out on an external pin. There is
absolutely no reason to use external hardware. You can use timers to divide by any amount.
You can also divide MCLK by two to get a different SMCLK, and put them both out to
external pins.
Go to the TI website, and download a bunch of timer sample code.
Mike Kaelin
Kaelin Consulting
m...@kaelinconsulting.com
>
> You are running at ~4mhz processor. You want a ~2mhz output. There is no
> way to be reasonable with software/ minus timers. Simply /2 somewhere in
> hardware to provide this clock and live with the realestate/chip cost.
> Consider the the ~.2mhz part of hardware if you don't need to 'control'
> it. (I'm sure there is a divider out there for both, not my job to
> research...)
>
> What are you doing?
>
> Best, Dan.
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Re: Timer B7 toggle problem - Dan Bloomquist - Jun 4 12:19:46 2009
Mike wrote:
> Hi Dan,
>
> the MSP430 allows you to divide the MCLK and send it out on an external pin. There is
absolutely no reason to use external hardware. You can use timers to divide by any amount.
You can also divide MCLK by two to get a different SMCLK, and put them both out to
external pins.
>
> Go to the TI website, and download a bunch of timer sample code.
>
Hi Mike,
I looked at Figure 4−1. Basic Clock Block Diagram in the user guide. You
can XT2 / 2 for MCLK and out, but you can't route this to the SMCLK
divider to get /16, he needed a 256k clock. Yes, I know you can use a
timer and do just about any clock you want. My post was about 'not'
eating up the timer.
Best, Dan.
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )
Re: Re: Timer B7 toggle problem - Dan Fat - Jun 4 14:43:31 2009
Thanks Dan on your help.
I will study that app note and come back to you soon (I've seen that it uses flip flops -
as expected ).
I have also figured out how to use that timer with multiple CCR's but is very time
consuming and, again it relays on interrupts. Also I must take care of the overflows in
that interrupt for the incrementation of the CCR.
Thanks again.
With regards,
Dan Fat
________________________________
From: Dan Bloomquist
To: m...@yahoogroups.com
Sent: Thursday, June 4, 2009 4:26:27
Subject: Re: [msp430] Re: Timer B7 toggle problem
Dan Fat wrote:
> Hi.
> I'm trying to generate some clock signals for a PCM codec (TP3054). It requires specific
timing 2048KHz, 1544Khz or 1536KHz. Because of this I have changed the crystal on my board
from 8MHz to 4096KHz in order to obtain the exact frequencies (I haven't tried to put a
8192KHz because the F169 works with max 8MHz). After this I have to take the PCM data and
make some small processing. To take the overhead of the uC I'm trying to generate these 2
signals. Because the application is more complex, I didn't want to use the both timers
(timer A is already occupied with RTC), and didn't want to use interrupts because of the
latency and, at this high frequency, the code keeps interrupted.
> Should I try then to find a frequency divider IC, supply it's clock with the 2048KHz
toggle and divide further from there ?
Hi Dan,
Here is an app note that comes close, I think:
So I take it you are not doing a subscriber loop but something like a
message recorder/playback? Yea, if you can live without one timer and
SMCLK running at 2mhz, Greg's solution would work. One four bit divider
will also get you both clocks and you are free to do what you want with
the processor.
It also looks like you don't have to run MCLK from XT2CLK but can use
the DCO and keep your MCLK up at 8mhz for twice the horse power.
Best, Dan.
New Email addresses available on Yahoo!
Get the Email name you've always wanted on the new @ymail and @rocketmail.
Hurry before someone else does!
http://mail.promotions.yahoo.com/newdomains/aa/
[Non-text portions of this message have been removed]
------------------------------------
______________________________
Stellaris® MCU Family: New Parts, New Package, New Price.

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )Re: Timer B7 toggle problem - tintronic - Jun 5 11:36:24 2009
Hi Dan:
> I have also figured out how to use that timer with multiple CCR's
> but is very time consuming and, again it relays on interrupts.
> Also must take care of the overflows in that interrupt for the
> incrementation of the CCR.
Good that you figured that out. However, it doesn't need to relay on interrupts, you can
use polling instead. Moreover, with the frequencies you need to generate, there is not
closely enought time to jump into and out of interrupts. You'd need to use polling
instead, and even so, I doubt you'd have enought processing time.
You could try TimerB grouping to gain a few extra cycles between updates.
But even if you managed to make it work, there wouldn't be any time left for the uC to do
anything else, as I pointed out in my first reply.
If you don't want to use external hardware, you need to configure one of your clocks to
the highest needed frequency and use a timer to generate the second frequency.
Remember the MSP430F16x has two crystal oscilator circuits, you can use one with a 8MHz
crystal to get the max processing speed, and the other one with a 2.048 kHz crystal to
generate both frequencies throught configuring SMCLK and ACLK and their prescaler. That
way you don't need a timer.
Regards,
Michael K.
--- In m...@yahoogroups.com, Dan Fat
wrote:
>
> Thanks Dan on your help.
> I will study that app note and come back to you soon (I've seen that it uses flip flops
- as expected ).
> I have also figured out how to use that timer with multiple CCR's but is very time
consuming and, again it relays on interrupts. Also I must take care of the overflows in
that interrupt for the incrementation of the CCR.
> Thanks again.
>
> With regards,
> Dan Fat
>
> ________________________________
> From: Dan Bloomquist
> To: m...@yahoogroups.com
> Sent: Thursday, June 4, 2009 4:26:27
> Subject: Re: [msp430] Re: Timer B7 toggle problem
>
> Dan Fat wrote:
> > Hi.
> > I'm trying to generate some clock signals for a PCM codec (TP3054). It requires
specific timing 2048KHz, 1544Khz or 1536KHz. Because of this I have changed the crystal on
my board from 8MHz to 4096KHz in order to obtain the exact frequencies (I haven't tried to
put a 8192KHz because the F169 works with max 8MHz). After this I have to take the PCM
data and make some small processing. To take the overhead of the uC I'm trying to generate
these 2 signals. Because the application is more complex, I didn't want to use the both
timers (timer A is already occupied with RTC), and didn't want to use interrupts because
of the latency and, at this high frequency, the code keeps interrupted.
> > Should I try then to find a frequency divider IC, supply it's clock with the 2048KHz
toggle and divide further from there ?
> >
> > Hi Dan,
> Here is an app note that comes close, I think:
> So I take it
you are not doing a subscriber loop but something like a
> message recorder/playback? Yea, if you can live without one timer and
> SMCLK running at 2mhz, Greg's solution would work. One four bit divider
> will also get you both clocks and you are free to do what you want with
> the processor.
>
> It also looks like you don't have to run MCLK from XT2CLK but can use
> the DCO and keep your MCLK up at 8mhz for twice the horse power.
>
> Best, Dan.
>
> New Email addresses available on Yahoo!
> Get the Email name you've always wanted on the new @ymail and @rocketmail.
> Hurry before someone else does!
> http://mail.promotions.yahoo.com/newdomains/aa/
>
> [Non-text portions of this message have been removed]
>
------------------------------------

(You need to be a member of msp430 -- send a blank email to msp430-subscribe@yahoogroups.com )