Jump to content

colotron

Members
  • Content Count

    14
  • Joined

  • Last visited

About colotron

  • Rank
    Member

Contact Methods

  • Website URL
    http://www.colotronics.blogspot.com

Profile Information

  • Gender
    Not Telling
  1. colotron

    MSP430G2553 multiple interrupts.

    I agree... not good to call function that is not specifically re-entrant, and moreover, uses a shared resource (serial port) from an ISR. The simplest way is to set some flag in ISR and check those in the main loop: volatile unsigned int intFlags; typedef enum { ISR1_FLAG = BIT 0, ISR2_FLAG = BIT1, //... and so on }; void isr1(void) { //..do something.. intFlags |= ISR1_FLAG; //:exit low power mode } void isr2(void) { //..do something.. intFlags |= ISR2_FLAG; //:exit low power mode } void main(void) { //.. while(1) { //...other code //:disable interrupts if (intFlags & ISR1_FLAG) { //handle isr1 intFlags &= ~ ISR1_FLAG; } if (intFlags & ISR2_FLAG) { //handle isr2 intFlags &= ~ ISR2_FLAG; } //check all other int flags //:enable interrupts. //The disable/enable interrupts could be done for each flag //(in case a handler takes time), but I choose not clutter //too much this simple example. } } What could happen if you do it as posted?, occasionally you will find in the serial console something like 568 600 605 59Push button 2 pressed 5 600
  2. colotron

    Program won't fit weirdness

    Some people prefer to read variable declarations right-to-left instead of left-to-right, thus: type const * const pointer; makes some sense. I don't like it, but they exist
  3. colotron

    PCB Laser Exposer/Printer

    Downloading... this could be the more precise way of doing PCBs in home. So how precise is the machine?, are you able to work with 0.5mm pitch packages? (8 thou/0.2mm tracks, 0.3mm pad's width) . Those pesky QFN accelerometers are a pain to do manually, and fine pitch microcontrollers too. I saw other people doing it with toner transfer, but my skills are not that good. Another advantage over toner transfer it's that it should be easier to etch and solder after, because less oxide is formed if no heat is used. Have you noted a better etching/soldering?. Congrats!!!
  4. colotron

    USB and low power

    Yup, you can only go to LPM0 with USB active. That's because the USB host (the computer) sends periodically package polling if the slave (msp430f5510) have something to read or to write. Then, you always need the capability to get polling packages from the host, and answer those (NAK if you don't have nothing to do, but still sending something). And to talk with the host you need the USB oscillator/clock working, so you can't shutdown the clock system further. See Programmers_Guide_MSP430_USB_API.pdf 11.1.6 Use of Low-Power Modes In your sleep/timing function of interest you should check out the usb state -for msp430 parts with usb module- using USB_getConnectionState(). I guess something like: //Add to your function of interest int sleepMode = LPM3_bits; ... #if THERE_IS_USB_MODULE if( ST_USB_DISCONNECTED != USB_getConnectionState() ) sleepMode = LPM0_bits; #endif .... //sleep //__bis_SR_register(LPM0_bits + GIE); //enable interrupts when sleeping __bis_SR_register(sleepMode + GIE); //enable interrupts when sleeping __no_operation();
  5. colotron

    Need help with UART

    Don't use delay_cycles inside the interrupt. Take that out and check if it works.
  6. Hi Lyon, are you talking about the eclipse plugins?: http://gnuarmeclipse.livius.net/blog/install/ gnuarmeclipse.livius.net/blog/plugins-install/ Yup, I'm guilty as charged, too minimalistic to start only to blink a led. I heard some problems to work with Eclipse Luna... anyway I will try later and update. Thanks for your input
  7. Hi guys, my first post in this forum. I just finished an installation guide for gcc-arm-embedded toolchain (arm-none-eabi) + lm4flash + openocd with tivaware libs in Ubuntu 14.04 amd64; and the eclipse setup needed to program/compile/debug the tiva Launchpad EK-TM4C123GXL. There are some parts in spanish, but all the commands and eclipse instructions are in english. Hope you find it useful, and if doesn't work please let me know (here or in my blog) to make the corrections needed . Cheers,
  8. colotron

    Use mspdebug to upgrade msp430fr5969

    Ok, I modified slightly the optional sentence Nice to know. I did a lot of things before arriving to a valid build of the whole toolchain, due more to my lack of knowledge than the process itself. Hopefully I can save somebody time and nerves
  9. colotron

    Building OutOfBox_EmulStorageKeyboard With mspgcc

    The __no_init problem is because TI compiler has it as a built-in clause that marks the variable to be in un-initialized RAM. To patch that you could edit the file USB_API/USB_Common/types.h and append below the section #ifdef __TI_COMPILER_VERSION__ something like #ifdef __MSP430__ #define __no_init #define __data16 #define __even_in_range(x,y) x #endif I know it's dirty and far from optimal. Defining __no_init as nothing does nothing to put it in un-initialized memory segment... but at the time it worked and never touched again. Don't know if __even_in_range is properly implemented in newer versions of mspgcc I believe that __MSP430__ symbol is defined automatically by using msp430-gcc, not quite sure about that. If it's not the case you will have to define the symbol when calling gcc: msp430-gcc -D__MSP430__ etc I do that in an old version of usb api, now I have downloaded the latest version, and I think you should be ok if you define the symbol __GNUC__ About the descriptors.h error, have you generated the USB_config files with the descriptor tool?. You should have those in a /USB_config folder inside your project
  10. colotron

    Use mspdebug to upgrade msp430fr5969

    It happens to me also, I have to do mspdebug tilib several times before a connection is established with the debugger. I don't know why, but doesn't represent a huge problem neither. This is a screenshot of the errors: After several of those the communication is established normally, without doing anything in between other than execute mspdebug tilib. In fact, the last message is a normal initialization, but I don't have any msp430 connected to the debugger, thats why error = 5. If the udev rules are defined you don't need to use su. The allow-fw-update thing is needed one time only, after the installation of TILIB on the PC. I will add the libusb-1.0.0 dependency, thanks for the observation
  11. colotron

    Simplest Standalone MSP430G2553 with USB-Serial?

    What about using an usb-to-serial cable and work with RS-232 like the old days?
  12. colotron

    Linux Toolchain for F5529

    Sorry for the self-promotion, I'm working on a mspgcc 4.7 toolchain installation guide on ubuntu 14.04 amd64, maybe it can help you: http://www.colotronics.blogspot.com.ar/2014/08/msp430-toolchain-in-ubuntu-1404-with.html
  13. colotron

    LaunchPad + CCSV5.2 + OpenSuSe 12.2

    Just for reference, I have the same error with make mspdebug 0.22 in Ubuntu 14.04: In file included from util/usbutil.c:22:0: util/usbutil.h:22:17: fatal error: usb.h: No such file or directory I've installed libusb-dev (which is not the same than libusb-1.0.0-dev!!!) and problem solved Cheers
  14. colotron

    MSP430 clock

    Take a look at the code examples provided for msp430g2452, they show the minimum configuration needed to make the peripherals work: http://www.ti.com/lit/zip/slac467 And also the wiki: http://processors.wiki.ti.com/index.php/MSP430G2_LaunchPad The readme file at "C" folder describes the examples. If you want to trigger interruptions using the 32768 crystal see msp430g2xx2_ta_04.c
×