• Content count

  • Joined

  • Last visited

  • Days Won


Fmilburn last won the day on July 4

Fmilburn had the most liked content!

About Fmilburn

  • Rank
    Level 3

Profile Information

  • Gender
  • Location
  • Github

Recent Profile Visitors

1,431 profile views
  1. Hard to say with the information you have given... The two sides of the RXD/TXD must be connected of course.
  2. There are two hardware UARTs on the F5529. See the Energia pin diagram here. Note that P3_4 and P3_3 are designated as RX(1) and TX(1) respectively. RXD and TXD are connected to P4_5 and P4_4 on the header with the jumpers. When you specify Serial in Energia it is using P4_5 and P4_4. Quoting from the Energia reference on the Serial Library: To use pins P3_4 and P3_3, specify Serial1 instead of Serial.
  3. You could use attachInterrupt() to detect when the pin of interest has changed (e.g. in your example when the sequence changes from xx0x to xx1x). At that point you could use digitalRead() to determine the status of the other pins. However, digitalRead() is relatively slow. If you are willing to give up compatibility with other processors then the register containing the input values for the port can be read quickly and directly. For example, the following reads and prints the input register for port 1 and then masks out and prints G2 LaunchPad pin 5 (P1.3) which is attached to switch S2 on the G2 LaunchPad. void setup() { Serial.begin(9600); pinMode(5, INPUT_PULLUP); // G2 LaunchPad push button } void loop() { Serial.println(P1IN); // Input register port 1 Serial.println(P1IN & BIT3); // Pin 5 is P1.3 delay(100); } The GPIO registers are described in the Family User Guides for TI microcontrollers - see SLAU144J for the x2xx family. It might be cleaner just to do this in CCS without using Energia.
  4. Hi @nirbar11 and welcome to 43oh I am not sure I understand your objectives but here is something to get you started... Don't use pin names of the form P1_x in Energia as this has been deprecated Don't put print statements (or other slow to execute code) inside of interrupts - flag the interrupt and handle it elsewhere You will probably want to avoid using delay() in your code Note that if using a G2 LaunchPad that P1.0 and P1.6 are attached to LEDs via jumpers that can be pulled Here is some example code that detects buttons being pushed (no debouncing). volatile bool pin5Pushed = false; volatile bool pin6Pushed = false; volatile bool pin7Pushed = false; volatile bool pin8Pushed = false; void setup() { Serial.begin(9600); pinMode(5, INPUT_PULLUP); pinMode(6, INPUT_PULLUP); pinMode(7, INPUT_PULLUP); pinMode(8, INPUT_PULLUP); attachInterrupt(5,interrupt5,FALLING); attachInterrupt(6,interrupt6,FALLING); attachInterrupt(7,interrupt7,FALLING); attachInterrupt(8,interrupt8,FALLING); } void loop() { if (pin5Pushed == true){ Serial.println("Pin 5 pushed"); pin5Pushed = false; } if (pin6Pushed == true){ Serial.println("Pin 6 pushed"); pin6Pushed = false; } if (pin7Pushed == true){ Serial.println("Pin 7 pushed"); pin7Pushed = false; } if (pin8Pushed == true){ Serial.println("Pin 8 pushed"); pin8Pushed = false; } } void interrupt5(){ pin5Pushed = true; } void interrupt6(){ pin6Pushed = true; } void interrupt7(){ pin7Pushed = true; } void interrupt8(){ pin8Pushed = true; } And finally, avoid double posting.
  5. Seveal instances of this are scattered over 43oh. Maybe add it to this porting libraries link:
  6. Hi @Alice12789 I don't think that boosterpack is available any more. A readily implemented alternative is to buy a breakout board, e.g I haven't used that particular one, also note there are also others available.
  7. Project Closure Here are the original objectives along with closure notes that may be of interest to some... cost - unit cost for the receiver of $10 or less - The project came in at less than $10 for each receiver, even in small quantities. technology - common off the shelf components, MSP430G2553 - The G2553 was more than adequate for the project. Also used the TSOP38238 for infrared and the SK2812 for LEDs which are readily available and inexpensive. construction - standard double sided PCB spec, keep SMD parts large enough to be hand soldered - I used OSH Park for the PCBs and 0805 components for the jelly bean parts. Everything was hand soldered. I did find it a bit difficult to hand solder the SK2812 and had to go back and retouch a number of them up. Not sure why, the part is relatively large. power - CR2032 (rated 3V and 225 mAH) - Worked well, even with the SK2812 which have a higher voltage on the datasheet and despite drawing 10 mA or more. life - needs to run at least half an hour on fresh batteries - Battery life is easily an hour or more the way I am using it. Current is on the order of 10 mA as noted above. reception - 10m with clear line of sight, update at least every 100 ms - This is easily done provide there is line of sight and IR LEDs with sufficient beam width are chosen. As noted in the thread above, multiple transmitters can be used which can help meet this requirement. transmission - desirable but not required - I chose not to make the receivers capable of transmission. size - 40mm/1.6" diameter for receiver - Easily done, see photos below. programming - Energia desirable - The receivers were programmed in Energia as noted in the thread above. The transmitter was programmed with CCS but I ended up using UART to communicate with it. Accordingly, any computer or microcontroller with UART can be used to direct the transmitter. This was actually one of the more interesting parts of the project and I may write a tutorial on the method at some point in future. schedule - 6 month completion - It ended up taking 7 1/2 months but could have been done in half the time without my usual side tracks and procrastination. Here are some shots of the finished parts... Each receiver has a SK6812 soldered to it - it is lit red in the photo. The onboard SK6812 is not used in this project, instead a string of SK61812s is soldered on the 0.1 inch pitch header on the right side of the board (Dout, GND, and 3V3). The IR receiver is soldered to Pin 3, GND, and 3V3. Other pins, labelled with Energia pin numbers, are also available to the user. Programming access is at the top and I usually use Pogo pins although a male or female 0.1" pitch header could be soldered in. The 2032 battery is inserted from the bottom. On earlier versions I used WS2812 LEDs already soldered to PCBs for the string that is hot glued into the tiaras but ended up making my own and soldering SK2812 LEDs to them for the final project. The pins are "breadboard friendly". SK2812s are essentially the same as WS2812s and "Neopixels".
  8. I have always used the reference page in Energia: Googling something like "vary time potentiometer arduino" will likely turn up code close to what you want. I don't see where you reset the time in your code, i.e. timer1 and timer0. One section of code is repeated and I assume that is not your intention. I would do something like this: /* * Varies the flashing period of the onboard red LED using a potentiometer * attached to a MSP430G2553. Tested with Energia V17. */ const int potPin = 7; const int minTime = 500; const int maxTime = 10000; unsigned long waitTime = 0; unsigned long startTime = 0; int ledState = HIGH; void setup() { Serial.begin(9600); pinMode(RED_LED, OUTPUT); startTime = millis(); digitalWrite(RED_LED, ledState); } void loop() { waitTime = map(analogRead(potPin), 0, 1023, minTime, maxTime); if ((startTime + waitTime) <= millis()) { Serial.println(waitTime); ledState = !ledState; startTime = millis(); digitalWrite(RED_LED, ledState); } }
  9. MSP430 Energia uses a lower power mode with delay() than Arduino but it still blocks other code from running. interrupts are another possible solution.
  10. if (delay == bad){ // and delay is to be avoided ! use delay } Set up a variable that records the start of the period - e.g. startTime = millis() Set another variable to hold the end of the period - e.g. finishTime = startTime + sensorTime Keep the loop going without a delay Keep reading values At the top of the loop check millis() to see if finishTime has been reached, if so take appropriate action Also check to see if the pot has changed more than some predetermined amount - if so, make desired changes There are quite a few tutorials around about how to avoid using delay(), e.g. this one turned up when I googled: There are some traps to avoid when using this method - e.g. use unsigned long, overflow, etc. The tutorials should touch on this.
  11. Once you start down the rabbit hole there is no end of unexpected things I believe the ones I have are for TV remotes or something like that where the user aims the controller at the device and tight focus is desirable. For example, here is the Everlight IR333A - my crude measurements show something similar: My idea for angling would be to make the PCB something like this for the desired angles and bend the legs of the LED 90 degrees to point them in the right direction: This would not be a good solution if the goal is SMD and simplified manufacture of course. Plus, it wouldn't fit neatly into a off the shelf enclosure. Other LEDs can be purchased that have a wider beam. For example there is a Kingbright SMD 0605 LED that is good for 50 mA and has 50% relative radiant intensity out to 120 degrees. Note that the example about had 50% relative radiant intensity only out to 20 degrees. I would need a lot more of them but they should be easier to assemble than bending leads and through hole soldering. It is also possible to get single LEDs rated at 1 Watt which might do the trick. Another idea to reduce parts is to use resistor arrays instead of individual resistors.
  12. Hi @indirtwetrust and welcome to 43oh. It always helps to post a simplified version of your code that demonstrates the issue so that others can replicate it. Perhaps you did not set the pins low before setting them to outputs? If not, I suspect the default is for Energia is to immediately set output to high. See the code below where I set pins low first: /* Test output state on powerup and reset * G2553 LaunchPad without crystal * Energia V17 */ void setup() { pinMode(PUSH2, INPUT_PULLUP); digitalWrite(6, LOW); pinMode(6, OUTPUT); digitalWrite(7, LOW); pinMode(7, OUTPUT); digitalWrite(8, LOW); pinMode(8, OUTPUT); digitalWrite(9, LOW); pinMode(9, OUTPUT); digitalWrite(10, LOW); pinMode(10, OUTPUT); } void loop() { if (digitalRead(PUSH2) == LOW){ digitalWrite(6, HIGH); digitalWrite(7, HIGH); digitalWrite(8, HIGH); digitalWrite(9, HIGH); digitalWrite(10, HIGH); } else{ digitalWrite(6, LOW); digitalWrite(7, LOW); digitalWrite(8, LOW); digitalWrite(9, LOW); digitalWrite(10, LOW); } } The logic analyzer in the screen shot below is set to capture for 5 seconds. When I start it, the LaunchPad is running and I am pushing the user button on P1_3, PUSH1, every second or so. As expected when P1_3 goes low, the output pins go high. In the next screen shot I wait about a second into the run to plug in the LaunchPad. As can be seen, everything is low to start and then P1_3 goes high as soon as it is reached in setup(). The rest stay low. It takes a while to start up because I don't have the crystal installed on this LaunchPad and Energia tries for a while to start it before giving up. The same thing if I do a reset - the output pins don't start out high.
  13. I will give you my relatively uneducated opinion for what it is worth... I don't think many professional C/C++ programmers (which I am not) would choose to use Energia in a commercial product and most commercial products do not use it. The same applies to Arduino. The reasons are many but there are exceptions of course. The most obvious exceptions are where the product is intended for Energia/Arduino users or it is a relatively simple application that fits Energia and the programmers skills well. I worked on a small project that used Energia and sold in very small quantity. See for example: You can discuss this with the PCB board assembler as some have this capability. In any event, if you can do it, you can find someone else who will do it for the right price. If you are going to build several hundred of these you might discuss your questions with a TI sales representative.
  14. New IR Transmitter Prototype Assembled I have not received the new PCBs yet but I did get the IR LEDs so I put together a "boosterpack" transmitter and a separate module to test coverage and range. They can be used together with crossed beams for coverage from two sides. The IR LED array on the left is lit, but since it looks to be off, it is apparent that my iPhone has an IR filter on it. Total current when on is on the order of 400 mA per bank and is controlled by a TIP120 Darlington Transistor which is all I had on hand that could carry the current. The TIP120 on the left has a heat sink on it but I found that wasn't necessary and the one on the right is bare. The LEDs are capable of 100 mA continuous each but are seeing less than 50 mA at peak here. If you look closely at the bottom row on the booster pack you can see the 0805 SMD resistors that are in series with each LED. Power is coming from a 1200 mAh lipo beneath the LaunchPad which seems sufficient for the task. This thing puts out a lot of photons compared to what I was using before. Indoors with white walls it even bounces around corners. I learned the following which will need to be incorporated into the next iteration: The beam is too narrow. I discovered this by testing outdoors with no walls to bounce off of. The LEDs I bought were from China and did not have a complete datasheet. Possible solutions are wider beam LED(s), angling them in such a way as to spread the beam, possibly reflect them with an umbrella as is sometimes done with a photographic flash. Use more SMD components. I would like to reduce the hand soldering. Looking for a SMD enhancement MOSFET that can handle 1A at 3.3V and not overheat in a small enclosure plus IR LEDs that fit the spec. Find an off the shelf enclosure and design around it. The receiver PCBs and WS2812 PCBs should come in next week.
  15. If you are referring to a setting in CCS then it can be done like this: 1) Select the register tab and then the register you are interested in while in debug mode 2) Right click on the number of interest int the value column and then number format 3) Select Binary I agree with the others. If you are serious, then get a logic analyzer even if it is a cheap 24 MHz one off of eBay. Also, take advantage of the TI training videos, e.g. training&tisearch=Search-EN-Everything composer studio training&tisearch=Search-EN-Everything