Reply by "mik...@yahoo.com [msp430]" February 18, 20152015-02-18
Well, I can actually understand why were thinking this way, but the timer is just used for timestamps...

Anyhow, I decided to throw this UART lib and write some code that will drive the UART(with interrupts).
I separated it from the rest of the project for now, and it seems to work as expected.
I will post it here later to see if you guys could run a quick review on it just to make sure I didn't miss anything there....

---In m..., wrote :

Sorry Mike, from a glimpse at the code you posted it looked like you were setting up the timer based on a watch crystal for bit timing.

/* Enable interrupt for TBCCR0. */
TBCCTL0 = CCIE;

/* Number of ticks per millisecond. */
clock.aclk = 32768;
clock.ticks_per_interrupt = clock.aclk / 1000;
TBCCR0 = clock.ticks_per_interrupt;

And it still seems that way, using a timer and then bit banging, or bit banging through the timer functions using TxSSEL bits, that is still not taking full advantage of the really nice peripheral Ti have provided. In the code snippets I posted there is absolutely no mention or use of the timer peripherals, which tends to severely limit the practical data rates you can achieve.

I admit I didn't go and download the sample code. I didn't really see the point even if I could have downloaded it, as it was clearly marked as not tested, and you don't point out the particular micro you are using. I didn't want to go hunting through the UART register structures to find the right model.
Al

On 18/02/2015 7:54 PM, mikemalgin@... mailto:mikemalgin@... [msp430] wrote:

Who said I'm not using interrupts? The whole UART thing is interrupt driven....

---In m... mailto:m..., mailto:Marty@... wrote :

I love getting under your skin. Maybe troll would be more accurate. I bet you are waiting for me to reply as your blood pressure goes up. Maybe I will answer your next email and maybe not… You never know troll…

From: "msp430@yahoogroups. com" mailto:m...
Reply-To: "msp430@yahoogroups. com" mailto:m...
Date: Tuesday, February 17, 2015 at 4:28 PM
To: "msp430@yahoogroups. com" mailto:m...
Subject: Re: [msp430] MSP430F5528 - Clock and UART

Who's bullying, I'm pointing out a simple fact, and asking a valid question, over the years I've been in this group one point seems to dominate here. The vast majorioty of people are scared of using interrupts, especially C programmers.

Bullying requires some form of abuse. Get your facts right before you make pointless off topic comments.

Al

On 18/02/2015 9:46 AM, Martin Bruner Marty@... mailto:Marty@... [msp430] wrote:

Spelling is important when bullying someone online.

From: "msp430@yahoogroups. com"
Reply-To: "msp430@yahoogroups. com"
Date: Tuesday, February 17, 2015 at 4:02 PM
To: "msp430@yahoogroups. com"
Subject: Re: [msp430] MSP430F5528 - Clock and UART

Well typing can be difficult when you only have limited use of your hands. I'll try to do better next time.

Al

On 18/02/2015 8:46 AM, Martin Bruner Marty@... mailto:Marty@... [msp430] wrote:

I believe you were looking for “frightening” not “fightening".

From: "msp430@yahoogroups. com"
Reply-To: "msp430@yahoogroups. com"
Date: Tuesday, February 17, 2015 at 3:07 PM
To: "msp430@yahoogroups. com"
Subject: Re: [msp430] MSP430F5528 - Clock and UART

Why oh why are you bit banging this when the MSP430 has an extremely simple UART in hardware. Are interrupts that fightening?

Al

On 18/02/2015 2:21 AM, mikemalgin@... mailto:mikemalgin@... [msp430] wrote:

Hello, I'm trying to communicate with my RF module through UART interface. However, I get many errors even with low load. I suspect that I have an issue with the way that I configure the clock or the UART.

Basically, for the UART functionality I use http://glitovsky.com/blog/?p00 http://glitovsky.com/blog/?p00
(I configured the connection as 8N1at 115200).

The clock configuration below is used with MCLK = 25 MHz ( when I use it with MCLK MHz I cannot communicate with the UART module at all ) .

P5SEL |= 0x0C;

/* Select REF0 for FLL reference. */
UCSCTL3 &= ~SELREF_7;
UCSCTL3 |= SELREF_2;

/* Set ACLK to use REF0CLK.
* Set SMCLK to use the DCO.
*/
UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;

UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
/* Initialize FLL. */
Init_FLL_Settle(mclk/1000L, mclk/32768);

XT2_Start(XT2DRIVE_0);

UCSCTL4 &= ~SELA_7;

UCSCTL4 |= SELA_2;
UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
/* Enable interrupt for TBCCR0. */
TBCCTL0 = CCIE;

/* Number of ticks per millisecond. */
clock.aclk = 32768;
clock.ticks_per_interrupt = clock.aclk / 1000;
TBCCR0 = clock.ticks_per_interrupt;

/* Use ACLK, set timer to up-count mode, and start timer at zero. */
TBCTL = TBSSEL_1 | MC_2 | TBCLR;

/* Enable interrupts. */
__bis_SR_register(GIE);

Thanks,
Mike

Beginning Microcontrollers with the MSP430

Reply by "One...@bigpond.net.au [msp430]" February 18, 20152015-02-18
Sorry Mike, from a glimpse at the code you posted it looked like you
were setting up the timer based on a watch crystal for bit timing.

