Leaderboard


Popular Content

Showing most liked content since 12/28/2015 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
    Although all the LaunchPads feature a programmer-debugger, sometimes an external one might be useful. Segger has just launched the J-Link EDU Mini, with all the software and expertise of Segger, priced at just USD18! I'm very happy with the larger Segger J-Link Edu priced at USD60. I've ordered one J-Link EDU Mini and plan to review it.
  5. 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.
  6. 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/.
  7. 4 likes
    Hi, I'm working in this library with some useful DSP and math functions (ideally focusing on embedded systems). Currently it's in the initial version with few functions, but I hope to add more in the next update. I prefered to use some structs to save parameters and use just one function to various instances of filters (very versatile). Functions - High Pass Filter (Single pole): Float, fixed and fixed extended version (with more bits to fractional part) - Low Pass Filter (Single Pole): Float, fixed, fixed extended and fixed fast (with some limitations related to cuttof frequency, but more efficienty. - RMS value: calculate RMS value of an array or sample by sample. Currently using square root function of math.h, but in the next update I will add a optimized version. I hope this can be useful. Feel free to test, share and contribute with this project. Github: https://github.com/agaelema/DSP_and_Math
  8. 4 likes
    After joining this forum over 3 years ago I thought it overdue that I say hello and contribute something that I hope you will find useful. Attached is a picture of simple booster packs that I make. But are they really a "booster pack"? Hmmm. Debatable! They are cheap and easy to make and I have made 5 of them. I use them all the time because the whole of each project, including the MSP430, is attached to the booster pack. This means I can switch between projects without re-wiring, I can change the model of MSP430 in seconds and I only need one Launchpad. You can see from the picture that I provide two sets of header pins to attach "stuff" to, but provide four header pins for the 3.3V and GND. I also use long-leaded header plugs, partly because I have to solder the strip boards "upside down" (notice the small gap between the strip board and the header sockets) and also because the excess leads are easily accessible test points for things like logic analysers, etc. I keep the strip board to the smallest possible size so that all the Launchpad jumpers remain accessible. I've tried different designs, some with LEDs, switches, small breadboards and more besides, but this is the one I use all the time. I call it a "pop top" because you pop the top off a launchpad and swap it for another, then another. That's all for now. Hopefully it'll not be another 3 years before my next posting!
  9. 4 likes
    The delay() function is part of the official Arduino API. It is implemented with a busy loop, based on the CPU clock. The sleep() function is not part of the official Arduino API. It powers down the CPU, and measures time based on the VLO, which doesn't have a accurately specified frequency to begin with and has much higher temperature and voltage coefficients than other clock sources.
  10. 4 likes
    An output power display for my solar system. G2553 Launchpad, Blue 4-digit LED display, RS485 Transceiver SN65HVD12P (a low power, 3.3V version of the standard SN75176), this is all there is. All pins are used, 4 + 7 for the multiplexed LEDs (no resistors: Blue LED, 3.6V supply, output resistance of the pins limit the LED current) 3 pins for UART and send/receive for the SN65. 2 pins for 32768Hz xtal (I had this one soldered in on the LP, so why not use it) The MSP asks the inverter over RS485/Modbus "what is your current output power". After less than half a sec, the inverter aswers with the required value. This repeats every 2 seconds. The inverter is a Fronius Symo, with Datamanager 2 (which I guess is an embedded linux machine, covering LAN, Wifi, Modbus.....). The communication protocol can be downloaded from the Fronius website (after signing in), so no reverse engineering was required. Instead of only power, I could also display line voltage, frequency, total delivered energy.... This is just a working prototype on Launchpad, I will do a PCB later, I also plan to power this directly from the inverter (which has a 12V solar powered output for such things). See the picture, almost 7.5kW :-)
  11. 4 likes
    I went to Sears yesterday to get my new lawn mower and I got a free gift, Kenmore Alfie Voice-Controlled Intelligent Shopper. The regular price of Alfie is $49, but they are now on sale for $25. However, if you are SYW member and you spend more than $25, you get one for free (expires 7/1/17!) BTW, I also found Alfie for $7.95 on Amazon (with free Prime shipping, even cheaper from other vendors.) What's the big deal about Alfie? Crack one open and you will find the following: CC3200R1 Single-Chip Wireless MCU (with W25Q32JV (32M-bit) serial Flash memory from Winbond and a chip antenna) TLV320AIC3100 Low-Power Audio Codec With Audio Processing and Mono Class-D Amplifier 3.7V 500mAh LiPo battery 12 WS2812B LEDs Other useful things are microphone, large speaker, 2 LEDs, 2 switches, and USB port In other words, IoT experimenter's treasure chest! Can't wait to hack that thing (there's what appears to be programming header on the board.)
  12. 4 likes
    Now here's a set of fancy booster packs! It's a fully integrated automotive radar. http://www.ti.com/lsds/ti/sensing-products/mmwave-sensors/awr/awr-tools-software.page#tools Those rectangles on the right with wiggly traces to the IC are the radar antenna. RF magic! The "CAUTION HOT SURFACE" warning label also promises excitement. Too bad they will cost $299 according to the press release. Posting in the ARM sub-forum as the radar IC features an R4F ARM core. Though the booster packs probably work with beefier MSP430 LaunchPads too. Edit: Here's the mmWave landing page. The AWR also has the non-automotive sibling IWR, including similar booster packs. http://www.ti.com/lsds/ti/sensing-products/mmwave-sensors/mmwave-overview.page
  13. 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!
  14. 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...
  15. 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.
  16. 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.
  17. 4 likes
    Came across this while browsing. MSP430 Analog Gauge Clock
  18. 3 likes
    Hi, The new MSP430FR2433 ValueLine Launchpad is with a promotional price. https://e2e.ti.com/blogs_/b/msp430blog/archive/2017/11/08/introductory-price-of-4-30-for-msp430fr2433-mcu-launchpad-kit?HQS=epd-mcu-msp-vline-fb-blog-LPdiscount-wwe&hootPostID=97a463d63a1e96cbf999f3c7a33c703e It seems to be a good replacement to the old ValueLine G2
  19. 3 likes
    Hi everyone, I updated the library adding some functions: - to easily generate sine waves in a array and iteratively - goertzel dft using array data or sample by sample (very interesting because not need an array) Enjoy it Github: https://github.com/agaelema/DSP_and_Math
  20. 3 likes
    Here's something new in the "I would like to play with that" category: A pico-projector in the form factor of a BeagleBone Black cape. At $99, the price isn't too bad either. http://www.ti.com/tool/dlpdlcr2000evm#0
  21. 3 likes
    Below is a guide to get up and running with Energia BLE / Evothings Evothings for controlling your LaunchPad over BLE with a custom app on your mobile device: I have put together an app that allows to control of the RGB LED and Buttons exposed in the BLEInputOutput Sketch running on the MSP432 LaunchPad. At this moment it only runs on an MSP432 LaunchPad. Other LaunchPad's have bot been tested. To run the APP and control the LaunchPad follow the instructions below. You might have to upgrade the BoosterPack’s firmware. The firmware on my BoosterPack was not the right one so yours might not be as well. If you have issues running the app, then refer to updating the BoosterPack section below. Below is a screenshot of the app that I put together using Evothings to control the BLEInputOutput Sketch running on iOS. Running the APP on your mobile device: 1: Seat the CC2650 BoosterPack on the MSP432 LaunchPad 2: You will need the latest BLE library for crucial updates and new example Sketches. Get it from: https://github.com/ti-simplelink/ble_energia 3: Put the BLE folder in your person Energia/libraries directory just as you would install any other library. 4: Run Energia and open the example BLE->BLEInputOutput Sketch. 5: Verify and upload the Sketch 4: On your phone, download the Evothings Viewer from the app store. There is one for iOS and Android. 5: Open the app and then in the “Enter connect key” enter http://energia.nu/ble/bleinputoutput/ 6: Click connect. 7: The Energia BLE app should now open in the viewer. 8: Click he start button and the status should change to “Status: Connected” 9: You can now change the RGB sliders and you should see the LED’s on the LP match 10: Pressing the buttons will change the text for each button from “released” to “pressed”. Upgrading the CC2650 BoosterPack: The firmware on your BoosterPack might not be the right one. If you are experiencing issues with running the app, you might have to upgrade the firmware on your CC2650 BoosterPack. We are working on making this cross platform and to accomplish for Energia users. For now Smart RF Flash Programmer 2 has to be used on a windows PC. 1: Download Smart RF Flash Programmer 2 2: Remove JTAG headers from MSP432 LP (TDI, TDO, TCK, TMS) 3: Remove the BoosterPack from the LaunchPad (you will need a RED MSP432 LaunchPad) 4: Attach 10 pin ARM ribbon cable (included in the BoosterPack box) to XDS110 header on the emulation side of the MSP432 LaunchPad. Attach other end to CC2650 BP. It is keyed so there is only one way to attach it. 5: Get the SNP images from this link: http://software-dl.ti.com/dsps/forms/self_cert_export.html?prod_no=ble_2_02_simple_np_setup.exe&ref_url=http://software-dl.ti.com/lprf/BLE-Simple-Network-Processor-Hex-Files 6: Once installed, find the image simple_np_cc2650bp_uart_pm_xsbl.hex 7: Plug the LP into your computer. 8: Launch Smart RF Flash Programmer 2. 9: The CC2650 should show up in the left pane titled “Connected Devices” 10: Right click the CC2650 and select connect. The status bar should say “Success!” when finished connecting. 11: On the “Main” tab, in the “Flash Image” field select single and then browse to the simple_np_cc2650bp_uart_pm_xsbl.hex image. 12: Still on the main tab, under the header “Actions” check “Erase”, “Program” and “Verify”. 13: Then click the Green Arrow image on the right bottom to program the image. 14: Remove the ribbon cable, replace the JTAG headers and reseat the BoosterPack. You are now good to go to run the Sketch/App.
  22. 3 likes
    Finally got around to coding a bootloader for this project. I'm posting version 0.1 here for reference. Lots of times people seem to have trouble with bootloaders (I put off writing one for ages) But this should show you can start simple, and optimise later. The code right now is very rough. But is written in a way that could allow updating of itself it the help of a bootstrap Application. ie: Load new application which when run loads a new bootloader. This bootloader isn't 100% fool proof, if a bad app is loaded that fails to perform as a USB MSC then the user cannot use the USB port to load a new firmware file. but the SD can always be removed and a file copied from a PC if required. Worst case a debugger is required (Which is how they run right now) Memory Map Here is the memory map I've adopted. The bootloader fits at the top of FLASH, the default reset vector always runs the bootloader. The bootloader uses petiet FatFS to read "firmware.bin" off an SD card. It checks the file integrity with a CRC16 integrated into the firmware.bin file on a PC after it was compiled (last word of file). If the file is valid it check the current apps CRC, if they match then app runs. (Application already loaded). If they do not match the Application flash is erased and the new app loaded. Running the Application When launching the app it's CRC is checked to ensure it has loaded correctly. (This shouldn't happen, but you never know...) The App's Interrupt vectors are copied to top of RAM, and SYSCTL.SYSRIVECT is set. The address at the apps reset vector (0xDFFC) is called. Application changes Due to the construction of this bootloader the app needs to have a few changes made, specifically to the linker script. Reduce FLASH boundaries to remove bootloader area Shift Interrupt Vectors to alternate location in flash. (the app doesn't need to know its vectors will be moved to RAM, they just need to be in a fixed location so the bootloader can do that) Remove top 128 bytes of RAM (This is where the new interrupt vectors go. but default this is where the stack is initialised. which will damage the interrupt vectors) Create .crc section (Ensure a fixed WORD is placed to hold our CRC value.) I set up a build setting to output a Binary file format which I run through a simple C program to compute and fill the CRC value. These are all run automatically when the app is built. Improvements Reduce code size (I have a feeling an SD bootloader could squeeze under 4kb, right now it's at ~6kb) Improve speed, I'm not using the DMA, which could be used to improve speed (Update takes ~10s) Utilise High memory (Right now I'm not enabling the use of high memory, the MSP430F5514 has 17kb in >0x10000 address range.) High memory could be utilised to hold the bootloader this would free up (~7.5kb ) that the Main app could use. gpsLoggerBootloader_0.1.zip
  23. 3 likes
    First off, welcome to the forum. A couple of ideas come to mind. The first is that you might want to consider controlling the power to the SD card with a free I/O line and a transistor, only powering it up when you need to write to it. The other idea is to store multiple samples in an array (which should survive going into low power mode and back) and write them to the SD card every hour or more. How many samples to store between writes to the SD card would depend on your confidence that you wouldn't lose power or have a reset condition before having a chance to move them to the card.
  24. 3 likes
    Receiver Prototype Working After some stop and start I am back on this project and making progress. Here is the latest iteration: The wearable IR receiver and WS2812 controller at bottom runs off of a single 2032 battery. With only one LED lit at a time it is capable of easily running for an hour since current is down in the 10-15 mA range. It also transmits and receives with high reliability at 10 meters with two IR LEDs as shown. The transmitter is battery driven at the moment. I have a large number of IR LEDs on order so as to build a transmitter with a larger array of LEDs. It uses 2400 Baud UART for transmission. The transmitter code was written with CCS and is done in software with two timers. One timer maintains 2400 baud. To transmit a 1 bit the second timer is turned on and outputs a 38 KHz square wave over the IR LEDs until time for the next bit. For a 0 bit nothing is transmitted. The LEDs are rated for 100 mA each continuous but are being driven here at about 70 mA each with a NPN transistor hidden behind the jumper wires on the breadboard. On the receiver side the IR receiver turns the transmission into input that can be directly input into the UART peripheral on the MSP430G2553. A single byte is used to select the color and display mode of the WS2812 LEDs. The driver for the WS2812s uses the SPI method which I have posted elsewhere. There are some areas for improvement in the receiver PCB which I will incorporate in the next board spin but everything is working. A feature of this approach is that the receiver uses Energia with no tricks and even works on an Arduino Uno without modification other than pin changes. For the transmitter, I am still thinking about how best to implement. One approach would be to continue using a microcontroller such as the MSP430F5529 I am currently using with a keypad and display. Something like this mock-up: Alternatively, I could use something like a Raspberry Pi 3 and use Python to give Bluetooth LE access control over a phone.
  25. 3 likes
    In the 37 years I've been writing code, I've only asked an admin to recover a file for me once. Turns out that file was on a disk that was being backed up by a SCSI tape drive that had been having problems and of course all the tapes were bad. However, it is always easier to write code the second time : )
  26. 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.
  27. 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.
  28. 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?
  29. 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 }
  30. 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.)
  31. 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
  32. 2 likes
    Sometimes it is easier to use a separate MSP430 LaunchPad with eZ-FET to flash the G2. I have a MSP430F5529 set up with jumpers to do this and use it on custom boards and the G2 LaunchPad alike. The emulator on the G2 LaunchPad is just flaky at times.
  33. 2 likes
    First of all, welcome to the forum. If I remember correctly, the software serial library isn't supported on the F5529, only on the lower end G2 parts without built in hardware serial. However, it shouldn't be needed as the 5529 has two hardware serial ports. The second serial port would be referred to as Serial1 (e.g. "Serial1.begin" as opposed to the first serial port "Serial.begin"). Refer to the pin outs on energia.nu for the correct pins for each port.
  34. 2 likes
    @Neckbone, You need to supply significantly more information before anyone can provide help. 1) Which MSP430 do you have? e.g. msp430g2553 or msp430f5529, etc. 2) Is it a launchpad device 3) What IDE are you using? (Energia? if so, what version) 4) Copy and paste the error message so it can be evaluated 5) Google is your friend when having problems with code, compilers, mcu, etc. Finally, only post each query/topic once. Bob
  35. 2 likes
    Hi, These after read this thread about how to use temperature calibration data, I tried to use TLV register to obtain the "real" voltage reference value and increase the ADC conversion by compensating the gain and offset. The test was performed in a Launchpad EXP430FR6989, but can be applied to other launchpads compatible with MSP430Ware driverlib. The increase in the accuracy is very interesting. in the table (sorry by the comma instead of point, brazilian notation). HP 3478A - value measured with DMM ADC_correct1 - value measured with MSP430 without any correction ADC_correct4 - with all corrections using float variables ADC_correct5 - using mainly integer Here there is an article about this test and the Github with the example. Regards
  36. 2 likes
    Thanks @Clavier for the explanation.To add to this. The VLO is only used if the startup code does not detect an external crystal to source ACLK from. @tapasxplore Note that the MSP430 max VCC is rated @ 3.6. Robert
  37. 2 likes
    I know this is an older post, but it struck a "pet peeve" nerve. I recently went back to school, I had to learn how to use a calculator because they were not allowed in math class when I was in high school, and was surprised at how often people did not bother to even copy things by hand. When we had peer reviews, or otherwise were able to see each other's code, there was always at least one that was a direct c&p of code that did not even work. Had they copied it by hand, and read it in the process, they would have realized that it did not work. Keep in mind, these are simple school problems that have numerous examples on the internet. I have also seen, many times, where the code seems to have been intentionally written wrong, but someone who actually reads it will be able to fix it easily. When I have problems with code, I am often reluctant to ask questions because I do not want someone to just write it for me. I appreciate answers that simply point me in the right direction. On the other hand, with electronics, I tend to look for a more definitive answer. This is usually something like what size cap should I use, because I am trying to copy something that did not give the value, and I am just trying to get it to work, without ordering "one of each" or frying something. Personally, I appreciate everyone who tries to help me.
  38. 2 likes
    Did you read the limitations of the Petit FS? ... Petit FatFs Limitations: Petitfs specifically uses as little flash and stack as possible. This, however, comes at the expense of some functionality. Files are not able be created or increased in size, and only one file can be accessed at a time. ... So if you create a zero length file (open a file in a text editor and save it without adding anything to it), it isn't going to do what you want. If you search the forum or google this is expressed in thousands of posts. The comment above comes from this document: http://www.atmel.com/Images/Atmel-42776-Using-the-Petit-FAT-File-System-Module-with-AVR_ApplicationNote_AVR42776.pdf http://elm-chan.org/fsw/ff/pf/write.html ... Description The write function has some restrictions listed below: Cannot create file. Only existing file can be written. Cannot expand file size. Cannot update time stamp of the file. Write operation can start/stop on the sector boundary only. Read-only attribute of the file cannot block write operation. File write operation must be done in following sequence. pf_lseek(ofs); read/write pointer must be moved to sector bundary prior to initiate the write operation, or it will be rounded-down to the sector boundary at first write operation. pf_write(buff, btw, &bw); Initiate write operation. Write first data to the file. pf_write(buff, btw, &bw); Write next data. Any other file function cannot be used while a write operation is in progress. pf_write(0, 0, &bw); Finalize the current write operation. If read/write pointer is not on the sector boundary, left bytes in the sector will be filled with zero. The read/write pointer in the file system object advances in number of bytes written. After the function succeeded, *bw should be checked to detect end of file. In case of *bw is less than btw, it means the read/write pointer reached end of file during the write operation. Once a write operation is initiated, it must be finalized properly, or the written data can be lost.
  39. 2 likes
    MISO should be connected with MISO, MOSI with MOSI, not crossed. MISO means Master In Slave Out, and MOSI means Master Out Slave In. Master & slave are always the same, no crossing is needed.
  40. 2 likes
    I2C interface for 4x4 keyboard with partial support for 2-key rollover and autorepeat. Based on a Texas Instruments MSP430G2553 processor, uses a GPIO pin for signalling keypress events to host. Example PCB is a KiCad project for the 20-pin DIP version MSP430G2553. https://github.com/terjeio/I2C-interface-for-4x4-keyboard I am using this to test jogging in my GRBL-port embedded in the CO2-laser controller firmware (for Tiva C) I am working on. I have left some code (#defined out) to show how 2-key rollover and autorepeat can be enabled for some keys. The hardware abstracted ARM GRBL-port and an example driver for the Tiva C LauncPad is also available on GitHub.
  41. 2 likes
    @NurseBob So you've show interest in this through another post. Instead of polluting that post, I figured I would respond here. Where to start. . . My idea here started because I work remotely for a company who builds systems based off the beaglebone. Soon, I plan on traveling, which is not a problem when you work remotely, but you may still need to bring hardware with you to write, and test software while you're on the go . . . I looked all over the place for reasonably priced aluminum enclosures. They really do not exist. Then it dawned on me that there are plenty of mini ITX cases on the market, why not look into that . . . My idea in a nutshell: 1 Mini ITX case 1 ODROID XU4 1 Beaglebone Random capes 1 1TB hard drive or larger 1 USB 3.0 to SATA adapter 1 5 port ethernet switch 1 10A 5v power supply to power everything miscellaneous M3 mounting hardware pre-cut aluminum for motherboard tray, PSU hole cover, I/O plate cover miscellaneous panel mount adapters. So, some of this is not completely thought out yet. For example, finding a network switch that is power via 5v input could prove to be hard, or impossible to find, Usually ethernet adapters use a 48v power supply. At least that's been my experience. I have not looked in earnest yet. Then, just having looked, I notice the USB adapter I bought takes 12v input . . . These I have already ordered and are on the way, or are already here: USB 3.0 -> SATA adapter: https://www.amazon.com/gp/product/B005B3VO24/ref=oh_aui_detailpage_o01_s01?ie=UTF8&psc=1 Mini ITX case:https://www.amazon.com/gp/product/B00F2RRE1E/ref=oh_aui_detailpage_o06_s00?ie=UTF8&psc=1 Miscelaneous M3 mounting hardware is already here, or on the way, the aluminum will probably be here tomorrow. Then I have no made up my mind on which hard drive ill buy, but I have a spare here now, and a Samsung 850 Pro SSD( I may use both ). 5 port switch, and power supply are up in the air. Then all the panel mount stuff will probably come from Adafruit. Not ordered yet. So, I've had the Xu4 for better than a month now. Maybe even two. But I have not powered it up yet, because I've had this idea rattling around in the back of my head for a few months . . . It should not be long before I start building this system. The purpose of this system when complete, is to serve as an ABI compatible development platform. Meaning the beaglebone and XU4 are, or can be made ABI compatible. Which means no need for a cross compiler, period. The XU4 will then take on compile duties, as well as acting as a support system for all beaglebone projects in the future. The entails code storage, as well as NFS, and Samba duties. So code can be accessed from any local network machine( OS agnostic ).
  42. 2 likes
    Hi, for the projects I need to access from multiple places (and needing some privacy) I've configured a small git server and put gogit/gogs *) on top of it. Because the core is git, I can use it from command line and gogit gives me the possibility to use it in a way similar to github and (the reason I use it) allows me to define "virtual users" - I can allow other people to access the private repositories without sharing my (main) credentials. I have luck with a good hosting offering all needed tools. Cheers, Liviu *) I suppose any "interface" will do the same, I've used gogs because I found a tutorial (in German) about the installation on my server.
  43. 2 likes
    I've figured out why I got confused: I'd been testing the same source file (uLisp Zero) on ATmega boards, under the Arduino IDE, and on MSP430 boards, under the Energia IDE. I have the Preferences set the same on both IDEs, in particular, Compiler warnings: All. On the Arduino IDE the source compiles fine with no errors or warnings. On Energia when you select a different board any source, even BareMinimum, compiles with about 60 warnings the first time you compile it, many of these trivial and relating to the core; for example: <command-line>:0:12: warning: missing whitespace after the macro name [enabled by default] Compiling the same source a second time seems to suppress these warnings, but my source file still gives some warnings related to "strict-aliasing rules", presumably due to differences between the C compilers on the two platforms. But it runs OK. I installed the Energia MSP432 boards by Energia" package from Boards Manager to try the same source on the MSP432P401R LaunchPad, and I think the reappearance of the warnings confused me, and I falsely attributed them to the newly installed package. I should have taken more care to figure out what was going on before posting on the forum, and thanks for your tolerance!
  44. 2 likes
    I hear you. I understand. You're right. I appreciate your honesty. Thanks for keeping it real.
  45. 2 likes
    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.
  46. 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.
  47. 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.
  48. 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 }
  49. 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 RCWL-0516 "doppler radar microwave motion sensor module" ** added 6/6/17 Vary time a LED stays lit with potentiometer ** added 7/8/17
  50. 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