• Announcements

    • bluehash

      Forum Upgrade   03/11/2017

      Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. Please see details and report issues in this thread. Thanks!


Popular Content

Showing most liked content since 03/24/2017 in all areas

  1. 8 likes
    Thanks @Rei Vilo. To all, the award goes to you too. Thanks for being wonderful members.
  2. 7 likes
    This project was put on hold over the holidays. It's always a busy time, plus the club doesn't hold meets over summer. But I have just completed another 10 units. More of the same, but thought you guys might enjoy some more photos. I couldn't get the same batteries as the last batch, which were 650mAh, these have much smaller 220mAh. But this still provides about 4 hours of run time. The uBlox GPS modules are a huge improvement. Even without the SAW filter in the RF path and the sub-optimal PCB size compared to the antenna. These find more GPS satellites faster than the G.top modules, plus they also use glonass which doubles the visible satellites.
  3. 7 likes
  4. 5 likes
    The example msp430fr5994x_lpm4-5_02.c is supposed to show how little current is used in this mode. In the file it says: // MSP430FR5x9x Demo - Entering and waking up from LPM4.5 via P1.3 interrupt // with SVS disabled // // Description: Download and run the program. When entered LPM4.5, no LEDs // should be on. Use a multimeter to measure current on JP1 and // compare to the datasheet. When a positive voltage is applied // to P1.3 the device should wake up from LPM4.5. This will enable // the LFXT oscillator and blink the LED (on P1.0). Even for a high-end multimeter this current is too low to be accurately measured. So I helped myself this way: - power the processor from the supercap - a 10k resistor with two antiparallel diodes act as a shunt, - connect the volt meter across the supercap, not across the processor 0.43mV over a 10k resistor gives 43 Nanoamps. (!) Yes, the datasheet (page 32) is right, typical value at 25°C is 45nA. A CR2032 (200mAh) cell would allow the processor to wait for an interrupt for 530 years.
  5. 4 likes
    My compact Lisp interpreter, uLisp, now supports the MSP430F5529 and MSP430FR5969 LaunchPads. As well as supporting a core set of Lisp functions, uLisp includes Arduino/Energia extensions, making it ideal as a control language for the MSP430. For more information see http://www.ulisp.com/.
  6. 4 likes
    Hello Everyone, Thanks for being patient while the forums were being fixed and upgraded. One Friday morning(March 10th, 2017), the server went down. There was a memory issue, which stalled the SQL server and everything came to halt. it had been fixed by Friday night, but then went down again due to a mistake I made during the bringup. In the mean time, I also decided to try to upgrade the server(php and peripheral updates) as well as the forum software. I'm going to see how things plan out in the next couple of days. Any issues you see with the site, please reply to this thread. Thanks!
  7. 4 likes
    Late into this thread, and I haven't read it top to bottom, but there seems to be a slight conceptual gap developing regarding what C & C++ really are. They are languages, not environments. The C language was originally designed for telephone exchange testing & control. Subsequently, it was used to implement the early UNIX kernels. There is a "C Standard Library", which is distinct from the language proper - this is where printf etc. come from. The story is similar with C++ - the language is distinct from its support libraries, e.g. stdlib, STL, and the various boost libraries. A huge amount of apocrypha and mis-information surrounds these languages and the pros and cons of their various implementations - most of the arguments are bogus and ill-informed. The truth is, IMHO, far more boring - that they each have pluses and minuses. The main differences are that C++ is geared to a more object-orientated design methodology, and generally, the mindsets used are different, which is why some feel that teaching people C, then C++ is a bad plan. When mis-used, C++ can be memory-hungry, which is one some decry its use for embedded work - I feel that this is a fallacy - C++ is absolutely fine for embedded work (I use it all the time), if you understand the consequences of your actions - C++ is a far more powerful & capable language than C, but with great power comes great responsibility (*) - blaming the language for your poor understanding of the consequences of your actions is not an excuse. C++ is easy to abuse, C can be plain dangerous... An analogy I like to use is the difference between "mathematicians" and "people who do mathematics". A mathematician has an intuitive grasp of numbers and mathematics - they can visualize the problem they are working on and come up with novel ways of solving it; further, when presented with a left-field/previously unseen problem, they will see ways of dealing with and solving that. Someone who does maths, OTOH, knows how to follow rules and can solve problems that are related to problems that they have encountered before, but may have real issues dealing with a novel puzzle.. Same with programmers. There's a world of people who can do C or C++ and have used the support libraries - that does not make them good or even half-decent programmers. In my career, I have found very very few genuinely good programmers - people who understand architectural issues, who can see solutions, who can visualise novel approaches and solutions, who understand and then, very importantly, can implement with excellence - it's the difference between a programmer (rare beast), and journeymen who know how to program (common as anything).. Note: I was involved in the ANSI C process and have been an editor or cited as a contributor to various C++ related books, including Scott Meyers' "Effective STL" etc Spent 30 years in the City of London and elsewhere as a CTO, designing, developing and implementing some of the world's largest real-time equity, derivative & FX exchange trading systems, mostly in C & C++. (*) Attributed to Ben Parker, Peter Parker's uncle...
  8. 4 likes
    This is my approach to state machines. Your mileage may vary. Determine all of the sub-systems that you will want to service Commands, Controls and Inputs, User Interface, and Data Setup a system tick timer that fires its interrupt on a regular consistent basis. This system doesn't have to go into LPM4. If it does then periodically wake up the system and cycle through the software service loops then go back to sleep. Setup a series of service flags that are set during the interrupt service routine and cleared after being serviced: Flag(s) for Commands, Flag(s) for Controls and Inputs, Flag(s) for User Interface, and Flag(s) for Data Setup a variable that acts like the system timer odometer. Every Odometer == (DesiredInterval%ServiceFlag_n_now) set the ServiceFlag_n Decide how often you will service the other functional blocks of your code. For example, Update the 2x20 LCD display every one second, or Update the Serial Console every 250ms, or Retrieve the Temperature from a sensor every 15 minutes. Setup an Interrupt Service Routine to catch any characters coming into the Serial Port Buffer. Stuff them into the Input Ring Buffer Set a flag that there's something to service. In the main loop, scan all of the service flags to see if any are set. Call the servicing function for each set flag. Clear the service flag at the end of that process. Configure the program to repeat continuously until Kingdom Come. I've left out significant details about setting up all of the peripherals and general variables so don't forget to do that stuff. This is just the basic gist of my state machines on a bare metal level.
  9. 3 likes
    "if (bar[0]==NULL)" won't look at the pointer value, but instead the memory the pointer references, so that is right out, unless you want to know if the parameter is an empty string (only the null terminator) "if (bar == NULL)" should work, in particular if you explicitly pass NULL in since you are comparing a value to itself, as should "if (!bar)", since NULL should be 0. I just checked both (using gcc on a windoze machine) and they work as expected, so I can offer no insight as to why you would have a problem. I would suspect that you are seeing a symptom of some other issue than pointer comparison.
  10. 3 likes
    A good bench is at the top of the list. I have an industrial assembly bench as my primary space with a work area of 1500mm by 700mm. It came with outlets mounted in the shelf faces, the front of the work area, and the back f the work area, but I ended up adding several more duplexes (4, for a total of 8 more) as well as a few 2A USB sources and an IEC320 strip (I scored a bunch of 600mm IECmale to female cords at Eli Heffron's back in the late '80s. They still come in handy) Power is key, and not just for electronics work, These power the scope, logic ananyzer, several meters, computer, monitors, power supplies, and several projects. The bench has a lighted magnifier-on-a-stick which gets a LOT of use (I have about a half dozen mounted around the shop and the office. I am getting old and have had several eye injuries) as well as the optivisor and a bunch of loupes. My go-to style loupe is the jewelers style (black conical with a single lens) of 2.5 to 5X. The 5X and 10X Bauch and Lomb that clips onto my glasses gets a lot of use, as well. One good one costs as much as several cheapies, but the cheap ones are useless due to distortion. Go good with glass lenses. I also keep several powers of cheater reading glasses around as well as safety glasses with cheaters. A stereo microscope gets a lot of use. High power isn't the key for electronics. It lets you work in a more comfortable position and focus without strain. I would love a Mantis, but can't justify the cost, so I have a 7.5 to 75X Nikon that spends most of the time at the 7.5X end. It also gets used for machinist work (I made a mount for the lathe and for the mill), and for measurement and for photography. If you can find one (craigslist is your best friend) an arm mount beats a base any day. It isn't too hard to make a mount, but it is nice to have it come with one. My monitors are mounted to the back rail of the bench. Dual monitors (if I upgrade the machine, I'll go for three next time) of good size are a requirement to maximize workflow and reduce eyestrain from focal changes. It doesn't seem like it should matter, but it does. A lot. They also get use with the microscope camera for a lot of things when I prefer not to be staring down the eyepieces. A decent workholding vise is nice. I made several for specific purposes, including board-holding. If I was to name the MOST important thing, it is light. A lot of glare free light. I have about 5000lm/m^2 at the bench, from multiple directions, most diffuse sources, and have about another 10000lm available task lighting (fixed fluorescent and lamps on movable arms). About 20% of this os LED floods, to give some shadowing and contrast, the rest being quite uniform from flourescent.. I use high color rendering index lights (90+) daylight (6500k) mostly. I have a few fixtures in the shop with warm (4500K) so it doesn't feel so clinical, but hte key is a LOT of light. Magnification comes right with this. As I also use the space for woodwork and machining, I also have a bunch of vises for these tasks. A decent drill press vise can serve a lot of masters. The one I get the most use from is an ancient, swap meet, palmgren 2-1/2" angle vise. Second is a dirt cheap ($2?) yard sale job with 1" and 1-1/2" jaws that rotates (no brand.... just "Japan"). The jaws on that needed a little dress with a file, and the vacuum holddown went to the trash, but it works a treat for everything from holding a probe in place to holding a micrometer suspended in mineral spirits during rebuild. I never had mch use for a panavise or equivalent, though I have had several, as they never seem to be rigid enough or be able to get to the position I need them in.
  11. 3 likes
    The G2553 chip itself does not have USB support. You can go through the LaunchPad's "application"/"backchannel" UART; you firmware then just needs to write/read the UART. You also need an application on the host PC to read from one COM port and write to another. But why use USB? Why can't you control the solenoid directly from the LaunchPad?
  12. 3 likes
    Hi, I needed a way to see how much of my C++ stack was being consumed in my MSP application - the traditional way is to "poison" the stack with a known pattern, and then to see how much of it gets burnt away. So I wrote the following - hope folk find it useful: The following code allows you to simply do this and to check at any point how much of the pre-allocated stack was consumed during peak usage, i.e. how close your app got to the bottom of the stack, or indeed, whether it over-ran. The TI CCS documentation is completely wrong in the names it gives for the global symbols that define the size and start of the stack - needs to be updated, Stick this code (or similar) wherever you want to report on/check stack usage <smallest number of byes left free on the stack since initialisation>/<configured size of the stack>. #if defined(STACK_CHECK) std::printf( "Stack: %d/%d\n", stackMinFreeCount(), stackMaxSize() ); #endif and then, in your main code you need to poison the stack as early as possible and then define the reporting routines: // Define STACK_CHECK to include stack usage diagnostics #define STACK_CHECK #if defined(STACK_CHECK) #define STACK_INIT 0xBEEF // Pattern to use to initially poison the stack extern uint16_t _stack; // Start of stack (low address) uint16_t stackMinFreeCount(void); uint16_t stackMaxSize(void); #endif #if defined(__cplusplus) extern "C" { #endif #if defined(__TI_COMPILER_VERSION__) || \ defined(__GNUC__) int _system_pre_init( void ) #elif defined(__IAR_SYSTEMS_ICC__) int __low_level_init( void ) #endif { //... stuff... #if defined(STACK_CHECK) // // Poison the stack, word by word, with a defined pattern // // Note that _system_pre_init is the earliest that we can // do this and that it may not be possible in TI-RTOS // // When we call the __get_SP_register intrinsic (same on IAR & CCS), it will return the address // of the RET address for the caller of this routine. Make sure that we don't trash it!! // register uint16_t *stack = &_stack; // Address of lowest address in .stack section register uint16_t *stack_top = reinterpret_cast<uint16_t *>(__get_SP_register()); do { *stack++ = STACK_INIT; // Poison stack addresses } while (stack < stack_top); // Stop before top of stack to leave RET address #endif return 1; } #if defined(__cplusplus) } #endif #if defined(STACK_CHECK) /** * Check how deep the stack usage has been * * \return \c uint16_t Minimum number of bytes to bottom of stack */ extern uint16_t __STACK_END; // End of data extern uint16_t __STACK_SIZE; // Linker-set size of stack uint16_t stackMinFreeCount(void) { const uint16_t *stack = &_stack; uint16_t freeCount = 0; while (*stack == STACK_INIT && stack++ <= &__STACK_END) { freeCount++; } return freeCount << 1; } /** * Return size of C++ stack * * Set by the linker --stack_size option * * \return \c uint16_t Configued maximum size of the stack in bytes */ uint16_t stackMaxSize(void) { return static_cast<uint16_t>( _symval(&__STACK_SIZE) ); } #endif int main(void) { ... stuff #if defined(STACK_CHECK) std::printf( "Stack: %d/%d\n", stackMinFreeCount(), stackMaxSize() ); #endif ...stuff }
  13. 2 likes
    Yeah, first off. Avoid anything from Harbor freight if you hate spending good money after bad. Their parts boxes with clear plastic drawers where you have say 4-5 across, and 8 high( or whatever ) are garbage. My buddy bought like ten of these, and less than a year later the drawers, and boxes started disintegrating. All of their other stuff is garbage too. Search youtube for "harbor freight", and get the gist. As for the one thing I personally find "most desirable". That would be more work space. Our place has lots of work space, but not where I spend most of my time. In my own area, I'm constantly struggling to keep space clear for development boards, prototypes, etc as I develop software and test the hardware. I even built a 4'x8'( full sheet plywood ) workbench, that is a bit higher than waist high to make it easy to work on things while standing. Off of one corner, I have a one of the 4x4 legs built up with stacked 2x6's( screwed together ) to accommodate a custom built, by me, swing arm for my laptop Pretty much, I was given the base for this, and I welded together galvanized pipe, and angle iron as the post mount, and then 3 other pieces of pipe for the laptop base to swivel on. Anyway, I did not really plan all of this from the start, so it does not work out the way I had hoped. So I think the best possible thing you could probably do is draw up several plans, until you're happy with something for making the best possible use of your space. Then gives you what you want. Also, at first thought, it may make sense to keep your electronic design space separate from your software development space. Which make total sense to me too. However, if we're talking about constantly moving between the garage and an in house room. That could present its self as a problem. So it may make better sense to *somehow* do all this inside your room, and keep the garage for other things like . . . I don't know project box fabrication, etc, if you're into that sort of thing. As for a good place to find related tools ? I find amazon a good place to start looking sometimes, but may not necessarily purchase form amazon. Or sometimes I'll just google, find something, then check to see if amazon has comparable prices. But I also am an Amazom Prime member, So I usually get free shipping on everything. So maybe, consider buying some cabinets to hang on the wall above your work benches, so all you have to do is stand up to grab something that may not always need to be on the bench. Then have your benches shallow enough to be able to do that. Maybe 2-3 feet from the wall out. This way, you could potentially span a whole wall with one long bench, then have storage above in easily accessible cabinets. Or you could do a whole room like this is you wish, Which we've done here. Several rooms actually. As for monitors, do you really need more than one ? I know, I prefer at least dual monitors too for documentation, and editor type situations, but you may only need one. But if you need a single, double or even triple stand, Amazon has a wide variety of stands. Also keep in mind that some 4K monitors can be partitioned into 4 separate 1080p screen areas. So basically giving the possibility to have 4 screens displayed on 1. If something like that would work for you. With all that said, I think the most important thing you could do is start thinking about what you need, and want. Then start drawing up plans until you're happy with what you've come up with.
  14. 2 likes
    I finally figured it out. The special signalling pattern didn't work because DTR is inverted coming out of BSLDEMO2. So that was never going to work. But entering BSL cold start from an application gave errors because I used the +u switch in the command line. It looked like that was the correct thing to do since I was indeed bypassing the signalling pattern, but for reasons I don't understand, when you use that switch the program doesn't send the password on all commands, in particular the ones I was trying to test with (read and verify). But of course the G2553 was expecting a password for these commands, so I got an error. I've recompiled BSLDEMO2.exe from the source code provided by TI, but with the polarity of DTR reversed. So it should all work now. I've asked TI to publish a new version of BSLDEMO2 with DTR polarity the right way for use with the USB-to-serial adapters, but I doubt they will do that. This is all "deprecated", so I doubt they will be willing to spend any effort or money fixing it.
  15. 2 likes
    Hallo I am using this code for my 430G2553. /* LaunchPad EEPROM Author : Henk Siewert File : EEPROMTest Date : 27 september 2016 Version : 003 MCU : TI MSP430G2553 Memory : Microchip Language : Energia C++ Compiler : Energia 0101E0017 Systeem : Windows XP Pro SP3 Editor : NotePad++ WWW : http://www.swtcomp.com Pin 6 IC = SCL --> 9 LET OP! Nieuw in 17 Pin 5 IC = SDA --> 10 LET OP! Nieuw in 17 Pin 8 IC = VCC --> Vcc (3.3V) Pin 4 en 7 IC = GND --> GND 4,7K Pull up on pin 5 and 6 !!! Let op - Is jumper geplaatst? */ #include <Wire.h> // I2C library int disk1 = 0x50; // Address of EEPROM chip // 50 for Microchip 1,2,3 GND // 57 for Atmel 1,2,3 open #define memmax 32768 // Maximum memory: // 32768 for Microchip 24LC256 // 65536 for Microchip 24LC512 // 131072 for Microchip 24LC1026 // 4096 for Atmel 24C32 byte value = 133; // Value to write to EEPROM void setup(void) { Serial.begin(9600); // Start serial Wire.begin(); // Start I2C start(); // Start program } void start() { test(); } void test() // Write and read data to memory locations { for ( unsigned long address = 0; address < memmax; address++) { writeEEPROM(disk1, address, value); Serial.print( address ); Serial.print(" = "); Serial.print(readEEPROM(disk1, address)); Serial.println(" "); } } void writeEEPROM(int deviceaddress, unsigned long eeaddress, byte data ) { Wire.beginTransmission(deviceaddress); Wire.write((int)(eeaddress >> 8)); // MSB Wire.write((int)(eeaddress & 0xFF)); // LSB Wire.write(data); Wire.endTransmission(); delay(5); // Writing takes time } byte readEEPROM(int deviceaddress, unsigned long eeaddress ) { byte rdata; Wire.beginTransmission(deviceaddress); Wire.write((int)(eeaddress >> 8)); // MSB Wire.write((int)(eeaddress & 0xFF)); // LSB Wire.endTransmission(); Wire.requestFrom(deviceaddress,1); if (Wire.available()) rdata = Wire.read(); return rdata; } void loop() { // Not used }
  16. 2 likes
    Thanks for the ideas. Energia uses the WDT for other purposes, as such I didn't put it in my code. However, I just stuck it in and that doesn't help. I did try getting rid of the MAP_ stuff and that didn't help either. I also noticed that the example defined the returned crc value as volatile, so I changed that, but it didn't help either. I missed the 1-clock cycle note. As such, I changed my 1 microsecond delay to a 1 cycle delay and the code works fine. I'm guessing that must be the issue.
  17. 2 likes
    SUCCESS ! using Mods as above plus twi.c and twi.sw.c from this link :- http://e2e.ti.com/support/development_tools/code_composer_studio/f/81/p/529036/1924562#1924562 plus adding :- Wire.setModule (0) before Wire.begin() in Void Setup() in both Master and Slave :- I have managed to send two characters from the Master to turn off the Red Led in a loop on the Slave. BIG Thanks again to B@TTO. Wouldn't it be perhaps a good idea if these files were updated and placed in the Energia GitHub Repository ? How is this process carried out ?
  18. 1 like
    It'll be a steep learning curve figuring it out. But once learned it's really awesome. Actually, I've known of it for years, and have used it a few times, and still do not know everything about it There's guides online though. As for Linux, use a systemd timer to fire off once a day or whatever, that calls a script to run your rsync's. If not using systemd, then use a cronjob once or so a day to fire off that same previously mentioned script.
  19. 1 like
    It was a bit of a mind bender for me at first but then I just read the I2C spec and it did not specify that the communication *had* to be at 100kHz. The way I choose to understand things is that the I2C slave device has a communication state machine inside of it. All I have to do is put in one bit and turn the crank once. Then repeat. Over and over. Then the slave device will just do its job merrily.
  20. 1 like
    Which platform ? Windows ? Linux ? OSX ? But rsync is a pretty good way if you use the correct strategy. This can be done on Windows too using the rsync application Deltacopy. Which runs services, and will automatically sync your watched directory, to the backup location.
  21. 1 like
    I'm talking about both, actually. The DS28EA00 has two GPIO lines. Using 1Wire protocol, I turned them on and off in a way that looked like very slow I2C to the pressure transducer that was attached to those two GPIO lines. Essentially, using the 1Wire protocol, I spoke I2C to a slave device. Does that make sense?
  22. 1 like
    Problem resolved. Deleted the Tiva board from the board manager and re-loaded it. Works great now. An extremely useful controller that I have successfully used in many different projects.
  23. 1 like
    So unfortunately, don't expect others to do your homework. Instead, they may provide you pointers. See Netiquette for Newbies.
  24. 1 like
    Hi @wanliban Datasheet numbers are hard (impossible?) to hit, especially when the signal comes from a real world target rather than a piece of lab equipment. But you should definitely be able to achieve better than -70 dBm. First thing: What does -70 dBm mean in your setup? The level at which you are able to receive any valid messages? Level at which you receive 50% of all messages? 80%? Real world targets or controlled signal from an RF generator? You can find my radio_config file and software on GitHub: https://github.com/astuder/dAISy Hardware wise, keeping noise out is very important. A bandpass filter in front of the radio helps a lot. Also make sure to minimize the self-inflicted noise by having continuous ground planes in the RF section and keeping the radio away from noisy circuits (like USB). If testing with real-world signals, make sure to use a proper VHF antenna (i.e. not a short rubber duck) and keep the antenna away from other electronics (e.g. monitors or LED and fluorescent light fixtures). Also follow Silabs' procedures for RX LNA matching (AN643) and layout recommendations (AN414) I hope this helps.
  25. 1 like
    Sorry arrived Vilo. I've disabled it for now.
  26. 1 like
    Try modulo. result = random_number % 10;
  27. 1 like
    There is a dedicated channel on ADC with VCC/2. You have to select 2,5v analog ref and select internal channel : analogRead(128 + 11) (if I remember well) 128 + X force energia to select the specific hardware channel X on analog multiplexer without mapping.
  28. 1 like
    @NurseBob Uh, yeah, no offense, I think I'll look for a different source. To understand I2C better. From what I've seen in that book, the guy is setting up datatypes( enums, etc ) and additional code inside an interrupt handler ? Yeah, that's not usually a good sign . . hehehe Yeah, never mind, it seems I was mistaken.
  29. 1 like
    So the idea with our hardware is that we're going to have X amount of jumpers to represent X amount of addresses. So without knowing much about I2C in general, I figure I take the binary form of these jumpers combined, and use that to represent a device address. Which seems obvious to me, an I2C slave implementer newb. So ok, great I'll check out that read, and see if it starts to make sense to me then. From what you're saying though, it sounds like I just pull the first X amount of bits ( excluding start bits, etc ) from a transmission, and see if the comm traffic is meant for the device or not?
  30. 1 like
    I've actually used javascript to write test code, which was later ported to C for a beaglebone, and once for a Launchpad. You have to write your own hardware simulators to test, but those do not usually have to be very complex. Since for me, I do not design the hardware, I just have to understand how it's to be used. For my I2C slave project, it's a bit different since the slave device will initially be connected to a Beaglebone for testing. But in this respect, the Beaglebone uses file descriptors ioctl(), and Linux API calls such as SMBus_*, but all of the hardware abstraction is already taken care of by Linux. On the MSP430 I2C salve side though . . . I'll need to understand it all. I had a few capes made for the beaglebone, which I have attached to a beaglebone as we speak, I am just waiting for the other half to be finished, In short though, we're experimenting with differential I2C. Which I do not want to get into too much detail at this time, but it'll allow us to do all kinds of cool things. Eventually, we'll be open sourcing the hardware, and selling capes + addons. I'll be providing software for the devices, in binary form, but may not open source the software. Or may only open source the beaglebone / Linux side, I do have my reasons, which are in no way related to greed, and everything to do with responsibility of modified code that could potentially be dangerous,
  31. 1 like
    Well, I don't find any real conflict between OO and event-driven systems; the events just need to be incorporated into the design. I guess I think of hardware events as a variant of messaging. My '430 code tends to have a setup in main that ends in a "forever" while loop structured around an LPM3 statement. Hardware events set state flags and the loop figures out how to handle the event, then goes back to sleep. I know from a '430 standpoint that's pretty much a standard design, but the "fun" has been in figuring out how to code for the ISRs, which live in a C subroutine and then chain back to a C++ class handler. The main concern and complexity for my limited brain is the design of a "generic" I2C ISR to handle the I2C communication for each of my I2C device classes. In essence the design for each I2C device is class-based, but dependent on the one I2C ISR, which uses a state variable and switch/case construct contain the handling of each I2C device's needs. I'll be soon finding out if the overall design is sound as I incorporate the remaining I2C sensors and devices.
  32. 1 like
    I'm actually quite the opposite when it comes to object oriented versus procedural. I prefer the procedural model more often then not. However, I do like the Object Oriented "event driven" model of Javascript very much. I suppose I just like event driven models in general. However, on some level, you have an event loop( message pump if you prefer ) that is really procedural at the core. With embedded Linux, I tend to stick as much as possible to a procedural model, but on a bare metal platform, such as the MSP430's, I do like using hardware interrupts as much as possible, Which is pretty much event driven, at least when thinking from a high level.
  33. 1 like
    @nickds1 Yes, one language is procedural, while the other is object oriented in nature. You'll possibly hear a lot from the crowd that thinks procedural versus object oriented is not something you classify a language with. But is instead a style of coding. I can see good points from both sides of that "argument". But I do think that some languages are better suited for one thing or another - Of course I do not think anyone here was arguing that C or C++ is better for embedded systems. Any programmer with any amount of experience knows there are many languages to choose from, and that every programmer may potentially know, or be familiar with several. We ( experienced programmers ) also probably have a language that we're most proficient with. In my own case, that would be C. So when people start talking about C versus C++ strings, like I did here. I may not know every_single_detail, but I am familiar enough with both languages to know which conceptually is better suited for strings. By "conceptually" I mean if you're aware of a potential issue, and how to solve that same issue. Is that issue really an issue at all ? Subjective I say, but in my own opinion. No it's not a problem. For me. Does that mean that I think one language or another has no place in the programmers world ? No, not necessarily. I think even "BF" has a use, if for nothing else. To help people think differently. I've always said, at least for the last 15 or so years( I've been "coding" since the mid 90's ) that every language has it's use. Also that every programmer is going to have a favorite language, that they'll try to use first. Whenever possible. So in this context, when I say I do not like something, about any language other than C. That's because I have far more experience in C, than most language. Do I think C++ is garbage. No, not by a long shot. I do think it is odd that a more "RAD" style language would actually take more lines of code when compared to C. To do a given thing. I also think C++ is far more complex as a language. Which in turn could present its self as a problem to a programmer who knows exactly what to expect from another language. In my case, C. Usually, when I'm thinking Object Oriented, C++ is not a the top of my own list. Golang actually is looking far more suitable now days. But it too has it's own pluses, and minuses. EDIT: By the way, I do think Kate Gregory has many good points on the subject of "Stop teaching C" as well. From my own perspective, learning C first, then attempting to learn C++ after. Early on, I did not even know the difference between the two language. To me, C++ was "just another" C, with newer features. I even had a few mentors from IRC trying to explain to me the differences. Here, for me, I think the biggest difference from then, until now is - Experience. But I do agree with Kate, and I suppose you too, That we do not need to know C, to use C++. In fact, it may even be beneficial to teach C++ first, or even only.
  34. 1 like
    You can hack your gel script: $ diff tm4c1294ncpdt.gel rk1294ncpdt.gel 127a128,132 > OnRestart() > { > GEL_AdvancedReset("System Reset", 1); > } > $ pwd /home/kimballr/ti/ccsv7/ccs_base/emulation/gel
  35. 1 like
    @jithin97 Sorry for the confusion. There are two BoosterPacks with sensors: the Sensor Hub BoosterPack (yours, left), and the Sensors BoosterPack (mine, right). The library I've mentioned refers to the latter. For the former, please consider: Adafruit TMP006 Library Adafruit BMP085/BMP180 Library SHT21 Arduino Library (here or there)
  36. 1 like
    See https://github.com/rei-vilo/SensorsWeather_Library
  37. 1 like
    OK, I think I get it now. I new the rom_map.h header selected the hardware or software version, but I really didn't look into what it was doing. I was assuming it determined whether or not my rom could support it. Turns out, one must include the rom header before the rom_map header. If I do that (or replace MAP_ with ROM_), I don't need any delays to get it to work correctly....So I think Clavier is spot on. The flip side is that the rom version is significantly slower than the software versions. So I guess the price one is paying for a reduced code size, is speed? I guess I get that. 9/10 bytes 66 bytes pyCrc 13us 13us driverlib software Crc 11us 27us rom Crc 16us 74us
  38. 1 like
    I wonder if there's some aggressive compiler optimization going on. The compiler wouldn't know what's happening inside the ROM functions and may put function calls out of order. Maybe worth a try to see if it works with straight calls to the driver lib (i.e. dropping the MAP_ prefix). PS: The reference manual says, that CRC result is available after 1 clock cycle. Also no mention of CRC issues in the errata.
  39. 1 like
    I highly doubt that this is an HW issue, though it's possible.... lets start with the code... Is the Watchdog timer still running? You've not stopped it (though I don't use Energia and don't know if it's stopped by default).. The code you provided is a bit messy, but is essentially the same as in the driverlib manual, and looks OK, except the WDT is on. As this seems to be a timing-sensitive issue, I'd start by stopping the WDT.
  40. 1 like
    FWIW, I did figure out why my RTC clock accuracy was so bad. By default, the RTC clock sources the internal 32k crystal, not the external LFXT as BCLK. As such, to get it to work: 1) Define frequency of LFXT to 32k: MAP_CS_setExternalClockSourceFrequency(32768, 48000000); // LF, HF (why energia doesn't do this already, I don't know. I see how starting it might consume power unnecessarily, but why not set the value atleast???) This step might not be needed, but since I wanted to query my clock speeds later, I added it. 2) Turn on LFXT (I loop on this since it doesn't always take): bool status = MAP_CS_startLFXTWithTimeout(CS_LFXT_DRIVE3, 10); 3) Tell the RTC to use LFXT: MAP_CS_initClockSignal(CS_BCLK,CS_LFXTCLK_SELECT,CS_CLOCK_DIVIDER_1); With my msp432 launchpad, this gives me about 5ppm (testing every 15s for about 2 weeks). Hope this helps anyone else who might have had issues... jrd PS Of course, you probably don't need to use the MAP_ versions...but I figured why not PPS This is how I was getting my actual clock speeds...ie, why I added step 1. // Get the values uint32_t aclk = MAP_CS_getACLK(); uint32_t mclk = MAP_CS_getMCLK(); uint32_t smclk = MAP_CS_getSMCLK(); uint32_t hsmclk = MAP_CS_getHSMCLK(); uint32_t bclk = MAP_CS_getBCLK();
  41. 1 like
    If you use the 2553 on your own PCB you will want to replicate the reset circuit (capacitor and resistor) that the Launchpad uses. Otherwise the MCU won't run. On the temperature sensor(s) I was envisioning using something like an LM34 or LM35 placed near the area in the PC enclosure you are interested in keeping cool. If this is done then when the PC is idling along the fans should run slower and when you are pushing it the fans will run at near maximum speeds. I would guess that you have some free four pin power plugs (with 5V) in the chassis. If you add a 3.3V linear regulator to your PCB to drop the 5V then it would resolve your power issue without splicing.
  42. 1 like
    First of all, welcome to the forum! In terms of pin usage you will want to pay attention to pins already used by the Launchpad (e.g.switches and LEDs) to avoid conflicts. With regard to the fan speed control, why not use temp sensor(s) in lieu of the potentiometers fed into the A./D converter? Perhaps just one, or possibly two, would be enough to adequately control the speed of all four fans. Just a thought....
  43. 1 like
    @yyrkoon, One place you might explore is under the "code examples" sections for the G2553. In particular, I'd start with: msp430g2xx3_uscib0_i2c_04.c ( USCI_B0 I2C Master RX single bytes from MSP430 Slave ) msp430g2xx3_uscib0_i2c_05.c ( USCI_B0 I2C Slave TX single bytes to MSP430 Master ) and msp430g2xx3_uscib0_i2c_06.c ( USCI_B0 I2C Master TX single bytes to MSP430 Slave ) msp430g2xx3_uscib0_i2c_07.c ( USCI_B0 I2C Slave RX single bytes from MSP430 Master ) As the examples note, you need the external pullup resistors. These examples will compile under CCS, IAR and GCC and while simplistic, they are a starting point for seeing the I2C comm in the debugger. I've used similar examples for the F2013 and F5529 to get those ICs to talk to each other, and subsequently to write code for the F5529 to talk to an sx1509 port expander (an adventure in reading and understanding docs...). FWIW, I would never have gotten very far without using both my logic analyzer and my oscilloscope... As to the jtag header and spy-by-wire headers (how I build all of my prototypes) - make sure there's the 47k resistor for the reset line (most devices do not need the capacitor placed), and you may want to account for using an external supply instead of the FET. The debuggers generally are limited in their supply capacity to ~50-60 mA. If your circuit is driving other devices, that can lead to failure for the debugger to even start. HTH Bob
  44. 1 like
    See boards.txt, platform.txt and programmers.txt. Exact location on the hard-disk depends on the OS you use.
  45. 1 like
    I'll update my status. I downloaded Energia again with no change. However I was successful when I tried a different USB port. Looks like I can get going now!
  46. 1 like
    well, I had the same trouble. it was fixed by the following lines: sudo apt-get install libc6:i386 libx11-6:i386 libasound2:i386 libatk1.0-0:i386 libcairo2:i386 libcups2:i386 libdbus-glib-1-2:i386 libgconf-2-4:i386 libgdk-pixbuf2.0-0:i386 libgtk-3-0:i386 libice6:i386 libncurses5:i386 libsm6:i386 liborbit2:i386 libudev1:i386 libusb-0.1-4:i386 libstdc++6:i386 libxt6:i386 libxtst6:i386 libgnomeui-0:i386 libusb-1.0-0-dev:i386 libcanberra-gtk-module:i386 and sudo ln -s /lib/i386-linux-gnu/libudev.so.1 /lib/libudev.so.0 As the previous response, it ws related to the Code Composer Studio Installation, those lines are taken from http://mostlyanalog.blogspot.mx/2014/09/msp430arm-development-on-linux.html
  47. 1 like
    Are you using Energia? If yes, then there is indeed a delay. This is due to the startup code figuring out what clock source to use for low power modes. Details can be found in enableXtal() in wiring.c. Robert
  48. 1 like
    Good news! This issue is fixed in the TI Emulators package, which contains the version firmware for XDS110. TI have added support for 2-wire cJTAG debugging, which only uses the TMS and TCK lines. In the firmware they also stopped the emulator from driving TDO, which was blocking access to the SPI. It looks like 2-wire cJTAG is the default mode now too, so debugging SPI flash code should just work like you'd expect.
  49. 1 like
    It looks like the author also made a tool to use EnergyTrace without needing to install CCS, might be worth a look: https://github.com/carrotIndustries/energytrace-util
  50. 1 like
    What you could do is build Energia from source. You can then change the upload command in https://github.com/energia/Energia/blob/master/app/src/processing/app/debug/MSP430Uploader.java.