/* Enable interrupt for TBCCR0. */
TBCCTL0 = CCIE;
/* Number of ticks per millisecond. */
clock.aclk = 32768;
clock.ticks_per_interrupt = clock.aclk / 1000;
TBCCR0 = clock.ticks_per_interrupt;

And it still seems that way, using a timer and then bit banging, or bit
banging through the timer functions using TxSSEL bits, that is still not
taking full advantage of the really nice peripheral Ti have provided. In
the code snippets I posted there is absolutely no mention or use of the
timer peripherals, which tends to severely limit the practical data
rates you can achieve.

I admit I didn't go and download the sample code. I didn't really see
the point even if I could have downloaded it, as it was clearly marked
as not tested, and you don't point out the particular micro you are
using. I didn't want to go hunting through the UART register structures
to find the right model.
Al

On 18/02/2015 7:54 PM, m...@yahoo.com [msp430] wrote:
> Who said I'm not using interrupts? The whole UART thing is interrupt
> driven....
> ---In m..., wrote :
>
> I love getting under your skin. Maybe troll would be more accurate.
> I bet you are waiting for me to reply as your blood pressure goes up.
> Maybe I will answer your next email and maybe not… You never know troll…
>
> From: "msp430@yahoogroups. com" > >
> Reply-To: "msp430@yahoogroups. com" > >
> Date: Tuesday, February 17, 2015 at 4:28 PM
> To: "msp430@yahoogroups. com" > >
> Subject: Re: [msp430] MSP430F5528 - Clock and UART
>
> Who's bullying, I'm pointing out a simple fact, and asking a valid
> question, over the years I've been in this group one point seems to
> dominate here. The vast majorioty of people are scared of using
> interrupts, especially C programmers.
>
> Bullying requires some form of abuse. Get your facts right before you
> make pointless off topic comments.
>
> Al
>
> On 18/02/2015 9:46 AM, Martin Bruner Marty@...
> [msp430] wrote:
>
>> Spelling is important when bullying someone online.
>>
>> From: "msp430@yahoogroups. com"
>> >
>> Reply-To: "msp430@yahoogroups. com"
>> >> >
>> Date: Tuesday, February 17, 2015 at 4:02 PM
>> To: "msp430@yahoogroups. com"
>> >
>> Subject: Re: [msp430] MSP430F5528 - Clock and UART
>>
>> Well typing can be difficult when you only have limited use of
>> your hands. I'll try to do better next time.
>>
>> Al
>> On 18/02/2015 8:46 AM, Martin Bruner Marty@...
>> [msp430] wrote:
>>>
>>>
>>> I believe you were looking for “frightening” not “fightening".
>>>
>>> From: "msp430@yahoogroups. com"
>>> >
>>> Reply-To: "msp430@yahoogroups. com"
>>> >>> >
>>> Date: Tuesday, February 17, 2015 at 3:07 PM
>>> To: "msp430@yahoogroups. com"
>>> >
>>> Subject: Re: [msp430] MSP430F5528 - Clock and UART
>>>
>>> Why oh why are you bit banging this when the MSP430 has an
>>> extremely simple UART in hardware. Are interrupts that fightening?
>>>
>>> Al
>>>
>>> On 18/02/2015 2:21 AM, mikemalgin@...
>>> [msp430] wrote:
>>>>
>>>>
>>>>
>>>> Hello, I'm trying to communicate with my RF module through UART
>>>> interface. However, I get many errors even with low load. I
>>>> suspect that I have an issue with the way that I configure the
>>>> clock or the UART.
>>>>
>>>>
>>>> Basically, for the UART functionality I use
>>>> http://glitovsky.com/blog/?p00
>>>>
>>>> (I configured the connection as 8N1at 115200).
>>>>
>>>>
>>>> The clock configuration below is used with MCLK = 25 MHz ( when
>>>> I use it with MCLK MHz I cannot communicate with the UART
>>>> module at all ) .
>>>>
>>>>
>>>> P5SEL |= 0x0C;
>>>>
>>>> /* Select REF0 for FLL reference. */
>>>>
>>>> UCSCTL3 &= ~SELREF_7;
>>>>
>>>> UCSCTL3 |= SELREF_2;
>>>>
>>>>
>>>> /* Set ACLK to use REF0CLK.
>>>>
>>>> * Set SMCLK to use the DCO.
>>>>
>>>> */
>>>>
>>>> UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;
>>>>
>>>> UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
>>>>
>>>> /* Initialize FLL. */
>>>> Init_FLL_Settle(mclk/1000L, mclk/32768);
>>>>
>>>> XT2_Start(XT2DRIVE_0);
>>>>
>>>> UCSCTL4 &= ~SELA_7;
>>>> UCSCTL4 |= SELA_2;
>>>> UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
>>>> /* Enable interrupt for TBCCR0. */
>>>> TBCCTL0 = CCIE;
>>>> /* Number of ticks per millisecond. */
>>>> clock.aclk = 32768;
>>>> clock.ticks_per_interrupt = clock.aclk / 1000;
>>>> TBCCR0 = clock.ticks_per_interrupt;
>>>>
>>>> /* Use ACLK, set timer to up-count mode, and start timer at
>>>> zero. */
>>>> TBCTL = TBSSEL_1 | MC_2 | TBCLR;
>>>>
>>>> /* Enable interrupts. */
>>>> __bis_SR_register(GIE);
>>>> Thanks,
>>>> Mike
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>
>>>
>
Reply by "One...@bigpond.net.au [msp430]" February 18, 20152015-02-18
Assembler only from me. But here's my init routine from a 2618 based
design that uses only a watch crystal (20ppm) and the internally
calibrated DCO settings.

