Jump to content


  • Content count

  • Joined

  • Last visited

  • Days Won


Everything posted by NurseBob

  1. Nrf24l01 communication from MSP430 to Arduino

    Google is your friend... Try here, for example
  2. Nrf24l01 communication from MSP430 to Arduino

    >Also which of MOSI or MISO should be used for one direction communication ? MOSI = MASTER OUT SLAVE IN (frequently seen as SIMO) MISO = MASTER IN SLAVE OUT (again, often seen as SOMI)
  3. Setting up timers/ccr MSP430G2152

    > I'm assuming that the clock source is the internal low frequency oscillator More likely it's running off the main clock. The low frequency oscillator is not being called or set up, and is not the default. Also, in the ISR the cpu is running off the main clock - so the main or submain clock is more likely. I'm assuming you are compiling and running under CCS or IAR? In which case you can put a __no_operation() call in the ISR to see which clock is configured/enabled by inspecting the clock registers. You can also bring out all the various clocks to the designated port pins and put an oscilloscope to see who's running. Agreed, the manuals are not an easy resource for where you are. Howevr, there are numerous code examples (including TI's) on detecting switches and configuring as well as handling clock interrupts. Don't despair - there are lots of resources, all free, out there to let you dive into the code and figure it all out.
  4. Setting up timers/ccr MSP430G2152

    Hi @Cloudberry, Well, based on a quick review of the code it appears that the Port1_ISR (based on a button press) starts a timer, and then based on the Case statement, enters a wait state: while (!(P1IN & BIT1) && !(TA0CCTL0 & CCIFG)) until the timer interrupt is triggered. From an MSP430 programming style perspective, this is not a good coding practice for a few reasons. 1) ISRs should be as short as possible, since there may be other interrupts pending. So, get in, set a flag (often) get out and in the main routine evaluate and process flag states. 2) This is NOT a well designed interrupt-driven program with the incorporated wait states. 3) The ISR runs the CPU to execute its code, and is therefor a power draw - shortens battery life. 4) __delay_cycles is clock dependent, thus not a safe means of waiting for a defined time. You will need to read the docs regarding TA0 - There appears to be virtually no configuration of the timer, so what ever its defalts are??? It's running in Up mode and rolling over (probably at FFFF counts - and time to execute counts is dependent on the selected clock source, could be cpu - running at what?) to generate an interrupt. How long does that take? Without configuring the timer, good question... While it's not often popular advice, time to RTFM on timers and clocks for the SPECIFIC '430 you are using. HTH
  5. > No, 5529 is not 16-bit device. I stand corrected. Though there still no way to store a 64-bit value in a single register, as the OP seemed to desire. FWIW, When I look at TI's marketing for the device: "16-Bit Ultra-Low-Power Microcontroller"
  6. First I don't use a Mac, so I'm ignorant... But a quick Google of the term "MSpanList_Insert" seems to point to a Mac OS version or configuration related issue. I'm guessing it's not specific to the MSP430F5529 you're working with. Sorry I can't help more, but it looks like Google might be your friend here...
  7. The '5529 is a 16-bit device, with 16-bit registers, so it's not possible to use a single register to store a 64-bit value. Perhaps storing the address of the 64-bit value? But I don't see any real rationale for doing that... Others, far smarter than I, may offer better suggestions.
  8. Msp430 software serial error

    Use the hardware serial to communicate, not software serial. As dubnet noted, post your code.
  9. Problems with Energia on MSP430 LaunchPad

    > Has anyone found a solution? Maybe this will help??? https://github.com/energia/Energia/wiki/Common-error-messages
  10. Sd card interface with msp430

    For USB access you'll need to use CCS/IAR or similar and the TI MSPWare USB libraries for the communication (look in particular at the both HID and CDC protocols), and you will have to code the interface between the USB messaging protocol to transfer data between the PC and the MSP430<->SD card. I don't think there's an Energia-based way to use the USB connection, and to transfer data between USB and UART would require you writing that code as well.
  11. Energia Hybrid Code

    Rei, You are clearly demonstrating the benefits of a deeper level of knowledge, which allows you to pick your battles (so to speak), and focus on the production of both code and devices that are efficient not only when they run, but also during the development process. Thanks for sharing your insights. Bob
  12. Energia Hybrid Code

    BTW, I didn't intend to imply that OO design and coding require a less demanding level intrinsic/background knowledge. Having worked in that world, I KNOW it's easily as complex as medical fields.
  13. Energia Hybrid Code

    First, an in-depth answer to your request is above my pay grade. That said... Energia (Arduino) targets an audience of non-programmers, as you're well aware. Students have fundamentally different needs & requirements. Further, regarding OO, a couple of decades back I overheard this brief exchange between a junior and senior engineer: Question - I thought OO was supposed to make everything transparent? Answer - Transparent to the user, opaque to the programmer. OO is a complex world. So is Nursing, which is what I teach. There are parallels in that both require a substantial level of "background" information and understanding. In Nursing, it's a basis in biology, physiology, chemistry, biochemistry, pathophysiology, bacteriology, psychology, anatomy, and more. With OO, there are the basic concepts of "Is" and "Has," which have a "fractal" relationship to their final implementations, the deeper you go, the deeper you can go... I find one of the main challenges with OO design is figuring out where to stop diving down. So, how to accomplish your goal? getting students (I assume at the very early stages of entry level) on board with enough background and intrinsic knowledge so that they can start moving forward exploring the more creative aspects of software applications and implementations. I suspect that your choices are: 1) Write your own example code. Time consuming, to say the least. 2) Use the existing tools and code, which entail their own levels of complexity and obfuscation. For my own edification I have pursued the second route, followed by attempting the first as I try to implement what I THINK I may have learned. So, for example: 1) Start with an Energia implementation of Blink the LED. 2) Import the Energia project in to CCS, which will allow stepping through the code at varying levels of detail, first the loop(), then start looking at how the device is configured and the LED toggled. 3) Use the TI Blink example C code for the device to see a raw C implementation based on delay cycles. (This is also easily "ported" to an IAR kickstart version). 4) Look at an interrupt-based Blink application, introduces timers, ISRs and event-driven programming. (Either CCS or IAR). 5) For a not-really-OO implementation, use the driverlib from TI. I doubt the above accomplishes what you want, but an old adage applies here: If it was easy, anyone could do it... Best, Bob
  14. Energia Hybrid Code

    Agreed. I have no idea of the hundreds of hours I saved by using published code snippets in pursuit of both deadlines and laziness. Interesting that in virtually any other field the "copy/paste" approach could be plagiarism... Laziness vs real way vs driverlib/Energia: I often adopt "lazy" for initial prototyping - get it to work! Then run in a debugger to see what's happening "under the covers." That allows for some analysis regarding efficiency - e.g. battery life (most of my work is not timing dependent, so battery life matters most). I started coding on '430 devices using the TI code examples, and still lean towards the "real way" since it helps me see/understand what's happening, when and why. An Aside Re: TI code examples and Launchpad code - There seems to have been little communication between the various developers. When it come to comms, be it I2C, Serial, USB, working TI examples seem to ALWAYS use different pin/port combinations and ISR handlers. Once I realized that, I found that search/replace usually allowed porting code example to the launchpads. (FWIW - when it dawned on me that there are two I2C handlers on the F5529, I realized I could code a "loopback" version of their I2C Master/Slave examples in one source code file with a pair of patch wires and a pair of 10K resistors. Simplifies debugging test code... Next step, add interrupt-driven serial output to those simple I2C loopback routines for the times I don't want to use a logic analyze or scope.) Ok, I've digressed. I find Energia useful for simple proof-of-concept prototypes, and useful after importing to CCS for step-by-step debugging (Note to self: Don't forget to disable serial output when debugging!!!). I've mostly abandoned the driverlib approach; honestly, I find it way too obscure AND in most instances, it avoids lowpower modes, using "while true" loops which can play havoc with both power management as well as handling communication problems - the apps tend to hang in a forever loop... BTW - great link to the MOOC - something to explore in the coming months. I can always use more structure...
  15. MSP430F5529 USB HID Example for Energia

    I doubt you'll find any Energia USB-CDC examples. For a USB SDK look at the MSP430Ware for the tools you will need. In addition to sample code for a CDC device, there's a primitive Java app that will give you a place to start for MSP430F55xx -> PC communication via USB. I was able to convert one of the HID sample apps in conjunction with the supplied JAVA libs into a data capture app that interfaces at up to 1 KHz (on a good day, heading downhill with a tailwind). For my app, CDC was not an appropriate choice.
  16. Problems with Energia on MSP430 LaunchPad

    Keep it simple - just edit the <name> folder if that's the one with a space in it. Over the years I've learned to keep names as close as possible to the old DOS naming standards, as many developer tools are not always forgiving of long names, or other naming issues most of us have forgotten ever existed... Fixing the folder name would be far, far less complex than moving all of the Energia files, which would likely introduce other errors.
  17. warning system, 4-5 ultrasonic sensors

    you might find this article of use. It addresses setting and communicating with uart addresses for multi-sensor systems.
  18. Serial.print(float) statement can't be compiled

    My experience with C compilers says: Look at the first message; in general, all the other errors flow from that. Same for Java. > `.text' will not fit in region `rom' Indicates your program (and library calls) will not fit in the G2553. Since it won't fit, it doesn't upload.
  19. MSP430G2553 & HT16K33 Issues

    No. Both the 32KHz and 4MHz crystals are placed. Lots of very interesting things to do with that chip. For a small Physical therapy research team I've built a force sensor using a FSR that can capture and transmit data at 1KHz to a Java app running on a PC via USB 2.0. The Java app, in turn, writes the data to a csv file for later analysis and displays a line chart of each run at completion to verify the basic data captured. They're happy and I learned a bunch... Have fun.
  20. MSP430G2553 & HT16K33 Issues

    Yes, it will run C++/C code, your limitation is the load size of the program. Don't be too surprised if you run into errors trying to load Adafruit's, or anyone else's class libraries on the G2553. I've not really done much with that particular LP due to the memory and other constraints. FWIW, for under $15.00 you can pick up a F5529LP which won't have the memory limits, and has the option to do USB-based communication. It's a cheap, versatile device. Just a thought.
  21. MSP430G2553 & HT16K33 Issues

    If the G2553 has sufficient space to load the Adafruit code, I'd suggest starting there. I've found there's usually only a change to the header to account for the '430 vs. Arduino. I believe I've run their examples on F5529s with edits only to pin assignments. And, of course, your '430 comms with the device probably need to exactly match what the arduino sends for startup.
  22. Does Energia support JTAG?

    @Jazz All very good information. The path you suggest would be a good learning experience.
  23. MSP430G2553 & HT16K33 Issues

    I don't know which rigol scope you have, but mine can be put into I2C mode and will decode the messages much like a logic analyzer, which can be useful. In my limited I2C experience, missing ACKs and NAKs can be a problem, along with timing issues (though your '430 trace looks sharp). Does adafruit publish a sketch for talking to the display? I've used their code to run LCD touchscreens with a 'F5529. Of course, the G2553 may not have enough memory to load a C++ program...
  24. MSP430G2553 & HT16K33 Issues

    Have you done the same with the '430? It's worth taking a moment with a 'scope or logic analyzer to see what you're transmitting, if anything.
  25. Serial Port Problem

    @FredinMcKinney You've probably already done this, but since you didn't mention it... I've had the experience from time to time with the debugger and/or the serial port failing to connect, even while testing. One solution that has pretty consistently worked for me has been to close any application connected to the device (e.g. Energia or CCS) disconnect the device from the USB port, and if connected through a powered external USB port, to power down that entire device. Then, power the port, power the device and restart my app. Aside from that, I have nothing more to add... Bob