JohnDough 1 Posted September 14, 2015 Share Posted September 14, 2015 Hi,I want to do a small project, and find it difficult to choose the right version of LaunchPad.I hope I can get some help here.I'm looking for the cheapest LaunchPad which can be used for my project.The project is a metronom - the tool that "beats" (vie click/lights) X times in a second,just like this one: (excpet that the "tap" on my project will be using button, not microphone) I just want to try and do one by myself. The requirements are:1) Internal clock should VERY accurate, with 200 Beats Per Minute.2) Need to controls 3 "7 segment displays"3) Need to control 1 led to indicate the beat4) Use some "piezo speaker" to make the beep, e.g https://www.sparkfun.com/products/79505) Control speed using "rotray encoder". eg https://www.sparkfun.com/products/91176) Should work on 9V batteryI have a lot of experince in in programming (c/c++),but not with embedded systems.Question #1===========Do I need to buy the "real time" version for the timing accuracy ?On the simple "MSP-EXP430G2" it just says "2 16-bit Timers"(http://www.ti.com/ww/en/launchpad/launchpads-msp430-msp-exp430g2.html#tabs) I need a timer that will_not- be affected from the state/voltage of the battery Question #2===========For 3 "7 segment" I need already 21 controls pins,so does it mean that I need some kind "booster pack" ?If you can refer me to the specific model I need that will be great.Thanks a lot for any help !Regards. Quote Link to post Share on other sites
terjeio 134 Posted September 14, 2015 Share Posted September 14, 2015 Q1: MSP430G2553 should more than accurate enough for your project. You need a voltage regulator for the MCU and display so battery voltage will not affect performance. Q2: With multiplexing you only need 10 pins for 3 7-segment displays, but a better option is an OLED display. With I2C control only two pins are needed. I have code and font for a 3 1/2 digit 7-segment display (based on 43oh sources), if you want to use OLED and need some input I'll post that. OLEDs does not need backlight, draws very little current, are high contrast and can be read in bright sunlight. Quote Link to post Share on other sites
roadrunner84 466 Posted September 15, 2015 Share Posted September 15, 2015 Q1: Launchpad G2 is sufficient for your needs, if you find the DCO (internal digital oscillator) to be not accurate enough out of the box, you may consider attaching a watch crystal (32.768 kHz) to enhance precision. Q2: You need 10 pins; 7 for the segments and 3 to select which of the digits you're going to write to. You'll require three transistors, since the MSP430 cannot sink such a current. Essentially you'll be making a very simple booster pack. You're probably best off using the MSP430G2553, since that's the most extensive version that's compatible with the Launchpad G2 (AFAIK), later on - if aiming at mass production - you could always scale down to a simpler one. Quote Link to post Share on other sites
terjeio 134 Posted September 15, 2015 Share Posted September 15, 2015 @@roadrunner84 - three transistors will not be sufficient, the current through the leds requires both sourcing and sinking controlled by the MCU. One ULN2003 and three transistors will do the trick - this is how I implemented the 7-segment driver circuit in one of my projects. Quote Link to post Share on other sites
roadrunner84 466 Posted September 15, 2015 Share Posted September 15, 2015 @@terjeio oh! you're right, that won't work, unless you're driving each segment separately. But then you'll probably have not enough brightness. a project like this will become quite bulky when you need an additional IC to make stuff work, though you could hide it under the 3x7 segment display... Quote Link to post Share on other sites
JohnDough 1 Posted September 15, 2015 Author Share Posted September 15, 2015 Hi,Thanks alot for your help !I've all your read helpful messages.I've decided to do it 2 stages,because I see all these numbers and parts that I know nothing about,so I decided the leave the audio and rotary encoder control to stage 2,and in stage 1 just have a "timer" with seven-segment display(which is prefered to oled because of price)I've put up a list of the stuff I need to buy,with some short questions in the end. The list: 1) 1 x "TI LaunchPad MSP-EXP430G2" (with breadboard and wires)2) 3 x "7-segement display" - https://www.sparkfun.com/products/85463) 1 x "Crystal 32kHz" (to improve accuracy) - https://www.sparkfun.com/products/5404) 1 x "voltage regulator 3.3V" (to use 9V battery) - https://www.sparkfun.com/products/5265) 1 x "ULN2003" to power display - Question #1 - is "ULN2803" can be used instead ? That's what they have at sparkfun now - https://www.sparkfun.com/products/312 I've found a comparison between them, but I didnt understand it ):6) 3 x "NPN (BC547)" transistors for display - https://www.sparkfun.com/products/8928 (as recommened here: http://www.itopen.it/driving-a-pair-of-7-segments-display-with-msp430-energia-libraries/) Is my list complete/ok ?Thanks alot for your help. Quote Link to post Share on other sites
yosh 121 Posted September 15, 2015 Share Posted September 15, 2015 Check this: https://itead.cc/imall/128-x-64-oled-module.html I use this OLED Display all the time and I think the price is ok. Quote Link to post Share on other sites
terjeio 134 Posted September 15, 2015 Share Posted September 15, 2015 @@JohnDough - OLED will be far simpler to wire up than a 7-segment display, and the extra money (if any) for the OLED will be paid for by longer battery life. I do not think you will need the 32KHz crystal as one is included with the LaunchPad - I suppose you are not going to make a PCB for your project? ULN2803 is functionally equivalent to ULN2003, it has one more buffer than ULN2003. If you go for the 7-segment display you will need seven resistors too - one for each led segment (for current limiting). Go for OLED, I think it will save you from a lot of trouble... Quote Link to post Share on other sites
enl 227 Posted September 15, 2015 Share Posted September 15, 2015 @@JohnDough -- The MSP430G launchpad kit includes a 32.768KHz crystal. It is not installed and you will need to solder it on place. I would not call it a beginner soldering job, but it isn't bad as small components go. I would use the supplied crystal, as it will fit the pads on the board and is matched to the internal oscillator driver. You will need to check the specs before programming if you use a different one, as you may need to change the load capacitance from the sample code. ULN2803 is fine with the LED displays you selected, but see the following for why I don't think you want to go this way.. They are common anode, so each channel of the IC will pull down a a segment for each display, power supply permitting. The non transistors are not what you want for the high side at 3.3V, as you will drop 1V (give or take) across the uln2803, and another 0.7V across the npn transistor (maybe more with drop in the MSP430 output) on the anode since it will need to be used as an emitter follower. This leaves about 1.6V for the LED and current limit resistor. The LED needs 1.8 min (up to 2.2v), and it is a good idea to have at least 0.5v minimum across the limit resistor, with 1.0v or more being better. You won't get the segments to light reliably, much less be able to balance the current through them to get uniform brightness-- the brightness is proportional the current. Given this, I would suggest following the advice to use an integrated OLED display, if you can. If you want to go with the 7-seg units, there are a few options that I will outline: 1) Use a pnp transistor in common emitter at the anodes with an npn to ground as a first gain stage from the MSP430 output. You will need current limiting resistors at the bases of the npn, and between the pnp bases and npn collectors. 2) use a low drop LED current driver array instead of the uln2803, if you can find one with lower than 0.5V drop. Then you won't need limit resistors for the LED segments, as that will be done by the IC (using current mirrors internally). 3) Use a higher drive voltage for the LEDs. This will require a little more work for the anode switching, but option1 will do the trick. Using this with option 1 lets you use a larger limit resistor for the LED segments, giving more uniform brightness. Note that the schematic on the page you linked to is for an arduino, which runs at 5V, thereby providing some margin for the current limit resistor. dubnet and Fmilburn 2 Quote Link to post Share on other sites
enl 227 Posted September 16, 2015 Share Posted September 16, 2015 As an additional note, if you are willing to let the brightness be moderately low, you could get by without the uln2803, as each output will only be driving a single led at a time, and use the npn transistor as an emitter follower. The display you selected is 20mA max continuous, 30mA peak. The outputs of the MSP430g2553 can sink 20mA with about 0.5V to 0.7 drop at 3.3V (SLAS735J fig7), and a total of 48mA sink or source (SLAS735J P24), and will have a drop of a bit less than 0.25V at 5mA sink. This suggests to me that if you limit the current of the LEDs to 5mA or so, you can pick them based on a drop of 3.3V-2V-0.6V-0.25V=0.45V (drop at 5mA from graph, emitter follower drop presuming <0.5mA base current at high, and midrange drop of LED) with a max sink of 35mA. This is in the safe, if not ideal, region of design, giving a limit resistor of 100 ohms (nominal current will be about 4.6mA). At 91ohms (5% series, but not one many people keep in the quantity of the factors of 10) you would be, nominally, right at 5mA, but with brightness more sensitive to variation in components. at 120ohms, you'd be at 3.75mA. As I said, going this way you will be at the dim side. The 100ohm will put you at about 1/2 or a tad less of the perceived max brightness for a single display run without multiplex. The numbers make it look like about 1/13 (1/3 of 1/(20/4.6)), but, due to the flicker of multiplexing, it is perceived brighter than the actual average, and the human eye is non-linear on top of that. Would I do it this way for NASA? no. For a commercial product? This is a lot less sketchy than many things done in commercial products, and is well within the data sheet specs, so I absolutely would, given the savings in component cost and size. Edit: attach circuit schematics to show described options, drawn crudely with clipart and MS PAINT, because they are handy on my beater laptop. I don't think I made any major errors. Edit 2: left out the base resistor on the bottom right. I really shouldn't do these on MSpaint during a useless meeting...... Fmilburn 1 Quote Link to post Share on other sites
terjeio 134 Posted September 16, 2015 Share Posted September 16, 2015 Well, here is the modified OLED driver code - it has a function for displaying a 3 1/2 digit numerical value (range is -1999 to 1999) utilizing the full width of the display. It supports both SPI and I2C (set in OLED.h) - main.c contains a demo. It is for CCS - I am not using Energia. Be aware that sometimes OLED displays can be a bit tricky to get working - there are subtle differences between the various versions available... OLED Driver.zip phenyl 1 Quote Link to post Share on other sites
roadrunner84 466 Posted September 17, 2015 Share Posted September 17, 2015 Edit: attach circuit schematics to show described options, drawn crudely with clipart and MS PAINT, because they are handy on my beater laptop. I don't think I made any major errors. How about (considering the rightmost schematic) a single PNP on the anode and an NPN on the cathode. This would save you an entire transistor per anode. The only drawback is that you'd need to drive the anodes inverted (so make the pin low to get the transistor to conduct). Quote Link to post Share on other sites
enl 227 Posted September 17, 2015 Share Posted September 17, 2015 @roadrunner: Single pnp directly driven by the output of the MSP430 might be ok, but, given the current requirement of the LEDs with all segments on, the base current would likely be enough to cause significant drop at the pin. In itself not a big issue,but the variation between, say, a 1 and an 8 would cause a visible difference in brightness, given the low drop across the current limit resistors. Remember, that transistor is driving all 7 anodes. Also, that would not allow for a higher anode supply than the 3.3V of the MSP430. Higher supply for the LEDs gives more stiffness in the current against load changes, and, therefore, more stable intensity. Quote Link to post Share on other sites
JohnDough 1 Posted September 17, 2015 Author Share Posted September 17, 2015 Hi,@@terjeio, @@roadrunner84, @@yosh, @@enlThanks alot for your help !I'm convinced to first try an OLED screen.So as far as I understood, I dont need the ULN2003/ULN2803,and the transisors.So here is my revised list:(Also removed "Crystal 32kHz" as it should arrive with kit)1) 1 x "TI LaunchPad MSP-EXP430G2" (with breadboard and wires)2) 1 x "voltage regulator 3.3V" (to use 9V battery): https://www.sparkfun.com/products/5263) 1 x OLEDRegarding the OLED:I need someting in size of 1.3",and I found this one:http://www.amazon.com/SainSmart-Serial-128X64-Module-Arduino/dp/B00MQK273K/ref=sr_1_2?ie=UTF8&qid=1442505406&sr=8-2&keywords=oled+1.3&refinements=p_85%3A2470955011I can find cheaper on eBay, but for a test, I prefer from Amazon so it will arrive fast.But, almost all OLEDs state they support "Arduino, MSP430" etc.This one in particular "I2C/IIC Interface",not mentioned SPI.Some note the driver chip, SSD1306, other SH1106.Also found this thread about usability of SH1106http://www.avrfreaks.net/forum/interfaced-sh1106-driven-oledSo what should I look for when looking for OLED,so it will be simple to use, only SSD1306, else ?Thanks for your help,Regards. Quote Link to post Share on other sites
yosh 121 Posted September 17, 2015 Share Posted September 17, 2015 I would say that the 1306 is a good choice, there are already libraries available, for energia for example. I use the I2C type for quite a long time now without major problems. Sometimes you have to make small changes in the initialization routine, but that is easy. I made some posts here in the forum where I use the oled I posted earlier, maybe you can have a look... Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.