/************************************************************
* Initialise USCIA0 as UART
************************************************************/
BIS.B #UCSWRST,&UCA0CTL1
CLR.B &UCA0CTL0 ;SET FOR UART 0:8:1 LSB FIRST
MOV.B #UCSSEL_2,&UCA0CTL1 ;CLOCK = SMCLK HOLD IN RESET
MOV.B #B0_460,&UCA0BR0 ;SET FOR 115.2KBAUD WRITE
BR1:BR0 AS WORD
MOV.B #B1_460,&UCA0BR1 ;SET FOR 115.2KBAUD WRITE
BR1:BR0 AS WORD
BIS.B #BRF_460+BRS_460+UCOS16,&UCA0MCTL
BIS.B #RXD,&P3SEL ;ENABLE UART RECEIVE MODE
BIC.B #UCSWRST,&UCA0CTL1
BIS.B #UCA0RXIE,&IE2 ;ENABLE THE RECEIVE ISR FOR
UART FUNCTIONS

Here are the baud settings from my header file:-

B0_460 EQU 2
B1_460 EQU 0
BRS_460 EQU 6
BRF_460 EQU 32

and here is a simple ISR that in this case handles byte at a time
reception through a flag to the foreground routine in Main. This is to
allow variable packet length and different packet formats to be handled
with ease. For fixed packet lengths and format it would be simpler to
store to a buffer and post process, or add a command byte check at the
right point so you can abort receive early if there is an error detected.

USC0RX_ISR:
BIT.B #UCA0RXIFG,&IFG2 ;CHECK FOR INTERRUPTING CHANNEL
JZ DOSPI0
MOV.B &UCA0RXBUF,&RXDATA ;AND HANDLE UART HERE
BIS.B #GOTRX,&SYSTEM_FLAGS
RETI
DOSPI0:

This runs at 460kbaud very reliably. I do retune the DCO with a software
FLL if the temperature drifts too much, but it is rarely necessary

Cheers

Al
On 18/02/2015 7:37 PM, m...@yahoo.com [msp430] wrote:
> Guys,
> Thanks for getting back to me on this :)
> I'm pretty new to MSP430, I did go over the UART lib code and I am
> familiar with how it works, I couldn't find any issue with it though.
> However, I might have missed something there.
>
> I am using UART in hardware, the ports that I'm using is P3.3,4 > USCI_A0 TXD/RXD
> Any chance you guys could point me to something that you are familiar
> with and know it works?
>
> BTW, you guys are right and I wouldn't use untrusted *close* source.
> In this case though, the code is open and can be tested and inspected.
>
> Mike
>
> ---In m..., wrote :
>
> tested by whom? do you trust just anybody to develop libraries. Ti
> rarely get it right, and they should be the goto people. In this
> specific example the guy who posted the UART example code actually
> states that it is untested.
>
> Al
>
> On 18/02/2015 9:51 AM, Jake Grajewski prs.jake@...
> [msp430] wrote:
>
> Touche, but a good software developer /*never */uses untested
> libraries, now that would just be silly. ;-P.
>
> Caption this picture
>
> On Tue, Feb 17, 2015 at 3:15 PM, Onestone onestone@...
> [msp430] > > wrote:
>
> Wrong, totally. the first rule of software development is that
> the best code is the one that you personally know has been
> fully debugged, and usually that is one that you wrote. If you
> trust others to write better code than you then you are asking
> for a world of grief.
>
> Who says I'm a bear? Anyway it's 'built in' not 'build in'. :-P
>
> Al
>
> On 18/02/2015 9:38 AM, Jake Grajewski prs.jake@...
> [msp430] wrote:
>> Hi All,
>>
>> First off, The first rule of software development is that the
>> best code is the one you didn't have to write ^^.
>>
>> I agree with Al here, why aren't you using the build in UART
>> tool in the microprocessor. It is build to be used in this
>> way, and the only reason ever not to is if you have to use a
>> certain chip and you have run out of UART ports to use.
>>
>> @Martin: Now you are just poking the bear aren't you.
>>
>> Cheers,
>> Jake
>>
>> On Tue, Feb 17, 2015 at 2:07 PM, Onestone onestone@...
>> [msp430] >> > wrote:
>>
>> Why oh why are you bit banging this when the MSP430 has
>> an extremely simple UART in hardware. Are interrupts that
>> fightening?
>>
>> Al
>>
>> On 18/02/2015 2:21 AM, mikemalgin@...
>> [msp430] wrote:
>>>
>>>
>>>
>>> Hello, I'm trying to communicate with my RF module
>>> through UART interface. However, I get many errors even
>>> with low load. I suspect that I have an issue with the
>>> way that I configure the clock or the UART.
>>>
>>>
>>> Basically, for the UART functionality I use
>>> http://glitovsky.com/blog/?p00
>>>
>>> (I configured the connection as 8N1at 115200).
>>>
>>>
>>> The clock configuration below is used with MCLK = 25 MHz
>>> ( when I use it with MCLK MHz I cannot communicate
>>> with the UART module at all ) .
>>>
>>>
>>> P5SEL |= 0x0C;
>>>
>>> /* Select REF0 for FLL reference. */
>>>
>>> UCSCTL3 &= ~SELREF_7;
>>>
>>> UCSCTL3 |= SELREF_2;
>>>
>>>
>>> /* Set ACLK to use REF0CLK.
>>>
>>> * Set SMCLK to use the DCO.
>>>
>>> */
>>>
>>> UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;
>>>
>>> UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
>>>
>>> /* Initialize FLL. */
>>> Init_FLL_Settle(mclk/1000L, mclk/32768);
>>>
>>> XT2_Start(XT2DRIVE_0);
>>>
>>> UCSCTL4 &= ~SELA_7;
>>> UCSCTL4 |= SELA_2;
>>> UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
>>> /* Enable interrupt for TBCCR0. */
>>> TBCCTL0 = CCIE;
>>> /* Number of ticks per millisecond. */
>>> clock.aclk = 32768;
>>> clock.ticks_per_interrupt = clock.aclk / 1000;
>>> TBCCR0 = clock.ticks_per_interrupt;
>>>
>>> /* Use ACLK, set timer to up-count mode, and start
>>> timer at zero. */
>>> TBCTL = TBSSEL_1 | MC_2 | TBCLR;
>>>
>>> /* Enable interrupts. */
>>> __bis_SR_register(GIE);
>>> Thanks,
>>> Mike
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>> --
>> Thomas J. Grajewski
>>
> --
> Thomas J. Grajewski
>
Reply by "mik...@yahoo.com [msp430]" February 18, 20152015-02-18
Who said I'm not using interrupts? The whole UART thing is interrupt driven....

