• 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!

Leaderboard


Popular Content

Showing most liked content since 03/30/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. 5 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
    Bummer is certainly an understatement. As to my local backups I run Macrium reflect pro (now V7 home edition). I have all of my code and eagle files on a 1TB 10k rpm hard drive. Macrium does a full backup every day around 02:00 to an internal 5TB drive, and then copies to my server's 24TB JOBD array. Finally, the source files get posted to my AWS account for "offsite" storage. My AWS account runs about $2.00/month. And the last upgrade for my 5 licenses for Macrium was about $150. Money well spent. All of the machines on my home network run daily backups. In general, I do a daily full system image for the boot drives, and then the data files are incremental folder/file backups. I generally keep 8 full backups of my system images, and for the data files, there's a full backup done weekly, and I keep four full backups + the incrementals for a month. FWIW, Macrium's Windows PE rescue disk saved my butt last week when the system files became corrupted due to a problem with my aging RAM. I was able to recover the system and get completely back up and running after a day's effort (about 200 reboots while playing with BIOS HD settings...)
  14. 2 likes
    This google search string: msp430 sd card library returns numerous useful code examples for msp devices. Further, there is this here on 43oh.
  15. 2 likes
    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.
  16. 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.
  17. 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.
  18. 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 }
  19. 1 like
    Use Code Composer Studio. It imports Energia projects and provides all the views one can imagine.
  20. 1 like
    Well, there's magical thinking... And then there's magic! While looking for a file I noticed my server had booted and was back online. Checked the logs and discovered the driver for my 8-drive 24TB JOBD external SATA enclosure had failed to load. This is a Highpoint Rocket Raid system. It's junk. Has been from the outset, but I purchased everything while relatively ignorant. And, as @yyrkoon has noted, enterprise hardware is mind-bendingly pricey. So, I use the system as not a backup, but as a secondary copy location for video, images and audio. Maybe after I win the lottery I can put a proper system in place.
  21. 1 like
    I am not a fan of RAID arrays either. I see them as pointless since the new drives are so big and fast compared to 15 years ago when RAID actually made a difference. It was all about transfer speeds and creating large amounts of disk space. If I really really really cared about backing up stuff then I would go and find an LTO tape drive and figure out how to use it. I have had both Western Digital and Seagate drives fail on me. The latest failure (this week) was a Seagate ST3000NC000 3GB. I believe the magnetic media is peeling off of the platters inside. I have tried to rescue it numerous times over this past week but nothing is helping it. I tried getting it to map out all of the bad sectors but there is just too many of them. I cannot get gparted (on linux) to make a new GPT but the disk refuses to co-operate. I tried getting warranty on it but it's over a year out of warranty so I'm screwed that way. I may go and harvest the magnets out of it. So, I checked out the BackBlaze hard disk failure data because they beat the snot out of commercial type hard drives. I wanted to see which drive had the lowest failure rates for them. The Western Digital 8TB drives had zero failures for them. So that's what I went and purchased yesterday. I am still not certain which backup/syncing process I am going to employ but I am leaning towards setting up a separate Linux box with the 8TB drive inside and install NextCloud on it and then sync against it with all of my clients. I am trying to go towards the least amount of effort with the greatest amount of success that works for Windows, Mac, and Linux clients. The Lazy Way can be The Most Efficient Way ;-)
  22. 1 like
    @yyrkoon I've thought about restoring my centos server - I took it out of service when I stopped writing my own websites; easier to use wordpress to manage blogs. Though, as you've noted, nothing is immune from some type of corruption, including my own thought processes...
  23. 1 like
    Interesting coincidence: My Windows R2 2008 server won't boot this morning - according to the diagnostics - bad driver due to recent update... This machine is set up with a failover shadow boot drive, and of course there are a month's worth (if I remember correctly) of system images. However, I'm REALLY BUSY right now. So, I'll limp along without fixing it today, maybe Sunday, or not... Who has time for this junk. Sigh Superstition ON Talking about backup strategies triggered this failure... Superstition OFF
  24. 1 like
    Wow! My head is spinning trying to understand your description of your backup processes. It's cool though. It looks well thought out. My challenge is trying to come up with a process that will work on windows, mac, and Linux simultaneously. I am reading about AWS S3 services. It's bewildering because of all the options available. It would be cool if there was an application that could run on windows, mac, and linux that would orchestrate the backup process.
  25. 1 like
    Yep. I've been though a couple of cycles of boot and data drive upgrades. I love being a kindred spirit! My primary workstation is an i7 x980 with 24GB ram and 7 hard drives (21TB total storage). I built this machine to do viideo and photo editing. Even at 6+ years old, it will render an hour of 1080p HD video in just under an hour. Everytime I think about upgrading, I find myself looking at Xeon processors and about 4 - 6 grand to get any significant improvement in performance. Since I really only do the video for non-commercial stuff, it's not worth the extra cost. So, since the system is responsive, meets my current needs, I don't get too caught-up in getting the latest and greatest - though I am wanting one of the Wacom Cintiq HD tablets. Maybe for Christmas??? Off topic: I've found that having multiple monitors and running two instances of CCS or IAR an interesting and productive way to debug comms between a pair of '430 devices.
  26. 1 like
    A while back I damaged two pins on this board and dutifully marked it on the back. Unfortunately it was only visible from the back. Some time later I picked it up and was trying to use it unsuccessfully. After tearing my hair out for a while I eventually turned it over and noticed the markings. Now it is marked front and back.
  27. 1 like
    BTW, there is SD card open source example for MSP430F5529 inside TI USB stack (http://www.ti.com/tool/msp430usbdevpack). It is possible to plug MSP430F5529 by USB to PC and device will be enumerated as disk, with log file on it, that can be opened by notepad.
  28. 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?
  29. 1 like
    Please see the work-around for this in this thread: http://forum.43oh.com/topic/9848-energia-1610r18-windows-7-launchpad-msp430g2553-dont-load-sketch/?p=74156
  30. 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.
  31. 1 like
    So unfortunately, don't expect others to do your homework. Instead, they may provide you pointers. See Netiquette for Newbies.
  32. 1 like
    Which OS? On macOS, see under ~/Library/Energia15.
  33. 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.
  34. 1 like
    Sorry arrived Vilo. I've disabled it for now.
  35. 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.
  36. 1 like
    I meant to respond to your post here in more detail concerning "Event driven". So, I'll usually mix up OO with event driven when talking about event driven. Which I do not think that event driven is necessarily a part of what makes a language Object Oriented. But I can not remember using an Object Oriented language that did not have some form of events. VB.NET, C#, and Javascript are all languages I've personally had hands on with using events. In the context of C++, using events is very similar to you'd do the same thing in C. Which is to say, for me, this does not feel very much like an event at all. Just a function that is occasionally called when some condition is met. With other languages higher level than C++, such as those I've already mentioned, The message pump loop is all abstracted away, and for me this totally feels like an event. Weird huh ? Using interrupts though, again feels very naturally event driven to me. But on some very low level, I'm sure there is something similar to a "hardware message pump", or at minimum some sort of conditional checks that fire the interrupts off. I won't pretend to know the hardware on that level however. Knowing just enough to know how to use an interrupt is good enough for me. I also do not really know the low level gory details of how these events work, but I'm fairly confident that there is some form "wrapper" or interface code, that's really running a message pump loop. Similar to how you'd see in C, or C++. Now days with C++, there may even be something in the STL, but I do not know for sure. I try to keep myself busy programming, instead of spending all my days keeping up with the C++ STL. Which is one reason why I'll try to avoid C++ most of the time. I do not feel like I have enough time to keep up with the language 100%, and still do what I need to get done programmatically. The other part of that equation, is that unless I really know something in full detail, I'm not exactly happy about using that thing. This does not mean I think I know everything about C. This means, I think I'm proficient enough with C, that if I am unfamiliar with a concept, or language feature. It will not take me long to brush up on the subject - Usually. So here is my take on the whole C++ class ISR thing. It's too complex. Complex code is more likely to be buggy, or have mistakes in it. If in contrast you feel more comfortable using C, for ISR handlers. Then by all means just write the code in C, and use C++ elsewhere where it makes more sense for you. Do keep in mind, I understand the *need* to do things differently in order to learn something, or possibly start thinking about that given thing differently. Complex code is also more likely to be slower. Unless your compiler is very good at optimizing things out. Which C++ compilers seem to be working "magic" in this area in the last several years. But this is yet more information you need to overfill that full glass of a brain we have already . . .
  37. 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.
  38. 1 like
    If the device is a commercial part, it's published. If it's your own design, the '430 peripheral code examples will be your guide. Basically, you set up the I2C handler for the slave to respond to its transmitted address. FWIW, the hand-coded examples in Davies' MSP430 Microcontroller Basics(there's a pdf version - google "msp430 microcontroller basics") book on the '430 give a reasonable explanation. If you're designing something to be incorporated with other I2C devices, then you need to pick an address or addresses that aren't in conflict with other devices. I don't know if there's a "registry" for I2C device addresses.... The example code for TI and Davies all use 0x48 and 0x90; for the addresses.
  39. 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,
  40. 1 like
    I couldn't agree more with the points you make regarding C, C++, complexity and remembering which planet you're standing on... While I've been designing, reflow soldering and developing on custom PCBs, I've been using the inexpensive launchpads to develop much of my initial code; so similar to your approach with TDD, I'm building separate test modules for each of my I2C sensors (often evm boards as well) where I can run code and devices without risk of unexpected or unintended electronic interactions between different elements. Once I have a functioning and tested module, that gets added to the custom board, populated with all the devices, to confirm everbody gets along, which doesn't always happen - in particular the I2C pullups are definitely different on my custom board - pull harder - than my test rigs. I assume this is due to the bus capacitance for a multi-device system and circuitry. (I've spent time reading, digesting and struggling with TI's SLVA689 to sort this out, but ultimately it's been experimentation...)
  41. 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.
  42. 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.
  43. 1 like
    I used the 1294 Tiva as an example. I mentioned this in the post above.
  44. 1 like
    Quick calculation: Max system clock TivaC-1294: 120Mhz PWM divisors: /2,/4,/8,/16,/32,/64 PWM bits: 16 Min PWM frequency @120Mhz: Slowest PWM clock : 120/64 = 1.875Mhz Max PWM load value = 65535(16-bit) Minimum PWM frequency = 65536/1875000 = 0.02495 seconds Inverse : 1/0.023495 = 28.6Hz. Max PWM frequency @120Mhz: Fastest PWM clock : 120Mhz Min PWM load value = 2 - so that you can add 1 to the load value to get 50% duty. Maximum PWM frequency = 2/120000000 = 1.67e-8 seconds Inverse : 1/1.67e-8 = 60MHz.
  45. 1 like
    Check whether any interference occurs with the BoosterPack Checker.
  46. 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)
  47. 1 like
    @Dortal, As @Clavier noted, you should be able to fire the solenoid directly from the MSP430G2553, which would eliminate the likely significant communication latency the USB scenario you described would introduce. There are timer examples for the MSP that are analagous to your experiment which should not be too difficult to adapt. Re: USB support - You would need to use one of F5529 launchpads, which have native USB support (not as a as a controller, just as a USB device). There is a USB Developer's library via MSPWare with code examples. Bob
  48. 1 like
    @yyrkoon, This is a schematic of a typical programming setup. It doesn't matter what MSP430 that you use because they all can be wired up like this. To program this unit, I connect another G2 LaunchPad to this circuit using a four wire cable between P1 of this circuit and either J3 or J4 of the G2 LaunchPad board. Then program the circuit as if you were programming the G2 LaunchPad.
  49. 1 like
    I forgot to mention that the MCU has an internal temp sensor that you could potentially use as part of your design. Mux resistance is listed at 1K (page 32 of the datasheet). If your source impedance gets too high then you run the risk of more noise. If you find your A/D results bouncing around significantly then you may need to drop from 100K to perhaps 50k or less.
  50. 1 like
    Good news! This issue is fixed in the TI Emulators 6.0.228.0 package, which contains the version 2.3.0.1 firmware for XDS110. TI have added support for 2-wire cJTAG debugging, which only uses the TMS and TCK lines. In the 2.3.0.1 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.