Jump to content


  • Content Count

  • Joined

  • Last visited

  • Days Won


Everything posted by enl

  1. Welcome to the preprocessor. I don't know of any more elegant solution as parameters are literal, though there may be one. The second level forces the parameter to be seen as a token itself and be substituted. The initial version did not let the token be seen on its own. I learned the power, and limitations, or macro expansion with asmh on MVS, writing a 12 liner to expand to the twelve days of xmas for a class. The C/C++ preprocessor is more capable, but is still not doing full featured regeps.
  2. I tend to use this style for many things, in particular single thread embedded applications like one tends to have on the smaller MSP430's, but it isn't always my preference. The code tends to be more readable if done reasonably well, with full optimization available since it is expanded by the preprocessor, but inline functions can be just as efficient and are often less likely to lead to debugging issues, making them generally preferable when available, but with the drawback that expansion is not mandatory, so timing is not guaranteed. If forced, you lose some space optimization features
  3. @yyrkoon They are not cheap, but keep in mind that they developed the software, and, unlike some of the clones (by the magic of google) actually perform as advertised I may be biased, having spent several thousand dollars for significantly less performance during the present millennium for a dedicated device, but I see it as a real deal. With the USB units, buffering is a concern, but none of them (as far as I can tell) are over endowed with memory. They need a USB channel that can suck up data and a host that can do something with it. I have had no issues at 500MHz with a saleae pro
  4. I have and use a Saleae logic-8, and have a logic-8pro at work. The lowest end is logic-4 at about $110. For what you are looking at (sub-100KHz) the logic-4 would do well as the sample rate is 12MHz. The logic-8 is 100MHz sample, which is reasonable to about 10MHz systems. There software has several protocol analyzers (I2C, SPI, RS232/standard serial, USB, and about 20 others) and I think it is possible to write your own. I have nothing but good things to say about the unit, and would only give the standard cautions that the units are most useful on a laptop running on battery power to avoid
  5. What orientation do you have for a project? The capabilities of the processors differ so much that it is difficult to answer your question without knowing where you are going. No sarcasm is intended in the following suggestions: Robotics? You can do multiaxis control in real time. Audio? You can do signal processing within the limits of the ADC resolution. Video? I would guess that you could produce VGA output to run 640X480 VGA at 8 color (one bit per color), or possibly better with some careful programming, and have no major issue producing a videogame. Certainly 320X240 should b
  6. I suspected this as result of placing an order and getting free shipping. Nice to have it confirmed. The free license for full CCS with the launchpad is also still active, though the checkout added a number of other things for no reason (25 pack of launchpads, full CCS for full cost, and a couple other things), but they were deletable.
  7. Starting point is you have an off by one eror on the loop counter: the test should be "<5", not "<6" as you are trying to do it. But, I think the main issue is that A0, A1, etc are aliases for pin identities, not channel values. You might try: const int analogpins[]={A0, A1, A2, A3, A4}; . . . . for (int i=0; i<5; i++) { sensorValue=analogRead(analogpins[i]); . . .
  8. @@roadrunner84 The circuit can be used for on-off. When a signal is not present, the period is greater than a boundary value. When it is present, the period is less than the boundary value. The advantages to this type of circuit over many alternatives are simplicity and versatility. It can be used for FSK, OOK, and can be used for standard serial, FM and MFM self timed communication, among others. For FSK and OOK, a minimum number of cycles can be used per bit, often only one, if the channel otherwise doesn't affect phase with frequency or have significant filtering. The drawback is th
  9. That is what I was describing. The upper section is your minimum (FSKIN side). This is, again, presuming that the MSP430 will do timing of state changes to get frequency. This is presented essentially as an analog connection, but, with a Schmidt trigger input pin, you get zero crossing detection.
  10. Probably not, but the key thing are that a) the signal should center around Vcc/2 (1.5V in a 3V system), teh level should not go outside power supply bounds, and c) the swing should be more that 2/3 Vcc p-p. Additionally, fast transitions are nice, but may not be achievable with audio output device. Using a Schmidt trigger input (available for the timer inputs) makes this less critical. The need for an op-amp would be due to insufficient level from the audio output. A line level output will be about 2.2Vp-p into 50Kohm, but headphone outputs may or may not meet this, and a line level outp
  11. You haven't make clear what you mean by audio commands. Do you mean something like tones as used in touch tone telephones? Or are you just interested in getting useable information from the pi to the MSP430 via the audio output in any format at all? or are you just interested in getting data from one to the other and selected the audio output by default? If the first or second, single tone detection isn't that hard. I would use capacitive isolation and protection diodes to limit the signal. Bias with a voltage divider to the middle of the power supply range, and then, using a digital input
  12. pcb-gcode for use with Eagle would by my first suggestion.
  13. The guideline for picking a clock source and the required accuracy and stability is pretty straightforward, but in general, using the DCO is what you want. If you have the crystal in system, the DCO frequency can be compared to it and the bit rate divisor can be adjusted for best approximation. The error rate given describes the accumulated timing error, NOT the unreliability of the line, and can be used to determine whether there is likely to be data errors in transmition due to timing issues. To add a little background, the bits are sent and received in nominally identical time slice
  14. I have been through a number of generations of in house prototype and hobby scale small volume, and if I can avoid it, I don't do it myself. That said, I don't make a lot of boards anymore, so there is a large grain of salt involved when I say that, with a little care, prototyping on a mill can be viable. It is what I do most of the time these days, as I have the equipment. It isn't as fast as photo, or even toner transfer. There is a mess involved unless dust collection is dead on-- handling the fibreglass dust is a different league than chips and dust from pretty much any other material. Wha
  15. It already is. They go hand in hand.
  16. enl

    Project ideas.

    The 4017 is a decade counter IC. This means that it has a clock input and ten (actually 11) ouputs. At any point in time, one output is active. Each clock causes which output is active to advance. There are a few other pins, like a carry output that is active when outputs 0-4 are, and a reset input. It has been around for give or take 45 years, and is still useful, for anything from an LED chaser, waveform synthesis, to LED multiplexing circuits. It would appear that the kit was not designed to push you in any single direction, so: I might consider making a puzzle. You have several input
  17. I never noticed that board on adafruit. I may grab one just to play with, though I don't know if it will fit my final project-- I don't think there are enough triggers, though I may be able to reduce the number I need. The lack of ability for background sound may also be an issue, but I might be able to work with it. There are advantages to a packaged solution over the theoretical best solution.
  18. Has anyone used the Novoton voice modules ("Chipcorder" ISD2360 for example) or similar devices? I am looking for suggestions for an upcoming project, and the price/performance of these looks reasonable, but I have no idea what other options are out there. General outline: the relevant part of the the system will detect roughly a dozen events and play a short audio response to each, playing general background otherwise. Think of something like varied breathing sounds all of the time, with other sounds overlayed or replacing in response to inputs. Total audio is, give or take, 30 seconds, w
  19. That works fine. Eats a couple cycles, but probably about the same as if you needed to test state (and possibly be bamboozled by a short pulse) in the ISR. This is how I coded a quadrature decoder a few years ago for a positioner.
  20. Forgot to mention another possibility that I have used: nitrile mechanics gloves. Closing the wide (wrist) end can be done with silicone: I have clamped smoothly and tightly using aluminum bar about 5mmfrom the edge roll and run silicone into the exposed end without clamping. Leaves a decent seal. You could trim a finger end to run the wire through and seal that with a dab of silicone and a zip tie.
  21. Basic guidelines would dictate that if it can't be hermetically sealed, then it needs to shed water and breath. If attitude can be guaranteed, then an open or screened/perforated bottom should do. As a totally different thought, that I have not tried yet, a full hydrophobic coating might do the job, like one of the relatively new hydrophobic coatings for driveways/sidewalks. Or, go old school. Tie the thing up in a condom. The urethane ones hold up well over time, better than the latex ones, and are a bit tougher. A dab of silicone on the sensor wire at the appropriate location before
  22. The info you provided is unclear and the numbers you give don't add up. Do you need 10V peak-to-peak? 10V amplitude (20V peak-to-peak)? 10VRMS? If 6.6Vp-p (+/-3.3v) is giving 80dB, then, as piezo devices are pretty linear for constant frequency, the output power will be pretty linear with voltage, whichever measurement is used. 6.6Vp-p square wave has a principal amplitude of (4/pi)*3.3V, and an RMS of about 3.0V. This is what is driving the resonance. If the device is spec'd at 10VRMS, then you should be getting 117dB+20log(3.0/10)=117-10.4dB=106.5dB (approximately 1/10 the power, whi
  23. Remember Pascal? Originally, no short circuit conditionals, among other things intended to force `good practice'. Most of these things were (incompatibly) rectified by various compiler designers. Even the UCSD line eventually gave switches for some of these things by the early 1980's. Java still does the same thing, in some ways (no overloading operators, for example, makes writing code to do non-triveal math a bit of a suck) Hmmm... I wonder if I still have a set of UCSD p-code floppys around?
  24. I don't follow that end of the universe at this point. I have worked in facilities with good, though AFAIK wired, network lighting control. The consumer technology seems to be predominantly gimmick. Historically, the early adopters drove technology, and by the time it made mass market, there was a reasonable level of reliability and utility achieved from the experience of the early adopters. I don't see that with most of the IoT devices, honestly including the lightbulbs. I see a few uses in the home, and in fact have wireless control (formerly X10, now RF keyfob hanging on the wall by the
  25. The IOT thing has been around for long enough to become a cliche. As it stands now, in the consumer marketplace, it is a sales point for people that want the latest and greatest technology but have no clue how it works or what it is useful for. Roughly four years ago, I was shopping for a new refrigerator. The big store I went to had nothing that wasn't advertised as IOT (except dorm size), though only some of them were networkable. All of the networkable ones had features like temp setting through a web interface. All identified themselves readily with no security over the connection. A coupl
  • Create New...