---In m..., wrote :

I love getting under your skin. Maybe troll would be more accurate. I bet you are waiting for me to reply as your blood pressure goes up. Maybe I will answer your next email and maybe not… You never know troll…

From: "msp430@yahoogroups. com"
Reply-To: "msp430@yahoogroups. com"
Date: Tuesday, February 17, 2015 at 4:28 PM
To: "msp430@yahoogroups. com"
Subject: Re: [msp430] MSP430F5528 - Clock and UART

Who's bullying, I'm pointing out a simple fact, and asking a valid question, over the years I've been in this group one point seems to dominate here. The vast majorioty of people are scared of using interrupts, especially C programmers.

Bullying requires some form of abuse. Get your facts right before you make pointless off topic comments.

Al

On 18/02/2015 9:46 AM, Martin Bruner Marty@... mailto:Marty@... [msp430] wrote:

Spelling is important when bullying someone online.

From: "msp430@yahoogroups. com" mailto:m...
Reply-To: "msp430@yahoogroups. com" mailto:m...
Date: Tuesday, February 17, 2015 at 4:02 PM
To: "msp430@yahoogroups. com" mailto:m...
Subject: Re: [msp430] MSP430F5528 - Clock and UART

Well typing can be difficult when you only have limited use of your hands. I'll try to do better next time.

Al

On 18/02/2015 8:46 AM, Martin Bruner Marty@... mailto:Marty@... [msp430] wrote:

I believe you were looking for “frightening” not “fightening".

From: "msp430@yahoogroups. com"
Reply-To: "msp430@yahoogroups. com"
Date: Tuesday, February 17, 2015 at 3:07 PM
To: "msp430@yahoogroups. com"
Subject: Re: [msp430] MSP430F5528 - Clock and UART

Why oh why are you bit banging this when the MSP430 has an extremely simple UART in hardware. Are interrupts that fightening?

Al

On 18/02/2015 2:21 AM, mikemalgin@... mailto:mikemalgin@... [msp430] wrote:

Hello, I'm trying to communicate with my RF module through UART interface. However, I get many errors even with low load. I suspect that I have an issue with the way that I configure the clock or the UART.

Basically, for the UART functionality I use http://glitovsky.com/blog/?p00 http://glitovsky.com/blog/?p00
(I configured the connection as 8N1at 115200).

The clock configuration below is used with MCLK = 25 MHz ( when I use it with MCLK MHz I cannot communicate with the UART module at all ) .

P5SEL |= 0x0C;

/* Select REF0 for FLL reference. */
UCSCTL3 &= ~SELREF_7;
UCSCTL3 |= SELREF_2;

/* Set ACLK to use REF0CLK.
* Set SMCLK to use the DCO.
*/
UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;

UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
/* Initialize FLL. */
Init_FLL_Settle(mclk/1000L, mclk/32768);

XT2_Start(XT2DRIVE_0);

UCSCTL4 &= ~SELA_7;

UCSCTL4 |= SELA_2;
UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
/* Enable interrupt for TBCCR0. */
TBCCTL0 = CCIE;

/* Number of ticks per millisecond. */
clock.aclk = 32768;
clock.ticks_per_interrupt = clock.aclk / 1000;
TBCCR0 = clock.ticks_per_interrupt;

