Nevermind, it works...I should smack my head against the wall for a few
minutes.

helio

On Fri, 27 Jun 2003 14:02:50 -0400, helick wrote:

> Harry,
> 
> I followed your suggestion and this is what came out:
> 
> ------
>  BCSCTL1 |= 0x04;            //enable xtl2
>     _BIC_SR(OSCOFF);
>     do
>     {
>         for(i = 255; i > 0; i--)
>         {
>             IFG1 &= ~OFIFG;
>         }
>     }
>     while ((OFIFG & IFG1) != 0);
>     BCSCTL2 = 0x88;
> -------
> 
> Now it will get out of the loop and apparently try to do something.
> The baud rate is set to 9600bps, but the scope shows signals coming out
> very slowly from P3.4, nothing close to 9600bps.  I played around changing
> the baud in the program and it only changes slightly.  
> 
> From what I could see, it takes a while to get to the next interrupt.  If
> I just "continue" with no breakpoints in gdb/insight, it just sits there; 
> but if I insert a breakpoint in the middle of the loop (in main()), each
> iteration takes a while.
> Is that related to running it from the debugger?
> 
> Running it from the power supply shows nothing on P3.4
> 
> Please let me know.
> 
> -helio
> 
> P.S.  The UART0 config is the same as the original message.
> 
> 
> On Fri, 27 Jun 2003 13:11:28 +1000, Harry Lemmens wrote:
> 
>> Try putting the for(i... ) Loop around the crystal osc "do" loop and test.
>> The osc starts up, but stops as it is bouncing by the time you try to switch
>> to it, it has failed. This subject has been covered in just the last week,
>> so look back over the archive ...
>> 
>> Cheers
>> Harry
>> 
>> Home Phone(03) 9504 1957
>> Mobile                    0419 154 602
>> 
>> [email protected]
>> 
>> 
>> 
>> 
>> -----Original Message-----
>> From: [email protected]
>> [mailto:[email protected]]on Behalf Of helick
>> Sent: Friday, June 27, 2003 12:34 PM
>> To: [email protected]
>> Subject: [Mspgcc-users] more on clock source and UART
>> 
>> Hello again,
>> 
>> I am still having trouble with the serial communication portion of my
>> code.
>> From reading previous posts I composed the code bellow, which seems to be
>> correct, but the msp430f149 seems to have some peculiarities, so I am not
>> completely sure.
>> 
>> The code will hang on the clock initialization on both insight/gdb and
>> just running the thing on it's own power...I am pretty much out of ideas.
>> 
>> Please point out anything that might be wrong with this thing.
>> 
>> Thank you in advance.
>> 
>> helio
>> 
>> --------
>> 
>> void setup (void)
>> {
>>     unsigned int i;
>> 
>>     //port/pin setup for the specialCOMM
>>     P3DIR |= BIT4;
>>     P3SEL |= BIT4;              // Select pins to alternate function
>> 
>>     //clock setup
>>     BCSCTL1 |= 0x04;            //enable xtl2
>>     _BIC_SR(OSCOFF);
>>     do
>>     {
>>         IFG1 &= ~OFIFG;
>>         for(i = 255; i > 0; i--) __asm__ __volatile__("; loop");
>>     }
>>     while ((OFIFG & IFG1) != 0);
>>     BCSCTL2 = 0x88;
>> 
>>     //INITIALIZE serial port 0
>>     UCTL0 = CHAR | SWRST;       // 8 bit chars - leave in reset mode
>>     UTCTL0 = 0x20;              // uclk = smclk
>>     UBR10 = 0x01;               // 3.6864MHz/9600bps = 384 = 0x180
>>     UBR00 = 0x80;
>>     UMCTL0 = 0x00;
>>     ME1 |= UTXE0;               // Enable Tx0
>>     UCTL0 = CHAR;               // 8 bit chars - take out of reset
>> 
>>     IE1 |= UTXIE0;              //enable Tx0 interrupt
>> 
>>     eint();
>> }
>> 
>> 
>> 
>> 
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: INetU
>> Attention Web Developers & Consultants: Become An INetU Hosting Partner.
>> Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
>> INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
>> _______________________________________________
>> Mspgcc-users mailing list
>> [email protected]
>> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>> 
>> 
>> 
>> -------------------------------------------------------
>> This SF.Net email is sponsored by: INetU
>> Attention Web Developers & Consultants: Become An INetU Hosting Partner.
>> Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
>> INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
> 
> 
> 
> 
> -------------------------------------------------------
> This SF.Net email sponsored by: Free pre-built ASP.NET sites including
> Data Reports, E-commerce, Portals, and Forums are available now.
> Download today and enter to win an XBOX or Visual Studio .NET.
> http://aspnet.click-url.com/go/psa00100006ave/direct;at.asp_061203_01/01



Reply via email to