Jump to content

enl

Members
  • Content Count

    341
  • Joined

  • Last visited

  • Days Won

    22

Everything posted by enl

  1. Yes. That will cause trouble. Energia sets up the WDT itself. It is used for timekeeping to support the time functions. DO NOT disable it for Energia. If you are NOT using Energia, you (probably) need to disable the WDT, periodically kick it, or set it up for your application if you will use it as a standard timer. The purpose of Energia, or Arduino, is to provide a layer of abstraction between tasks like device setup and processor initialization and the programmer so less experienced users don't get buried in the details, as well as provide a suite of utility functions and classes that abstract the hardware in useful ways. The price paid is that some modules are populated by system setup and become unavailable for explicit use. The WDT is one. Most users will not miss it.
  2. If I recall correctly: I do not think you need to do any watchdog setup with Energia. The Energia core sets it up as for use as the timebase for time functions. Any changes you make to the setting outside the Energia envelope will cause issues. See:
  3. They are not connected to the relay. They go directly to the load. To turn the load on or off, you need only interrupt one current carrying wire. You usually want to interrupt the HOT lead, so when the switch is off, no part of the controlled device presents a voltage that is a hazard. (This, of course, does not consider parts that store energy, like capacitors) (If you have further questions, ASK. Better to ask than someone get hurt or property get damaged. But please do tell us where you are located. The systems in the US/Canada, UK, rest of the EU, India, etc, all differ, and often differ within a single country based on region) Background: The underlying assumption here is that the source has one line that is essentially at ground (earth ground), and the other is HOT, meaning it it at 120V or 240V (AC RMS) relative to ground. In the US and Canada, this is ensured by connecting one wire at the service entry to the earth ground (this is called BONDING), such that one current carrying wire is within a fraction of a volt of ground (called the NEUTRAL-- formerly called GroundED in the US), the other is 120V RMS relative to ground. Similar systems are use in much of the world. For example, in most of the EU (and UK, which may soon be a separate entity), one stab is grounded at the entry, and the other is therefore 230V relative to ground. When there isn't a stab for the earth ground connection (safety ground), there is some provision in all modern systems. If I recall, the common one in the EU is the bracket (clip?) on the perimeter of the plug. The intent is that the EARTH GROUND (safety ground) only carries current when there is a problem, and that the safety device (fuse, circuit breaker, ground fault interrupt) should interrupt the circuit when that happens. Since the NEUTRAL current carrying wire does not present a safety issue, as it is near or at ground potential, we let it be. The GROUND (safety ground) conductor should NEVER, EVER be interrupted while EITHER THE HOT OR NEUTRAL is connected, which is why modern plugs have a longer stab for this. It connects first, and disconnects last. The line that should be switched is the HOT, which is not at or close to earth ground potential. I could (obviously) go on about why it is done this way, but I will cut it short by saying that it is the easiest way to minimize the number of ways that a fault can occur, and make it practical to protect against faults. ********************* Public safety message: bond your grounds properly. When using a portable generator, ALWAYS use a ground fault interruptor, be sure the ground is connected to a good ground tie (driven rod, metal building frame, etc) and the, when powering a building or gear in a building, tied to the building earth ground bus.
  4. Presuming you are trying to switch the power to an AC-powered device, such as a lamp or small appliance: You generally want the COM and NO (normally open) contacts. When the relay coil is not energized, these are OPEN (disconnected) so the load will be off. If you want the load to be ON when the relay coil is not energized, use COM and NC. If you want to switch between two loads, the loads go on NO and NC, and the source goes to COM. In general, the HOT current carrying wire goes to the relay COM, and the NEUTRAL (grounded) is left unswitched. The EARTH (safety) ground is not involved and should be passed straight through to the EARTH ground lead of the load, if it has one. The color conventions vary in different parts of the world, and not all commercial cords follow the conventions-- they are usually enforced in fixed wiring such as in a home of commercial building, but cords for plug-connected appliances are often not compliant. Several of the conventions are in messages above-- for example, in the US and Canada, the NEUTRAL conductr is WHITE insulated, and the screw or terminal on many devices like outlets is silver, the HOT conductor is BLACK (by preference. RED, BLUE, or any other distinct color than green may be used) and screw or terminal is often brass/copper color, and the EARTH (safety ground) wire is GREEN. The BLACK (or equivalent) should be switched.
  5. This is why I said it is odd, but I have never tried it myself with devices that are so closely related. I don't know if it actually was programmed with the wrong device specified, but I can see no reason there would be damage IF it was programmed this way.
  6. Odd that it programmed without an error due to the incorrect device. I would figure that there shouldn't be any issues, though. (this may not be clear.... sorry) The device selection for CCS gives the compiler information to select the device specific header file (which is a big part of information about what modules are available), as well as memory size and layout (so the compiler can do the allocation appropriately and know if there isn't sufficient memory-RAM or code memory- for the build). If you had tried to use a module that isn't available in the 2453 or the build needed more memory than the 2453 has, build would fail (probably). If you didn't, the devices are the same in all meaningful ways (address space, peripheral addresses, and so on. In particular, the code protection and JAG lockout) Apparently, there isn't a check that the device is what was specified.
  7. To elaborate: The MSP432p401r has two headers (J8 and J102, both being 5X2 pins) next to a row of ten jumper blocks (labelled GND, 5V, 3V3, ... TDO, TDI). The jumpers bridge the dashed line that separates the programmer/debugger side of the LP from the on board MSP432. If you remove the jumpers (ALL ten of them,) the on-board MSP432 will be completely isolated from the programmer, and J102 can be used to program an external unit. See sections 2.3.1 and 2.3.4 of http://www.ti.com/lit/ug/slau597f/slau597f.pdf That depends on how many units you need to program. For small numbers (tens to low thousands), the LP may be sufficient, if the target is designed to make it easy (accessible connector, no pin conflicts, and so on). For larger numbers, batch programmers are available. You still need to provide the appropriate interface in the target for this, and even of the units are flashed before the boards are made up, it is good practice to have a way to re-flash if the firmware is updated.
  8. I don't believe the FR2355 has timerA modules. The diagram at http://www.ti.com/product/MSP430FR2355 shows only four timerB modules
  9. enl

    LCD for MSP430G2

    slac467 zip archive at www.ti.com/lit/sw/slac467i/slac467i.zip has a number of examples (IIRC, there are several SPI, I2C and asynch serial examples). slac435 is the sample code for the launchpad, but all of the samples use timerA0 and software, rather than the hardware serial. It has been so long since I built my toolkit, I can't recall which samples I stole from (I just ref'd slac467 and slac080 in my docs) THere are resources on this forum like There are a lot of examples around the web, such as https://www.embeddedrelated.com/showarticle/420.php Definitely see slau144 section 15 for full detail of the USCI block.
  10. enl

    LCD for MSP430G2

    Depends on the size you want (physical and lines/chars per line), but there are a lot of options. I have used a numbers of them, including these in the last 6 months: Parallax 27977 2 lines X16 chars (pricey-- about $30), which is 5V supply, but the serial functions ok at 3.3V. Noritake GE256X64B-7032B 256X64 pixel (currently on clearance at Noritake site... about $15) A couple from Adafruit that appear to be out of stock (a 20X4 and a 16X2, using the HC44780) Several models of Noritake VFD's There are a ton of models available from the usual places for less money, most with the similar knockoff controllers, of which I have used few, but can make no recommendations. On the launchpad, I generally use lightly modified sample code from the TI samples for conventional (asynchronous) serial, rather than a full library. I can post some snippets if you can't find anything. You might also want to take a look at Energia.
  11. Rei Vilo hit the main point I will ask WHICH blink example you are referring to. There are a number of them. Background: the basic structure is that you turn on the LED, have a delay, turn off the LED, and another delay. What you did include your message does not show the delay... it is what turn on hte LED. There is a delay somewhere, and that is where you want the random value. You may want to restrict the random value to a certain range to keep the random blinking reasonable in appearance.
  12. I am sorry that I can't help you with this, but no Mac tho test on. Hopefully someone else will come in with something. If you find a solution elsewhere or on your own, please follow up here.
  13. I'll bite. Still teaching engineering. and still work as weld engineer (and whatever other label they need) for the same company. Doing more work on the side. Pumped out about 3K lines of code for a machine control during June and July (and hardware to interface to the existing hardware). Got introduced to a new-to-me form of NDA that essentially makes the two months not exist in my resume. Device used was an MSP430, as it was sufficient and I have them in stock. CNC'd my lathe (another MSP430... yup I have a pretty big stock of several flavours) As winter approaches and the temperature today was 5 degrees (40F), I envy where you are. But I would not survive in hospitality. I have avoided it, even in lean times, because I know it would not go well. You have my deep respect.
  14. UCSSEL_2 is the selector bit set for the sub-main clock as the clock source for the UCB serial module. I have not looked through the code (and do not use the MSP432 processors) so I I can't give details, and someone else may be able to give you a full answer, but if you see assignments to UCBxBR0 and UCBxBR1, these are setting the baud rate register divider (the BR in the names is for "BAUD RATE"). If no one comes in with more complete information in the next day or two, I can look at the source.
  15. I don't have the libs you are looking for, but I would guess that someone may be able to help you in the next day or two. The traffic here has slowed is fairly low these days, but many of the members do check in fairly often. If you don't hear anything in a day or two, I will do some digging. If you find the library you need elsewhere (or find it here somewhere), please do follow up in this thread.
  16. That indicates that the 0ohm resistor is in place, as it should be. This pretty much leads to the conclusion that either you have an issue with the jumper you are using to ground the reset pin, or there is something really, really weird. If it is something really, really weird, it will make you slap your head with a ball pein hammer when you find it. One thing to note about the use of a jumper: the stock pin headers on most of the various launchpads I have are suitable for a board connector, but the pins are borderline for a female shell connector on a cable. It seems weird when you first experience it, but the cable terminating contacts require about 1 to 2mm more pin length. In fact, UI need to run a new board for a CNC controller tomorrow, since I used the wrong pin headers (Always double check the components. I didn't realize I had the shorter pin version in the parts rack) and the control connectors are not fully seating, and are working loose due to vibration of the control panel. One of the reasons I still use a wire wrap tool and 30AWG Kynar wire these days.
  17. I am presuming that you have the proper ground connection for the various methods you are trying: Connect a scope probe to the reset pin on the header (P2, pin 5) and push the reset button. You should see the line go from high to low If not, the pin is not connected to the line. It should reflect the state of the button, but is listed in swru372b as an OUTPUT (tab;l 8 on page 13, and fig 8 pin map) for resetting daughterboards, and though it should be usable as an input based on the schmatic. What I would guess is not there is the 0ohm resistor R84 that connects the header pin to the line. (see CC3200-LAUNCHXL_SCH_REV4P1-C.pdf, sheet 2, location D2 shows this) If that isn't it, you got me. I can't see any other way for this to happen (presuming the wire is good, you have the wire connected to actual ground, etc).
  18. SInce no other responses have come along, I will get the ball rolling by asking for a bit more detail. What errors are you getting? What are you trying to do with the watchdog? As far as I know (not using the CC32XX series), Energia supports the 3220 launchpad board. See https://forum.43oh.com/topic/13311-connecting-cc3220sf-to-cayenne-mqtt-using-energia/ (Rei Vilo's msg: 6th in the thread)
  19. Glad to see you worked it out. For most standard/common setups, I keep a collection of code snippets, so I don't need to think too hard.
  20. There are two answers: 1: Strictly using hardware, you have two independent PWM channels, as long as you aren't using either timer for anything else (the two TIMER_A modules-- timer type A, a 16 bit with counter with a selection of control inputs for counting, output modes, and other options. Other MSP430 devices may include other timer types, such as TIMER_B). There are several pins that can be attached to each for PWM output, but, for practical purposes, they are not independent. 2: Using software, you can have as many PWM as you have output pins, but more than 8 gets more difficult. The max PWM frequency will not be as high as the hardware only solution, and the precicion will be lower, but for many applications, it is quite acceptable. This requires using an interrupt service routine triggered by a timer at the PWM resolution. If you want a PM cycle of 10ms (100 cycles per second) and a n 8 bit resolution (256 PWM pulse widths), you will need the interrupt to trigger every 39 microseconds. This is about the limit for an MSP4302553 at the max clock frequency, if you want to get anything else done, like control the PWM. I have used this approach a number of times, and have at least one example on this site (8 channel spooky eye controller for hallow'een ). For motor control, this might be quite sufficient, especially if you use a table in memory for control. For a three phase BDC motor, you are likely to be able to use 3 or 4 bit resolution and a PWM cycle of about 500 microseconds. This will give you a max RPM of the order of 18KRPM (300 rev/sec) As regard to your response to Rei Vilo,: A key skill that anyone working with electronics, microcontrollers, PGA's, and so on, is reading and interpreting data sheets and data books. For a complex device, which the MSP430's are, this is not easy, but is still a needed skill and you will need to do it to complete any project that is not trivial, and a three phase driver is decidedly not trivial. The information for response 1 is directly in the pin map. Response 2 requires experience.
  21. For the sampling strategy, you probably don't want the repeated strategies. If it were me, I would use ADC_SEQofchannels for the two channels. As for the dead zone, I generally estimate then adjust it during testing. The value I tend to start with is about 5 degrees (2.5 to either side of the zero)or 2 to 3 percent for linear slides, unless the pot has very small mechanical range (less than 180 degrees, shorter than 10mm for linear). You don't set this in the ADC. That is pure arithmetic after reading, with an approach described above. There are other approaches.The one above doesn't do it if you need control all of the way to zero (with motors, you usually don't, as there won't be enough torque at the bottom end to turn the motor unloaded, much less with load). As an example: 270 degree pot, and 5 degree dead zone: When reading, the range for ADC12 is [0..0xfff]. That gives approximately 0x10 counts per degree. The sequence I would use is: // n is a signed int to represent the speed // d is a bool for direction //PWM_max is a constant for the max PWM value. Presume the desired values are UNSIGNED in the range [0..PWM_max] scale_val <- PWM_max / 0x800 // this will be computed at compile time. It is more efficient if it is an int n <- ADC - 0x800 // set center of pot at zero if n<0 then d <- false else d <- true n <- abs(n) if n < 0x28 then n <- 0 // dead zone is 2.5 degrees to either side of zero PWM_value <- n*scale_val //scale PWM The 0x28 sets the dead zone width. There are other ways, as well, of you need PWM all of the way to zero, or want independent control of the PWM low end and dead zone width
  22. I can't address everything you asked (I haven't used the eComp) , but as to bidirectional control, that doesn't matter. Presume you get a value in the range [0..0xfff] as your control value. There are several approaches, but they all boil down do, essentially, subtracting 0x800 from the read value to put half of the range negative, and half positive. For the PWM, if you have a bidirectional driver (inputs are a direction and a PWM pulse) you use the sign for the direction output and the magnitude (absolute value) to set the PWM, probably with scaling. For a driver like the 293, you do a bit more in software, but it comes to the same thing. Hold both drives low for stop, Depending on the sign, you pull one high or the other high via PWM. For a setup like this, I might set a 'dead band' around the stop. After abs value, if it is less than some small value, treat it as zero. This makes stopping MUCH less touchy, and makes it much easier to avoid the condition of PWM too low for the motor to run, but still heating up the motor and driver.
  23. You have a wide variety of clock options from 48MHz down to about 10KHz, on board, the ability to use external clocks (crystals or other sources), and direct support for 32768Hz crystals (and others). You can't reliably go beyond 48MHz, but the internal clock generator will give a fairly smooth range down to the low end (I don't recall the bottom end of the DCO, but the LFO-- ultra low power, low frequency onboard unit- is below 10KHz) Most libraries and language families will provide a way to select which clock and set the rate for the DCO or other source. See http://www.ti.com/lit/ds/symlink/msp432p401r.pdf page 123 for summary.
  24. It is a clever solution, and I learned a few things I hadn't realized about the interrupt flags, but I do think it is a solution in search of a problem. To me, it isn't that the interrupt handler is the only way, or always the best way, but that it is simple and has a low penalty in cycle usage and power, relative to polling this way. Fewer clock cycles per loop (single mask to check one bit, rather than several changes to control register states and masks), and, since this is likely to be a rare event at code speed, net minimal hit. Without working out the numbers, I would guess that each NMI costs about twice as much as each polling loop hit in this example (cycles and power), versus much greater saving each loop for the polling operation. Also, the NMI handler is a natural fit to dropping to lowest power states (though the '430 is better than many processor families with regard to wake up from assorted conditions) and allowing the handler to wake up for the polling loop. Can you tell I am not a fan of delay functions that do not sleep the processor? [My first experience with this involved halt on a Z80, with a line frequency-- actually video frame rate-- wake-up used for delay in 8.3ms increments in conjunction with processor HALT... This allowed for wake up as needed, and, by the standard of the times, moderate power savings] Please do correct me if I am missing something here... This isn't something I have really considered with this processor before.
  25. The few times I have needed to do this, I used interrupt handlers that did nothing but set or reset a bit to reflect the state.
×
×
  • Create New...