/* Use ACLK, set timer to up-count mode, and start timer at zero. */
TBCTL = TBSSEL_1 | MC_2 | TBCLR;

/* Enable interrupts. */
__bis_SR_register(GIE);

Thanks,
Mike
Reply by "Mik...@tuxpower.dk [msp430]" February 18, 20152015-02-18
All,

I have been on this list for quite some time and I have newer had the
impression that @onestone was bullying or had the intention to.
But this might have to do with personal thresholds for when something is
seen as bullying? Maybe Martin need his DCO adjusted?
Martin, a thretorically question for you. Could you actually be seen as
the troll here? Maybe you've had you 15 seconds of fame and now it's
time to step back a bit.

And sorry about my spelling or not gramatically correct sentences.
English is not my native language.

Thanks,
Mikael

And before my spelling is
On 17/02/2015 23:21, Martin Bruner M...@bruner-consulting.com [msp430]
wrote:
> Jake,
>
> Interesting point. I have been watching @onestone abuse people for
> quite some time. I thought I might interject a bit to see if I can
> stimulate his cortisol levels ;) I love to do that to online bullies
> ;) I think it will be fun to see his reaction.
>
> From: "msp430@yahoogroups. com" > >
> Reply-To: "msp430@yahoogroups. com" > >
> Date: Tuesday, February 1 7, 2015 at 4:08 PM
> To: "msp430@yahoogroups. com" > >
> Subject: Re: [msp430] MSP430F5528 - Clock and UART
>
> Hi All,
>
> First off, The first rule of software development is that the best
> code is the one you didn't have to write ^^.
>
> I agree with Al here, why aren't you using the build in UART tool in
> the microprocessor. It is build to be used in this way, and the only
> reason ever not to is if you have to use a certain chip and you have
> run out of UART ports to use.
>
> @Martin: Now you are just poking the bear aren't you.
>
> Cheers,
> Jake
>
> On Tue, Feb 17, 2015 at 2:07 PM, Onestone o...@bigpond.net.au
> [msp430] > > wrote:
>
> Why oh why are you bit banging this when the MSP430 has an
> extremely simple UART in hardware. Are interrupts that fightening?
>
> Al
>
> On 18/02/2015 2:21 AM, m...@yahoo.com
> [msp430] wrote:
>>
>> Hello, I'm trying to communicate with my RF module through UART
>> interface. However, I get many errors even with low load. I
>> suspect that I have an issue with the way that I configure the
>> clock or the UART.
>> Basically, for the UART functionality I use
>> http://glitovsky.com/blog/?p00
>>
>> (I configured the connection as 8N1 at 115200).
>> The clock configuration below is used with MCLK = 25 MHz ( when I
>> use it with MCLK MHz I cannot communicate with the UART module
>> at all ) .
>> P5SEL |= 0x0C;
>>
>> /* Select REF0 for FLL reference. */
>>
>> UCSCTL3 &= ~SELREF_7;
>>
>> UCSCTL3 |= SELREF_2;
>> /* Set ACLK to use REF0CLK.
>>
>> * Set SMCLK to use the DCO.
>>
>> */
>>
>> UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;
>>
>> UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
>>
>> /* Initialize FLL. */
>> Init_FLL_Settle(mclk/1000L, mclk/32768);
>>
>> XT2_Start(XT2DRIVE_0);
>>
>> UCSCTL4 &= ~SELA_7;
>> UCSCTL4 |= SELA_2;
>> UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
>> /* Enable interrupt for TBCCR0. */
>> TBCCTL0 = CCIE;
>> /* Number of ticks per millisecond. */
>> clock.aclk = 32768;
>> clock.ticks_per_interrupt = clock.aclk / 1000;
>> TBCCR0 = clock.ticks_per_interrupt;
>>
>> /* Use ACLK, set timer to up-count mode, and start timer at
>> zero. */
>> TBCTL = TBSSEL_1 | MC_2 | TBCLR;
>>
>> /* Enable interrupts. */
>> __bis_SR_register(GIE);
>> Thanks,
>> Mike
> --
> Thomas J. Grajewski
Reply by "mik...@yahoo.com [msp430]" February 18, 20152015-02-18
I meant and "fixed", the code can be tested and fixed:)
Reply by "mik...@yahoo.com [msp430]" February 18, 20152015-02-18
Guys,
Thanks for getting back to me on this :)
I'm pretty new to MSP430, I did go over the UART lib code and I am familiar with how it works, I couldn't find any issue with it though. However, I might have missed something there.

I am using UART in hardware, the ports that I'm using is P3.3,4 = USCI_A0 TXD/RXD
Any chance you guys could point me to something that you are familiar with and know it works?

BTW, you guys are right and I wouldn't use untrusted *close* source. In this case though, the code is open and can be tested and inspected.

Mike

---In m..., wrote :

tested by whom? do you trust just anybody to develop libraries. Ti rarely get it right, and they should be the goto people. In this specific example the guy who posted the UART example code actually states that it is untested.

Al

On 18/02/2015 9:51 AM, Jake Grajewski prs.jake@... mailto:prs.jake@... [msp430] wrote:

Touche, but a good software developer never uses untested libraries, now that would just be silly. ;-P.

