Dear all,
I am an AVR atmega8 refugee, and msp's clocking scheme seems pretty feature rich (not to mention complex!). I am using MSP430G2 launchpad (g2553). This program uses TImerA, and hardware UART with interrupt. It runs at 1Mhz from DCO. And the peripherals take clock from SMCLK.
The UART just echos whatever it receives. The timer generate 500ms delay, and toggles the red and green leds on board
http://pastebin.com/yApLyFbu
The problem is, I can only have one peripheral at a time using the SMCLK. If I have the above code running exactly as it is, the timer will correctly run and toggle the leds as expected, but the UART echo wont work.
If I comment out line 8,
TACTL = TASSEL1; //set SMCLK as source - TASSELx = 10
(which means timer is not turned-on at all, right?) then UART echo works.
So is it something wrong with my code, or is it like that with the MSP430G2253 ?
--
Thanks and Regards,
Aurabindo

Great!
But still, thats timer's problem, right? Why would that mess with UART? It must be some kinda reset like you mentioned, but how do I go about finding what exactly its happening inside the chip?
I havent used gdb yet. Will it be *theoritically* possible to know whats happening inside if I use it?

Okay I found a solution. But my conscience says that fix is *impossible*, but for some reason, its working!!!
This is the setting that's working (both UART and Timer). What did the trick is, change the line:
TACTL = TASSEL1 | MC0 | TAIE;
to
TACTL = TASSEL1 | MC0;
So dont enable the timer interrupt. Then timer interrupt routines will work!
Please someone should help me explain why its so! The full code which works is http://pastebin.com/HtP5yfDW

Thank you for the response @@pabigot, but I cant figure out what exactly I'm supposed to change in UART. It doesnt have any prescaler setting. AFAIK, just has a clock select (which is SMCLK in my case), and the Baud rate control registers, UCA0BR0 and UCA0BR1. Those values are constants, for a particular baud rate I believe. Though Timer has one independent prescaler, my setting is no prescaling (1).
It seems I can have a global prescaler for SMCLK, but will equally change the timer's clock too. What exactly are you proposing to change?
,

Dear pabigot
Thank you for that informative response.
I tried adding __set_watchdog_clear_value(WDTPW+WDTHOLD); ed at the start of main() and checked the disassembled output, but I get the same watchdog_support section as before. What is the right way to use the inbuilt watchdog ?
It might be an overkill for me right now to use these advanced stuff, but I would also like to know about all the other internal features that mspgcc has. Is there a documentation about them anywhere? I googled, but couldnt find anything regarding the watchdog functions you mentioned. The best I could find was http://mspgcc.sourceforge.net/manual/book1.html.
I already had -Os in the build.

Hello everyone,
FIrst - its not the permission issue of not having a proper udev rule.
I am on Debian Wheezy with all the msp related packages installed from the official repos - including mspdebug. But after I connect the launchpad and give:
mspdebug rf2500
I get
usbutil: unable to find a device matching 0451:f432
My computer is not detecting the board. The output of lsusb is:
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 002: ID 8087:0020 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 003: ID 1210:25f4 DigiTech
Bus 002 Device 003: ID 04f3:0232 Elan Microelectronics Corp. Mouse
I get *no* information at dmesg while I plug in or disconnect the launchpad. Absolutely nothing.
The output of
lsmod | grep ti
confirms that the ti's usb driver module has not been loaded. So I manually loaded that one with
modprobe ti_usb_3410_5052
Now I see something in dmesg:
[ 1496.709197] usbcore: registered new interface driver usbserial
[ 1496.709227] USB Serial support registered for generic
[ 1496.709266] usbcore: registered new interface driver usbserial_generic
[ 1496.709273] usbserial: USB Serial Driver core
[ 1496.722267] USB Serial support registered for TI USB 3410 1 port adapter
[ 1496.722313] USB Serial support registered for TI USB 5052 2 port adapter
[ 1496.722733] usbcore: registered new interface driver ti_usb_3410_5052
[ 1496.722741] ti_usb_3410_5052: v0.10:TI USB 3410/5052 Serial Driver
Now I plugged in the board again. But absolutely *no* change in the dmesg or lsusb output.
The board is a fresh one, and its working well - when I plug in into USB, I can see its demo program blinking those red and green leds.
Now, as mentioned in http://sourceforge.net/apps/mediawiki/mspgcc/index.php?title=Getting_Started_with_Debugging, I looked for the firmware file to copy, but the file ti_3410.fw doesnt exist anywhere in my /lib/firmware. But I do have a file ti_3410.fw.ihex in /usr/lib/mspdebug which obviously came with mspdebug.
What's wrong? What should I do to get the USB port detected? It might be irrelevant, but I can connect an Arduino board on the same port, and it works well.
Thanks in advance!