Jump to content
43oh

enl

Members
  • Content Count

    346
  • Joined

  • Last visited

  • Days Won

    22

Reputation Activity

  1. Like
    enl got a reaction from bluehash in MMA8452Q / MSP-EXP430G2ET   
    To follow up with @Rei Vilo the actual errors are important here, as is the processor (though I would presume G2553 given where you put the question).  Also, the interface module you are trying to use (I2C I would hope, since the MMA8452Q only communicates with I2C), what header files you included, what processor you selected in CCS project setup, and so on.
     
  2. Like
    enl reacted to NurseBob in Program MSP430G2553 with a smaller memory version in compiler   
    Interesting.  My experience with both IAR and CCS is that they refuse to load images to a device when it's different than what the project specifies and they both clearly report it as an error.
  3. Like
    enl reacted to Rei Vilo in Best way change I2C freq to 400kHz   
    Please refer to Wire.cpp#L121-L123
    I2C_Params_init(&params); params.transferMode = I2C_MODE_BLOCKING; params.bitRate = I2C_400kHz;  
  4. Like
    enl got a reaction from NurseBob in Problems with Energia on MSP430 LaunchPad   
    As a general rule, you should never use file or directory names with spaces in them. They tend not to work well with many tools, and tend not to work well across platforms, and do not work at all with some environments/platforms. We have all seen the abomination that occurs when a URL contains a space, and some of us have seen environments where some superstar realizes that, on windows, a filename or directory name can consist of nothing but spaces. Have fun with that. It does not help that Windows does not handle paths consistently across contexts, and, though better than in the days of Win95, still does not handle capitalization in file/directory names consistently across all contexts.
  5. Like
    enl reacted to NurseBob in Problems with Energia on MSP430 LaunchPad   
    Keep it simple - just edit the <name> folder if that's the one with a space in it.  Over the years I've learned to keep names as close as possible to the old DOS naming standards, as many developer tools are not always forgiving of long names, or other naming issues most of us have forgotten ever existed...
    Fixing the folder name would be far, far less complex than moving all of the Energia files, which would likely introduce other errors.
  6. Like
    enl reacted to admirlk in Circuit Help   
    Hmm, After going through 300 or so magazines, I found one project using a LM3914, but it was unhelpful. In my web searches, that landed in a forum where this question was asked, someone always says there is an example in the datasheet, but no matter how many times I look I cannot find it. Or that examples are readily available, but that is close to an example as I can find, which is why I tried asking for myself. A couple times a circuit similar to the one I mentioned was mentioned, but only as far as a parts list. I did finally find one, in the datasheet, that had a switch, so I have an idea of how to do that part now. I am still not clear on how to do the hold though.
    The chip really has not been obsolete for that long, I think it was still readily available at the beginning of last year. I have never had a problem buying from China, other than waiting a month to get my order. As long as they work, it is not taking away from anyone, since the original manufacturer stopped making them. At 10 for < $5.00 shipped, I will have plenty of extras, if I ever need them also.
  7. Like
    enl got a reaction from Fmilburn in DS18B20 temperature interpretation   
    I am not sure what you are trying to ask, or what processor you are working with, but it appears that you don't have a good understanding of fixed point representations
     
    The value from the DS18B20 is a signed (2's complement) fixed point, 16 bit value. Cutting off the last four bits using a right shift that shifts zeros in to the left removes the sign. The shift can be done so as to preserve the sign by using the appropriate arithmetic right shift (arithmetic right shift RRA in assembler on the MSP430, or right shift operator in C on CSS).  This will give an integer in 16 bit 2's complement. The rounding will ALWAYS be the floor (truncate to smaller value; round down) operation.
    To get round towards zero, you can use a condition such as (in C):
    if (t<0) t+=16; t=t>>4; or
    t=t>>4; if (t<0) t++; to do the job.
     
    If you want 'conventional' (grammar school) rounding (round down for the fraction <1/2, up for fractions >=1/2), then
    t+=8; t=t>>4; would be the cannonical way.
    If you want symmetrical rounding such that if the fraction of |t| < 1/2 is toward zero, and if hte fraction of |t|>=1/2, round away from zero, then, again, the easiest way is a condition:
    if (t<0) {t+=7;} else {t+=8;} Really, you need to know the desired behaviour. There are a lot of reasons why the default action is desirable (always round to negative infinity), in particular because then each count represents a range of one degree, rather than the range for zero being two degrees.
  8. Like
    enl got a reaction from energia in Coding question, function pointer, check if null.   
    "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.
  9. Like
    enl got a reaction from Taggsladder in Coding question, function pointer, check if null.   
    "if (bar[0]==NULL)" won't look at the pointer value, but instead the memory the pointer references, so that is right out, unless you want to know if the parameter is an empty string (only the null terminator)
    "if (bar == NULL)" should work, in particular if you explicitly pass NULL in since you are comparing a value to itself, as should "if (!bar)", since NULL should be 0.
    I just checked both (using gcc on a windoze machine) and they work as expected, so I can offer no insight as to why you would have a problem. I would suspect that you are seeing a symptom of some other issue than pointer comparison.
  10. Like
    enl got a reaction from Fmilburn in Coding question, function pointer, check if null.   
    "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. Like
    enl got a reaction from bluehash in Setting up a workspace - setup suggestions?   
    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. Like
    enl reacted to Rei Vilo in True random numbers   
    Try modulo. 
    result = random_number % 10;  
  13. Like
    enl got a reaction from cubeberg in Setting up a workspace - setup suggestions?   
    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.
     
  14. Like
    enl got a reaction from dubnet in Setting up a workspace - setup suggestions?   
    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.
     
  15. Like
    enl reacted to NurseBob in Conversion from analog to digital with MSP432   
    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.
  16. Like
    enl got a reaction from NurseBob in Conversion from analog to digital with MSP432   
    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.
  17. Like
    enl got a reaction from yyrkoon in More C versus C++   
    Most of his talk was not about C++, but about how to social engineer others into adopting in a non-supportive environment. It was a religious rather than technical exposition, as many Java talks, for example, also are. 
     
    As to the data, I buy it. The technical points made are that strong typing reduces run time bugs is true, under the umbrella that only certain flavours of bug are caught, but these flavours lead indirectly to bugs of kinds not caught directly. Another advantage of strong typing is that, properly used, it can let the compiler do better optimization. His test case,  a lightweight class, is probably where the advantages are greatest, but this is where, for many embedded applications, the other benefits to C++ are most available. I am not convinced that many of the 'more advanced' C++ tools and abstractions will give the same benefits, other than, with proper design, reduced debugging.With improper design (as one of the questioners put it, 'naive') there are likely to be losses. Some tools impose run time penalties that are unavoidable (often space rather than time) even with strong typing, but many of the standard tools (vector, for example) minimize this hit and save enough in other ways to be a net gain.
     
    Well designed standard tools pretty much always beat implementation specific, since they are designed (usually) by a specialist whose sole point is to get the best performance (by some metric) on the specific hardware. C++ provides a LOT of these tools. There are cases where a special purpose tool is better, but these are often brittle when changes are required, and the next revision has a net loss, either in performance (time or space) or in increased debugging.
    For reference, I tend to be a 'well written C is valid C++' kind of programmer, and use the C++ tools sparingly, especially in embedded work, and am NOT a C++ guru. I am, in fact, quite out of date with regards to the state of the C++ art. I still use the tools as they are appropriate, though.
     
    As for the social engineering aspects of the talk, nothing new. Read Dale Carnagie for the same. It is an effective model for understanding others and working with them. Nothing that hasn't been in writing for a good century, and known much longer, though in this case there is the extra fancy four quadrant graph of belief presentation.
  18. Like
    enl reacted to Rei Vilo in FourThreeOh wins TI Community Highlight of the Year Award for 2016   
    Well deserved, congratulations Gerard!

  19. Like
    enl got a reaction from bluehash in 20170311 - Upgrade   
    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.
  20. Like
    enl got a reaction from bluehash in 20170311 - Upgrade   
    It appears that 43oh is rejecting https connections (browser: mozilla, system windoze8, urls tested: https://www.43oh.com/   https://forum.43oh.com/ )
  21. Like
    enl got a reaction from zeke in Electronic Thermometer with analog meter   
    The board sockets on to the power header

    The 5-pin with the cable going to the right is for a button and double pole, center off momentary switch for adjusting the scale in operation. The software does linear interpolation from 0 to 100 degrees F, and allows for key points every 10 degrees. The three yellow wires go to the remote sensor (DS18B20). The mounting is leftover oak from redoing a floor. Glued up, planed, bored for the meter and the electronics, and finished to hang on the wall. The circuit board is mounted by putting epoxy in the pocket and dropping it in.
     
    Power board on. The tie point for the power line isn't on yet.

     
    The face of the finished display:

    The finish is shellac. I slopped on a heavy coat, light sanded, and then wiped another couple on. Then paste wax. Not perfect, but I banged it out quickly.
     
    The meter:

     
    Operating. The temp in my shop has climbed to 66F with a lot of help from the electric radiator.

     
     
  22. Like
    enl got a reaction from chicken in Electronic Thermometer with analog meter   
    The board sockets on to the power header

    The 5-pin with the cable going to the right is for a button and double pole, center off momentary switch for adjusting the scale in operation. The software does linear interpolation from 0 to 100 degrees F, and allows for key points every 10 degrees. The three yellow wires go to the remote sensor (DS18B20). The mounting is leftover oak from redoing a floor. Glued up, planed, bored for the meter and the electronics, and finished to hang on the wall. The circuit board is mounted by putting epoxy in the pocket and dropping it in.
     
    Power board on. The tie point for the power line isn't on yet.

     
    The face of the finished display:

    The finish is shellac. I slopped on a heavy coat, light sanded, and then wiped another couple on. Then paste wax. Not perfect, but I banged it out quickly.
     
    The meter:

     
    Operating. The temp in my shop has climbed to 66F with a lot of help from the electric radiator.

     
     
  23. Like
    enl got a reaction from Fmilburn in Electronic Thermometer with analog meter   
    The board sockets on to the power header

    The 5-pin with the cable going to the right is for a button and double pole, center off momentary switch for adjusting the scale in operation. The software does linear interpolation from 0 to 100 degrees F, and allows for key points every 10 degrees. The three yellow wires go to the remote sensor (DS18B20). The mounting is leftover oak from redoing a floor. Glued up, planed, bored for the meter and the electronics, and finished to hang on the wall. The circuit board is mounted by putting epoxy in the pocket and dropping it in.
     
    Power board on. The tie point for the power line isn't on yet.

     
    The face of the finished display:

    The finish is shellac. I slopped on a heavy coat, light sanded, and then wiped another couple on. Then paste wax. Not perfect, but I banged it out quickly.
     
    The meter:

     
    Operating. The temp in my shop has climbed to 66F with a lot of help from the electric radiator.

     
     
  24. Like
    enl got a reaction from Rickta59 in Electronic Thermometer with analog meter   
    The board sockets on to the power header

    The 5-pin with the cable going to the right is for a button and double pole, center off momentary switch for adjusting the scale in operation. The software does linear interpolation from 0 to 100 degrees F, and allows for key points every 10 degrees. The three yellow wires go to the remote sensor (DS18B20). The mounting is leftover oak from redoing a floor. Glued up, planed, bored for the meter and the electronics, and finished to hang on the wall. The circuit board is mounted by putting epoxy in the pocket and dropping it in.
     
    Power board on. The tie point for the power line isn't on yet.

     
    The face of the finished display:

    The finish is shellac. I slopped on a heavy coat, light sanded, and then wiped another couple on. Then paste wax. Not perfect, but I banged it out quickly.
     
    The meter:

     
    Operating. The temp in my shop has climbed to 66F with a lot of help from the electric radiator.

     
     
  25. Like
    enl got a reaction from dubnet in Electronic Thermometer with analog meter   
    I spent some time last year setting up an analog meter driver/thermometer for a client, and at the time, I went through my stock of junk^H^H^H^Hreclaimed parts and found a phase angle meter with degree graduations on it. I said to myself "since I alredy wrote the code and did the dev work on someone elses dime, I should throw one together for myself". A year and a half later, the holidays hit and I was looking for something to do instead of paperwork for work.
     
    So, I layed out a single sided board (the original was on a launchpad), cut it on the mill, and populated it.
     

     
    There was a couple days in the middle between cutting and populating (the holiday, you know), so I had a surprise. The astute amongst you might notice something missing on this layout, given that this is a low power project that will require stable voltage for the analog meter. Yup. No regulator pads.Finished soldering up the board and sitting there in the tray is the regulator. Whoops. I didn't feel like going whole hog (including changing a setup on the mill) for a board just to hold the regulator and a couple caps, so I pulled out a sharpie, a scribe, and an ancient bottle of ferric chloride. 20 minutes later, I had an etched board that would do the job. Ugly, but functional. The layout for the main board will be revised in case I reuse it.


     
    It doesn't look so bad populated.


     
    The wire is for USB power.
×
×
  • Create New...