On Tue, Feb 17, 2015 at 3:15 PM, Onestone onestone@... mailto:onestone@... [msp430] wrote:
Wrong, totally. the first rule of software development is that the best code is the one that you personally know has been fully debugged, and usually that is one that you wrote. If you trust others to write better code than you then you are asking for a world of grief.

Who says I'm a bear? Anyway it's 'built in' not 'build in'. :-P

Al

On 18/02/2015 9:38 AM, Jake Grajewski prs.jake@... mailto:prs.jake@... [msp430] wrote:

Hi All,

First off, The first rule of software development is that the best code is the one you didn't have to write ^^.

I agree with Al here, why aren't you using the build in UART tool in the microprocessor. It is build to be used in this way, and the only reason ever not to is if you have to use a certain chip and you have run out of UART ports to use.

@Martin: Now you are just poking the bear aren't you.

Cheers,
Jake

On Tue, Feb 17, 2015 at 2:07 PM, Onestone onestone@... mailto:onestone@... [msp430] wrote:
Why oh why are you bit banging this when the MSP430 has an extremely simple UART in hardware. Are interrupts that fightening?

Al

On 18/02/2015 2:21 AM, mikemalgin@... mailto:mikemalgin@... [msp430] wrote:

Hello, I'm trying to communicate with my RF module through UART interface. However, I get many errors even with low load. I suspect that I have an issue with the way that I configure the clock or the UART.

Basically, for the UART functionality I use http://glitovsky.com/blog/?p00 http://glitovsky.com/blog/?p00
(I configured the connection as 8N1at 115200).

The clock configuration below is used with MCLK = 25 MHz ( when I use it with MCLK MHz I cannot communicate with the UART module at all ) .

P5SEL |= 0x0C;

/* Select REF0 for FLL reference. */
UCSCTL3 &= ~SELREF_7;
UCSCTL3 |= SELREF_2;

/* Set ACLK to use REF0CLK.
* Set SMCLK to use the DCO.
*/
UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;

UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
/* Initialize FLL. */
Init_FLL_Settle(mclk/1000L, mclk/32768);

XT2_Start(XT2DRIVE_0);

UCSCTL4 &= ~SELA_7;

UCSCTL4 |= SELA_2;
UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
/* Enable interrupt for TBCCR0. */
TBCCTL0 = CCIE;

/* Number of ticks per millisecond. */
clock.aclk = 32768;
clock.ticks_per_interrupt = clock.aclk / 1000;
TBCCR0 = clock.ticks_per_interrupt;

/* Use ACLK, set timer to up-count mode, and start timer at zero. */
TBCTL = TBSSEL_1 | MC_2 | TBCLR;

/* Enable interrupts. */
__bis_SR_register(GIE);

Thanks,
Mike

--
Thomas J. Grajewski

--
Thomas J. Grajewski
Reply by "Mar...@bruner-consulting.com [msp430]" February 17, 20152015-02-17
I love getting under your skin. Maybe troll would be more accurate. I bet
you are waiting for me to reply as your blood pressure goes up. Maybe I
will answer your next email and maybe not You never know troll

From: "msp430@yahoogroups. com"
Reply-To: "msp430@yahoogroups. com"
Date: Tuesday, February 17, 2015 at 4:28 PM
To: "msp430@yahoogroups. com"
Subject: Re: [msp430] MSP430F5528 - Clock and UART

Who's bullying, I'm pointing out a simple fact, and asking a valid
question, over the years I've been in this group one point seems to dominate
here. The vast majorioty of people are scared of using interrupts,
especially C programmers.

Bullying requires some form of abuse. Get your facts right before you make
pointless off topic comments.

Al

On 18/02/2015 9:46 AM, Martin Bruner M...@bruner-consulting.com [msp430]
wrote:

