• 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 04/23/2016 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
  3. 6 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.
  4. 4 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. 4 likes
    I have done both of these tasks for more than one client. The 1-Wire protocol speed ends up being about 15kHz, which is slow but reliable. It's really cool to see on an scope though. I developed the I2C slave code using the sample TI code as the starting point. Here are the research materials that I referred to while writing my I2C code: http://www.nxp.com/documents/application_note/AN10216.pdf http://www.nxp.com/documents/user_manual/UM10204.pdf http://i2c.info/i2c-bus-specification http://www.ti.com/lit/an/slva704/slva704.pdf My slave code just follows the logic of the transaction.
  10. 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.
  11. 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.
  12. 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?
  13. 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 }
  14. 3 likes
    Clavier's Short Guide to I²C Slaves on the MSP430x2xx Family Read section 17.3.4.1 of the User's Guide, and the example code. Slave mode is somewhat easier than master mode because you do not have to care about getting the transaction sequence correct; you just react to the master's requests. The slave address is an arbitrary but unique 7-bit number. Just put it into the I2COA ("own address") register; the USCI module will automatically handle transactions to this address. You do not need to configure a clock source; the clock signal is supplied by the master. When the master has written a byte, you get an RXIFG interrupt. Your interrupt handler must read that byte from RXBUF. (You can set the TXNACK bit after reading RXBUF, this will tell the master to stop after the following byte.) When the master wants to read a byte, you get a TXIFG interrupt. Your interrupt handler must write a byte to TXBUF. If your code is slow, the USCI module will automatically stop the bus via clock stretching until you have reacted. You can get notifications when start and stop conditions happen (STTIFG and STPIFG), but that is not always necessary. The I²C protocol itself defines only byte reads and writes. If you have registers, you have to handle the register address yourself. Typically, the first write after a start condition is the register address, and all following writes (and all reads) are from/to the specified register (and often the register address automatically increments). As a slave, you have no control over what the master does; you must react to any write and read requests at any time. (If you really have nothing to read, just send the last byte again, or some garbage byte.)
  15. 3 likes
    There is a new BeagleBone out in the field. This one is the "Blue", following the "Black" and "Green" ones. Expected retail price is $80. Feature list: Processor: Octavo Systems OSD3358 1GHz ARM® Cortex-A8 • 512MB DDR3 RAM • 4GB 8-bit on-board flash storage • 2×32-bit 200-MHz programmable real-time units (PRUs) • On-board flash programmed with Linux distribution Connectivity and sensors • Battery: 2-cell LiPo support with balancing, 6-16V charger input • Wireless: 802.11bgn, Bluetooth 4.1 and BLE • Motor control: 8 6V servo out, 4 DC motor out, 4 quad enc in • Sensors: 9 axis IMU, barometer • Connectivity: HighSpeed USB 2.0 client and host • Other easy connect interfaces: GPS, DSM2 radio, UARTs, SPI, I2C, analog, buttons, LEDs Software Compatibility • Debian, ROS, Ardupilot, • Graphical programming, Cloud9 IDE on Node.js
  16. 3 likes
    Came across this while browsing. MSP430 Analog Gauge Clock
  17. 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.
  18. 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.
  19. 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 }
  20. 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.
  21. 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 ?
  22. 2 likes
    I'm attaching a link to github with Energia code examples for various sensors. I started this as a place to put examples for students in a course I was helping to develop for middle and high school level students using the MSP430F5529. Unfortunately the course was not held but I'm putting them out there in the hope they might help someone. Where the code has been tested with other LaunchPads I've noted it. Here it is: https://github.com/fmilburn3?tab=repositories You won't find anything sophisticated but many are at least somewhat unique in that I couldn't find an example for that sensor tailored specifically for the F5529, or I wanted to better document it for beginners. Essentially all are variants of work done by others, including work on 43oh, and I hope I've recognized the contribution in the code. There is a wiki associated with some that has the schematic and photographs. There is some other example code that is almost complete - e.g. using small DC motors and servos and I might add them. Here is a list of sensors and devices currently out there: CNY70 - used as a proximity switch CNY70 - used as a tachometer MCP41010 - digital pot HC-SR04 - distance sensor 3 watt high intensity LED MAX4466 -sound level I2C LCD (4x20) and (2x16) HC-SR501 - PIR movement detection SW-180xxP - vibration sensor Joystick PFatFs - compiles and runs on the F5529 Hall effect rainfall sensor TMP36 - temperature Sharp GPf1S53VJ000F - photo interrupter Using low power modes (LPM) in Energia TCS3200 Color Sensor using MSP432 *** added 8/8/15 DS1307 Real Time Clock (RTC) Module *** added 8/9/15 INA125P Instrumentation Amplifier *** added 10/9/15 MCP3008 ADC *** added 10/12/15 TLC5615 DAC *** added 11/30/15 dAISy MarineTraffic shore station w/ CC3200 ** added 12/16/15 AD9850 Frequency Generator ** added 1/20/16 FFT ** added 1/20/16 Rotary encoder ** added 1/23/16 W5500 Ethernet ** added 3/25/16 MSP430G2955 pins_energia.h ** added 3/25/16 DriverLib examples for F5529 ** added 8/16 Infrared Transmission ** added 12/16 WS2812 LEDs using SPI ** added 12/16 Battery measurement ** added 1/17 Finite State Machine - alarm system ** added 2/6/17 Using RTC module with Energia - F5529 ** added 2/24/17
  23. 2 likes
    Best way is to open the related header file and search for getTouch(). Which example are you trying to compile? Does the main sketch include #include <LCD_screen.h> #include <LCD_screen_font.h> #include <LCD_utilities.h> #include <Terminal12e.h> #include <Terminal6e.h> #include <Terminal8e.h> This is an unpleasant requirement from Arduino / Energia: all the libraries need to be listed on the main sketch.
  24. 2 likes
    Here's some more C++ magic which seems applicable to embedded programming. I think he optimized for speed instead of space (using tons of mov instead of a loop to initialize sprite bitmaps). But a lot of impressive optimization by the compiler. On the downside, I didn't understand half the constructs he was using. I guess I need to relearn C++ via embedded.fm podcast
  25. 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
  26. 1 like
    Events: Such a range of sources. Hardware (internal and external), timers, user-generated, etc. As you alluded to, there's usually a heirarchy of priorities that impact how they are, or need to be, handled. I don't really have any internal association between event-driven and OO; one reflects how things happen, the other is merely one way to define a world view. The PC GUI world is certainly built around the event model and the understanding of the potentially random timing of events coupled with a management of event priority. My fading memory seems to recall that the original implementation of the Windows GUI several decades back was niether OO nor C++, but a loop which handled and/or generated messages. As to my own project, the ISRs are C. The name mangling of C++ led to problems. So, just as TI's C++ libraries do, I define the ISRs as extern C routines. I do spend some time looking at the order and frequency of the case statements in terms of execution, but my implementation spends very little time doing any communication with the sensors, and typically only in response to a sensor-generated interrupt (also rare events), otherwise the app is spending it's time sleeping. I agree, complex code is likely slower to execute. And almost never should reside in an ISR; aside from my TX RX event handlers, my ISRs follow the "set a flag or generate a software interrupt and return" rule. And as much as possible, even the TX RX handlers are setting flags for a main-based while loop to process then go back to sleep where communication timing is not an issue. My knowledge of the C language is probably barely adequate to the task, as well as is my knowledge of C++. However, experimentation is a basis for how my brain works and remembers. I've spent hours in the debugger stepping through both C and disassembled code; fixed problems, and sometimes have even remembered not to create the same problem again. Were it not for Google, code snippets, reference circuits, etc., my little project would have never gotten started, let alone to the point it's reached. Ok, now I'm rambling...
  27. 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?
  28. 1 like
    Sound very cool, and I assume, a fair amount of time spent deciphering Logic Analyzer and Oscilloscope traces. Were it not for those two pieces of equipment my aging brain would be on fire (oh, and the 60's rock on pandora helps keep me sane, too)... I have an email-friend in Australia who designs and develops for the '430 and only writes in assembler. Per his comments, it's theoretically possible to use only a blinking LED to figure this all out, but that's far beyond my ken...
  29. 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...)
  30. 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.
  31. 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.
  32. 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.
  33. 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....
  34. 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
  35. 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!
  36. 1 like
    Am I reading correctly that this is with the LM35 not connected to the input pin? In other words, there is nothing connected to the input pin? If this is the case, then the potential on the pin will float, generally to about half of the power supply, give or take (depends on the device) and, being configured as an input, it will have very high impedance, so it will pick up noise. You would be measuring more the properties of the multimeter and its interaction with the floating input than a real potential.
  37. 1 like
    Welcome to 43oh. lcd_send_string(enum2str(haltIn)); What is the "haltIn" type. Can you type type cast or initialize it to the enum. The below works for me. Try to use typedef, to avoid tping "enum IOChannel" everytime. typedef enum {V1 = 11, I1 = 101, V2 = 12, I2 = 102}IOchannel; char *enum2str(IOchannel enumVariable) { switch(enumVariable) { case V1: return "V1"; default: return "I1"; } } /** * Main program. */ int main(void) { IOchannel haltIn = V1; enum2str(haltIn); }
  38. 1 like
    @ykaradana I will upload an EAGLE library for the CC1310 here to help anyone who needs this in the future. Specifically, it is the 128RHB version, but obviously it will work with any of the RHB variations. Hope it helps you. Cameron CC1310F128RHB.lbr
  39. 1 like
    A few questions: What is your power supply? What was the temperature of the environment? The lm35 needs at least a 4V supply. Its output is 10mV/degree C, so at 20 degrees C, the output should be 200 mV.
  40. 1 like
    So in interest of full disclosure. I *will* be purchasing the two board I'm about to mention. Soon. The ODROID XU4: http://ameridroid.com/products/odroid-xu4 The ODROID C2 : http://ameridroid.com/products/odroid-c2 I've done a lot of reading over the last several months. In hopes of finding an embedded Linux SBC(ARM) that can be used as a desktop, as well as a work station for ARM board development. To come straight to the point. For that purpose, and in the same price range. Nothing comes close to the ODROID XU4. The things that "sinched" the deal for me was the quad A15's( quad A7's too ! ), the inclusion of USB 3.0, and true GbE networking( not shared with the USB buses ). A friend of mine has one and has demonstrated it for me a couple times. This thing is a beast ! Passed all that, one can run Android on this hardware, and I've been considering tinkering around with Android development as well, The ODROID C2 is very much like the Raspberry PI 3, but at a higher price point, and added performance / features. I think I paid $35 for my rPI including a power supply, and free shipping. That's a really good price for the hardware. The C2 on the other hand, like stated above has very similar hardware with a few key differences. First, for all intents and purposes they use the same processor type. An A53 quad core. However the C2 is clocked at 2Ghz. Secondly, the C2 has true GbE networking. Potentially very useful for many applications. Lastly, the C2 has twice the memory - 2G versus 1G. We actually have a project involved using a C2 in a professional capacity. No, this project is nothing like a NAS, SAN, or anything of that nature . . .Although it would perform that type of job very well I think. I am very anxious to get my hands on one. Very anxious to get my hands on an XU4 as well, but the XU4 will be more of a toy for a while. As well as handling any kernel, or debian package compiling I need done in the future. What boards are all you interested in ?
  41. 1 like
    Compared to the Raspberry Pi, The BeagleBone offers two PRUs for time-critical and deterministic tasks. However, developing against those PRUs isn't exactly easy. I went for alternatives. Very similar to the Arduino Yun, the Mediatek LinkIt Smart 7688 Duo features two cores: the processor MT7688AN runs on Linux for WiFi, and the ATmega32U4 micro-controller is compatible with Arduino. The Arduino Tian is an updated Arduino Yun with an Atheros AR9342 as CPU for WiFi (dual band WiFi), Ethernet (1000 Mbit/s Ethernet) and Bluetooth, and a Cortex-M0+ SAMD21G18 as MCU with 256 KB of Flash and 32 KB of RAM. The Intel Edison was very promising with a combined MPU + MCU + WiFi + BLE on a single SoC. Unfortunately, programming the MCU requires the reboot of the whole board MCU, and the MCU tick time is 10 ms. The SDK and API aren't mature yet but haven't been updated for a while. Dead project? Last and best choice, the UDOO Neo board combines a Cortex-A9 MPU with a Cortex-M4 MCU on the Freescale i.MX 6SoloX. The Cortex-M4 can be programmed on the fly. The board features Ethernet + WiFi + BLE.
  42. 1 like
    Sure, I get it. Like you, I guess I am just more used to using C most of the time, but I still like many aspects of C++, as well as other languages. It's kind of funny, I was watching a youtube video the other day before bed, and I forget the speakers name( He's pretty well known, I should remember his name, but I dont - I'm not a "fanboy" that way ), where he was explaining why C++ was what he considered the better choice for embedded software development. Then he showed a chart from the last 10-15 years. Which showed C graphing upwards, while C++ was trending downwards . . . Ah right, Dan Saks, but his contention is that C++ is better than C, and I completely disagree with that. I think every language has it's place, and for different people, that will skew one direction or another. But there is a reason why you will never, at least within the near future, see any C++ code in the Linux kernel.
  43. 1 like
    I don't try to convince anybody. I'm way too busy myself to unlearn bare metal C. But I thought the video will be relevant for people that venture down the rabbit hole.
  44. 1 like
    Yeah, pretty cool little board. I was offered a chance to get a "beta" board in exchange for developing open source software for this specific board. Unfortunately, I was hired full time just a week prior by a person whom was contracting some work out to me . . . So I was, and am still busy doing work for my "day job". I think one of the neatest things about this board, is the Octavo SoM. Which is pretty much an AM335x processor, with internal memory( no need to worry about getting DDR traces exactly right ), and from what I was told around 6 months ago from one of the team members of the SoM is that many of the processors "pins"( balls ) can be brought out and used. Where the beaglebone does have many I/O / peripheral options, but from memory, less than half of the pins are used( if memory serves correctly ).
  45. 1 like
    There is no connection from VBUS to any of the pins on the chip. What I would recommend is to tap ICDI_VBUS through a resistor divider to end up with 3.3V and then connect that to one of the pins. You might also be able to just directly connect ICDI_VBUS to the switching regulator control pin either through a resistor divider or directly if it is 5 Volt tolerant.
  46. 1 like
    Solved. I have included all the libraries. The problem was in calling the getTouch function. I declared x,y,z as variables of type unsigned short and called the getTouch with x,y,z as parameters. The compilation was successful and the getTouch returns true on touching the screen and fills in the x,y,z values.
  47. 1 like
    You might also explore the software for one of TI's older experimenter boards which had the ability to record and play back audio for both specs and firmware. Not energia-friendly, but still instructive.
  48. 1 like
    Ah. I went through the log and saw that I had added the site as an exception on one machine (one I generally use for such) in 2015. Tried accessing from the shop machine today. I am surprised I haven't noticed before, but, then again, the shop machine has all of three bookmarks in the browser, since it is generally used only for the shop gear.
  49. 1 like
    Hi @@osmanfish and welcome to 43oh, Irritating isn't it? It can be caused by several things. It can happen with the MSP430G2 and Energia if you are using serial print and close the serial monitor down while the sketch is printing. This does not seem to happen with other LaunchPads. Try unplugging the LaunchPad at the computer and then plug it back in. You may have to try uploading one or more times to get it working again. Also, avoid shutting down the serial window. Flash (upload) the target chip without shutting the serial monitor. If this does not seem to be your problem then google "Could not find MSP-FET430UIF on specified COM port (error = 57)" and you will find a number of other possible causes. Look on the TI e2e site.
  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.