>
>
>
> Spelling is important when bullying someone online.
>
>
>
>
> From: "msp430@yahoogroups. com"
>
> Reply-To: "msp430@yahoogroups. com"
>
> Date: Tuesday, February 17, 2015 at 4:02 PM
> To: "msp430@yahoogroups. com"
>
> Subject: Re: [msp430] MSP430F5528 - Clock and UART
>
>
>
>
>
>
>
>
>
> Well typing can be difficult when you only have limited use of your hands.
> I'll try to do better next time.
>
> Al
>
>
>
>
> On 18/02/2015 8:46 AM, Martin Bruner M...@bruner-consulting.com [msp430]
> wrote:
>
>
>>
>>
>>
>> I believe you were looking for frightening not fightening".
>>
>>
>>
>>
>> From: "msp430@yahoogroups. com"
>>
>> Reply-To: "msp430@yahoogroups. com"
>>
>> Date: Tuesday, February 17, 2015 at 3:07 PM
>> To: "msp430@yahoogroups. com"
>>
>> Subject: Re: [msp430] MSP430F5528 - Clock and UART
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> Why oh why are you bit banging this when the MSP430 has an extremely simple
>> UART in hardware. Are interrupts that fightening?
>>
>> Al
>>
>>
>>
>> On 18/02/2015 2:21 AM, m...@yahoo.com [msp430] wrote:
>>
>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> Hello, I'm trying to communicate with my RF module through UART interface.
>>> However, I get many errors even with low load. I suspect that I have an
>>> issue with the way that I configure the clock or the UART.
>>>
>>>
>>>
>>>
>>>
>>>
>>> Basically, for the UART functionality I use http://glitovsky.com/blog/?p00
>>>
>>>
>>> (I configured the connection as 8N1 at 115200).
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> The clock configuration below is used with MCLK = 25 MHz ( when I use it
>>> with MCLK MHz I cannot communicate with the UART module at all ) .
>>>
>>>
>>>
>>>
>>>
>>>
>>> P5SEL |= 0x0C;
>>>
>>>
>>>
>>> /* Select REF0 for FLL reference. */
>>>
>>>
>>> UCSCTL3 &= ~SELREF_7;
>>>
>>>
>>> UCSCTL3 |= SELREF_2;
>>>
>>>
>>>
>>>
>>>
>>>
>>> /* Set ACLK to use REF0CLK.
>>>
>>>
>>> * Set SMCLK to use the DCO.
>>>
>>>
>>> */
>>>
>>>
>>> UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;
>>>
>>>
>>>
>>>
>>> UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
>>>
>>>
>>> /* Initialize FLL. */
>>>
>>> Init_FLL_Settle(mclk/1000L, mclk/32768);
>>>
>>>
>>>
>>>
>>>
>>> XT2_Start(XT2DRIVE_0);
>>>
>>>
>>>
>>>
>>> UCSCTL4 &= ~SELA_7;
>>>
>>>
>>> UCSCTL4 |= SELA_2;
>>>
>>> UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
>>>
>>> /* Enable interrupt for TBCCR0. */
>>>
>>> TBCCTL0 = CCIE;
>>>
>>>
>>>
>>> /* Number of ticks per millisecond. */
>>>
>>> clock.aclk = 32768;
>>>
>>> clock.ticks_per_interrupt = clock.aclk / 1000;
>>>
>>> TBCCR0 = clock.ticks_per_interrupt;
>>>
>>>
>>>
>>>
>>> /* Use ACLK, set timer to up-count mode, and start timer at zero. */
>>>
>>> TBCTL = TBSSEL_1 | MC_2 | TBCLR;
>>>
>>>
>>>
>>>
>>> /* Enable interrupts. */
>>>
>>> __bis_SR_register(GIE);
>>>
>>>
>>>
>>>
>>>
>>>
>>> Thanks,
>>>
>>> Mike
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>>
>>
>>
>>
>
>
>
>
>
>
>
>
Reply by "One...@bigpond.net.au [msp430]" February 17, 20152015-02-17
tested by whom? do you trust just anybody to develop libraries. Ti
rarely get it right, and they should be the goto people. In this
specific example the guy who posted the UART example code actually
states that it is untested.

Al

On 18/02/2015 9:51 AM, Jake Grajewski p...@gmail.com [msp430] wrote:
> Touche, but a good software developer /*never */uses untested
> libraries, now that would just be silly. ;-P.
>
> Caption this picture
>
> On Tue, Feb 17, 2015 at 3:15 PM, Onestone o...@bigpond.net.au
> [msp430] > > wrote:
>
> Wrong, totally. the first rule of software development is that the
> best code is the one that you personally know has been fully
> debugged, and usually that is one that you wrote. If you trust
> others to write better code than you then you are asking for a
> world of grief.
>
> Who says I'm a bear? Anyway it's 'built in' not 'build in'. :-P
>
> Al
>
> On 18/02/2015 9:38 AM, Jake Grajewski p...@gmail.com
> [msp430] wrote:
>> Hi All,
>>
>> First off, The first rule of software development is that the
>> best code is the one you didn't have to write ^^.
>>
>> I agree with Al here, why aren't you using the build in UART tool
>> in the microprocessor. It is build to be used in this way, and
>> the only reason ever not to is if you have to use a certain chip
>> and you have run out of UART ports to use.
>>
>> @Martin: Now you are just poking the bear aren't you.
>>
>> Cheers,
>> Jake
>>
>> On Tue, Feb 17, 2015 at 2:07 PM, Onestone o...@bigpond.net.au
>> [msp430] >> > wrote:
>>
>> Why oh why are you bit banging this when the MSP430 has an
>> extremely simple UART in hardware. Are interrupts that
>> fightening?
>>
>> Al
>>
>> On 18/02/2015 2:21 AM, m...@yahoo.com
>> [msp430] wrote:
>>>
>>>
>>>
>>> Hello, I'm trying to communicate with my RF module through
>>> UART interface. However, I get many errors even with low
>>> load. I suspect that I have an issue with the way that I
>>> configure the clock or the UART.
>>>
>>>
>>> Basically, for the UART functionality I use
>>> http://glitovsky.com/blog/?p00
>>>
>>> (I configured the connection as 8N1 at 115200).
>>>
>>>
>>> The clock configuration below is used with MCLK = 25 MHz (
>>> when I use it with MCLK MHz I cannot communicate with the
>>> UART module at all ) .
>>>
>>>
>>> P5SEL |= 0x0C;
>>>
>>> /* Select REF0 for FLL reference. */
>>>
>>> UCSCTL3 &= ~SELREF_7;
>>>
>>> UCSCTL3 |= SELREF_2;
>>>
>>>
>>> /* Set ACLK to use REF0CLK.
>>>
>>> * Set SMCLK to use the DCO.
>>>
>>> */
>>>
>>> UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;
>>>
>>> UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
>>>
>>> /* Initialize FLL. */
>>> Init_FLL_Settle(mclk/1000L, mclk/32768);
>>>
>>> XT2_Start(XT2DRIVE_0);
>>>
>>> UCSCTL4 &= ~SELA_7;
>>> UCSCTL4 |= SELA_2;
>>> UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
>>> /* Enable interrupt for TBCCR0. */
>>> TBCCTL0 = CCIE;
>>> /* Number of ticks per millisecond. */
>>> clock.aclk = 32768;
>>> clock.ticks_per_interrupt = clock.aclk / 1000;
>>> TBCCR0 = clock.ticks_per_interrupt;
>>>
>>> /* Use ACLK, set timer to up-count mode, and start timer
>>> at zero. */
>>> TBCTL = TBSSEL_1 | MC_2 | TBCLR;
>>>
>>> /* Enable interrupts. */
>>> __bis_SR_register(GIE);
>>> Thanks,
>>> Mike
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>> --
>> Thomas J. Grajewski
>>
> --
> Thomas J. Grajewski
Reply by "One...@bigpond.net.au [msp430]" February 17, 20152015-02-17
Who's bullying, I'm pointing out a simple fact, and asking a valid
question, over the years I've been in this group one point seems to
dominate here. The vast majorioty of people are scared of using
interrupts, especially C programmers.

Bullying requires some form of abuse. Get your facts right before you
make pointless off topic comments.

Al

On 18/02/2015 9:46 AM, Martin Bruner M...@bruner-consulting.com
[msp430] wrote:
> Spelling is important when bullying someone online.
>
> From: "msp430@yahoogroups. com" > >
> Reply-To: "msp430@yahoogroups. com" > >
> Date: Tuesday, February 17, 2015 at 4:02 PM
> To: "msp430@yahoogroups. com" > >
> Subject: Re: [msp430] MSP430F5528 - Clock and UART
>
> Well typing can be difficult when you only have limited use of your
> hands. I'll try to do better next time.
>
> Al
> On 18/02/2015 8:46 AM, Martin Bruner M...@bruner-consulting.com
> [msp430] wrote:
>> I believe you were looking for “frightening” not “fightening".
>>
>> From: "msp430@yahoogroups. com" >> >
>> Reply-To: "msp430@yahoogroups. com" >> >
>> Date: Tuesday, February 17, 2015 at 3:07 PM
>> To: "msp430@yahoogroups. com" >> >
>> Subject: Re: [msp430] MSP430F5528 - Clock and UART
>>
>> Why oh why are you bit banging this when the MSP430 has an extremely
>> simple UART in hardware. Are interrupts that fightening?
>>
>> Al
>>
>> On 18/02/2015 2:21 AM, m...@yahoo.com [msp430] wrote:
>>>
>>>
>>>
>>> Hello, I'm trying to communicate with my RF module through UART
>>> interface. However, I get many errors even with low load. I suspect
>>> that I have an issue with the way that I configure the clock or the
>>> UART.
>>>
>>>
>>> Basically, for the UART functionality I use
>>> http://glitovsky.com/blog/?p00
>>>
>>> (I configured the connection as 8N1 at 115200).
>>>
>>>
>>> The clock configuration below is used with MCLK = 25 MHz ( when I
>>> use it with MCLK MHz I cannot communicate with the UART module at
>>> all ) .
>>>
>>>
>>> P5SEL |= 0x0C;
>>>
>>> /* Select REF0 for FLL reference. */
>>>
>>> UCSCTL3 &= ~SELREF_7;
>>>
>>> UCSCTL3 |= SELREF_2;
>>>
>>>
>>> /* Set ACLK to use REF0CLK.
>>>
>>> * Set SMCLK to use the DCO.
>>>
>>> */
>>>
>>> UCSCTL4 &= ~SELA_7 & ~SELS_7 & ~SELM_7;
>>>
>>> UCSCTL4 |= SELA_2 | SELS_4 | SELM_4;
>>>
>>> /* Initialize FLL. */
>>> Init_FLL_Settle(mclk/1000L, mclk/32768);
>>>
>>> XT2_Start(XT2DRIVE_0);
>>>
>>> UCSCTL4 &= ~SELA_7;
>>> UCSCTL4 |= SELA_2;
>>> UCSCTL8 |= SMCLKREQEN | MCLKREQEN | ACLKREQEN;
>>> /* Enable interrupt for TBCCR0. */
>>> TBCCTL0 = CCIE;
>>> /* Number of ticks per millisecond. */
>>> clock.aclk = 32768;
>>> clock.ticks_per_interrupt = clock.aclk / 1000;
>>> TBCCR0 = clock.ticks_per_interrupt;
>>>
>>> /* Use ACLK, set timer to up-count mode, and start timer at zero. */
>>> TBCTL = TBSSEL_1 | MC_2 | TBCLR;
>>>
>>> /* Enable interrupts. */
>>> __bis_SR_register(GIE);
>>> Thanks,
>>> Mike
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>