text
stringlengths
83
79.5k
H: How does the input circuit on this oscilloscope manage to accept such a large range of voltages? I recently bought this ($45!) oscilloscope: http://www.gabotronics.com/development-boards/xmega-xprotolab.htm. Looking at its schematic, I see the circuitry for one of the two analog input channels: The website says that the scope can handle -15 to +20V per analog channel. The oscilloscope is based on the ATxmega32A4U microcontroller. According to the website, each input pin can handle 1.6 to 3.6V. It looks like the scope's circuit uses a voltage divider and then an op-amp. My question is this: How are circuits like these generally designed? For example, how are the parameters for the voltage divider and the op-amp's feedback resistor calculated? AI: This circuit is fairly simple. First, most Oscilloscopes have an input impedance of 1 M\$\Omega\$. This is implemented in the above circuit by the resistor divider composed of R2 and R3 (assuming the TL064 has a infinite input impedance). This divider also divides the voltage by \$\frac{R3}{R3+R2}\$, which in this case is equal to 0.12. Second, the signal is fed through a non-inverting amplifier, with some small amount of gain (equivalent to \$1+\frac{R7}{R8}\$), or 1.111.... Finally, and offset is injected into the signal through the voltage divider composed of R1 and R4, and C2 serves to remove any high-frequency noise. The actual design work is fairly simple. In this case, the ADC has a reference of 2.048 volts. Therefore, you need to bias your signal so 0V input results in 1/2 full scale (which is 2.048V), or 1.024 volts at the ADC input. This is the motivation behind the R1/R4 voltage divider. The input of the ADC is of unknown impedance, and presenting a known, fixed impedance to whatever you are connected to is a desirable thing to do. This is the motivation for the input resistor divider. Lastly, you have to set all your values so that when the input voltage is at the maximum voltage you are interested, you are at or close to full scale on the ADCs. This can be done by adjusting the Op-Amp gain, or the input voltage divider (or both together). The circuit is certainly bare bones. The TL064 is not a great Op-Amp, and if you pull the input voltage too low, the output of the voltage R1/R4 divider will go below 0V, and you will begin to pull current through the ATMEGA's integrated protection diodes, which is generally a bad idea. There should be some Schottky diodes to clamp the input to the ADC if it deviates beyond the supply voltage range (either positive or negative). It shouldn't have too much trouble if the input goes too high, since the output of the TL064 can only swing to within ~1.5V of the power rails, which would prevent it from getting too high (since 5 - 1.5 = 3.5, and 3.5 / 2 = 1.75). On the other hand, I'm not sure if the op-amp can actually swing high enough to actually use the whole ADC range.
H: Altera DE1 Board Read KEY? I need to press and hold key 1 and than press key 2 to increase value. How to Read keys only if both keys are pressed. This is what is have which is not working correct. (programming languages vhdl). if key(0) and key(1) are pessed do somthing PORT ( KEY : IN STD_LOGIC_VECTOR(3 DOWNTO 0); ); SIGNAL A, B, C, D : STD_LOGIC_VECTOR(1 DOWNTO 0); BEGIN A <= KEY(0) & KEY(1); B <= KEY(0) & KEY(2); C <= KEY(0) & KEY(3); Readkey: process(KEY) begin if (A = 1) then D <= "00"; if (B = 1) then D <= "01"; if (C = 1) then D <= "10"; end if; end if; end if; end process; AI: I'm not surprised it's not working. Now, I don't know the slightest thing about VHDL, but I do know about programming in general. Firstly: INDENT YOUR CODE With no indents the code is all but unreadable. Here is your code indented properly: PORT ( KEY : IN STD_LOGIC_VECTOR(3 DOWNTO 0); ); SIGNAL A, B, C, D : STD_LOGIC_VECTOR(1 DOWNTO 0); BEGIN A <= KEY(0) & KEY(1); B <= KEY(0) & KEY(2); C <= KEY(0) & KEY(3); Readkey: process(KEY) begin if (A = 1) then D <= "00"; if (B = 1) then D <= "01"; if (C = 1) then D <= "10"; end if; end if; end if; end process; Now you can see one major flaw in your code at a glance. C being 1 will only be tested if B is 1, which itself will only be tested if A is 1. The if statements shouldn't be nested like that. Secondly, (again, I don't know VHDL) is how A B and C are being assigned. In a classic programming language you would need to assign the incoming values to A B and C every time you want to test them, otherwise you won't ever see any changes. This may not be the case in VHDL, but it's something to look more closely at.
H: Suggestions for DC/DC converters with digital control I am under quite some time pressure and I need to put together a document about how several DC/DC converters (preferably buck) with digital control compare to each other. I am pretty clueless, I have already pored over tons of datasheets, but I got little useful data, most of the converters out there have analog control. (Maybe I'm just so bad at finding anything on the web...) What I need is something like the UCD74106 from TI. It should have an external PWM input which can come from e.g. a microcontroller. The specs I am looking for are: V_in = 48 V V_out = 1.3 V to 24 V (programmable) single input/single output can be paralleled any power range It would be nice to have datasheets with efficiency curves. Something like 'typical efficiency is blah-blah %' is not very helpful... EDIT: Other examples of what I have in mind: NDM1-12-120 and NDM1-25-120, both from CUI EDIT 2: I need the efficiency curves to see how the converter behaves at partial load. Also I am interested in finding the (approximative) load current at which the maximum efficiency is achieved (usually below rated current). And yes, I need digital control! This has been explicitly stated in my assignment... The idea is to be able to reprogram the converters whenever necessary and to make them SMB/PMB capable. I listed the datasheets to show, what I have found so far and to give an example of what I would like to have. Unfortunately 3 are not enough... I'd need a dozen or so. AI: Two things to think about. First, even "analog" power supply control chips can be "digitally controlled", whatever that really means. A little external tweaking of the feedback and the output voltage can be varied. Many have shutdown inputs, but of course that can be accomplished other ways too. Second, for fancy switching power supply control you can use a microcontroller directly, and obviously have all the digital control you care to program in. There are whole families of microcontrollers specifically intended for this sort of application. They have fast A/Ds, decent computer power, and fancy PWM modules that not only have high resolution but additional features like external shutdown modes, complementary outputs, etc. Check out the dsPIC 33F line from Microchip. All the high end switching power supply applications we've dealt with in recent years have had a microcontroller doing the closed loop control. Dedicated chips are more for simple power supplies, like running the microcontroller.
H: Issues with resistor heating, for an LED? I am direly confused on this. I've used 220 Ohm resistors in the past for all of my LEDs (at least that I can remember), however nothing on my arduino+breadboard with a few leds on the 5V breadboard rail had worked. I finally looked at the data sheet for the LEDs from the overseas place I ordered them from, and they seemed to require 35mA or so rather than 25. I calculated that to be ~80 Ohms (5V-2V(drop) = 3V / 0.035A) = ~85 Ohm. This explained perfectly why they had not started working, so I pulled out a 100 Ohm (which read out to about 95 with a multimetre) and set it up. Now the LED did not light, to my surprise, feeling the resistor which was just out of curiosity felt sharply cold - of course realizing that it is so hot it overloaded the nerve endings on my fingers being too hot to touch. My rough calculations were: 3V / 95 = ~35mA, and 3V? * 0.035A = .105W, seemingly not enough to cause much heat at all, especially over 3-5 seconds and being rated for ~.25W Can you understand what I am doing wrong, or what could be going wrong? My circuit is just 5V pin -> breadboard -> 100Ohm resistor -> LED -> Ground pin. I just cannot make sense of it. edit: I very recently shorted an LED without a resistor from 5v->gnd, possibly damaged something.. AI: I've used 220 Ohm resistors in the past for all of my LEDs (at least that I can remember), however nothing on my arduino+breadboard with a few leds on the 5V breadboard rail had worked.  Blindly using a value based on lore or superstition instead of math is a bad idea. I finally looked at the data sheet  Wow, what a radical idea! Just imagine, now the people that design a part do the careful research, find out its parameters, and publish them. We can read their results and recommendations and use mathematical calculations to decide how best to use the part and have a good idea up front what it will do. No more waving of dead fish during a full moon. This changes everything!! This explained perfectly why they had not started working  No, it doesn't. The maximum current rating is just that, the maximum the LED can take. The light output of a LED is pretty much proportional to the current thru it. While your LEDs could have been driven with 35mA, they would certainly have lit up noticably at half that or a quarter of that unless perhaps you were viewing them in direct sunlight. Humans perceive light intensity logarithmically, not linearly. That means each halving of light level looks like a fixed increment to us. For example, the sequence of 100%, 50%, 25%, and 12.5% of max brightness will look like roughly even steps towards dark to us. So was the resistor really hot or cold? I've touched a few hot parts in my career, including getting burned a few times, and it's never felt cold. Really hot feels hot, and you have a reflex reaction to pull your hand back before the brain engages in concious thought. This concept of overloading the nerve endings makes no sense, and makes me think it really was cold and you just somehow convinced yourself it was hot. You are right, a 95Ω resistor with 3V accross it will dissipate about 100 mW. That is enough to make a 0805 obviously hot, but shouldn't burn your finger. A 1/4 Watt thru hole resistor should be noticalby warm but not so hot you can't hold it for a while. Something is not as you think, but it's not clear what. Have you tried the LED in both orientations? It sounds like it is hooked up backwards and therefore not lighting. I would use a 300Ω or so resistor with your 5V supply and try several different LEDs. Just about any LED you are likely to get can take 20mA, so the 300Ω will limit the current to well within the safe operating range while still allowing for plenty of brightness indoors on your bench. If in doubt, get another known working LED from someplace and figure out how to make it light. Then substitute your LEDs trying both orientations. If they don't light, then they are blown.
H: What does it mean when multimeter accuracy is marked as: ±0,03%+10Digit? I have a digital multimeter and its accuracy for VDC is marked like this: ±0,03%+10Digit This multimeter has maximum display of 80000. So in the 80 V range it can show for example 79.999V. 0.03% of 80V is 0.024V - that is clear for me. But what does the +10Digit mean? The device in question in Digitek DT-80000. AI: The 1 digit means that the least significant digit can be off by +/- 1. In this resolution 1 digit would mean +/- 0.001V. 10 digit means that basically of your 79.999V displayed, it could also be 79.989V (not including the 0,03%!) So basically in your range the 10 digit specification means that +/- 0.03% + 0,01V is your error. For measuring 79.999V it means an absolute maximum error or +/- 79.999*0.03% + 10*0.001V = 0.034V.
H: TVS Diode Layout I have two DB37 connectors on my board which ultimately connect to a CPLD. All of these connections/signals are inputs to the device. To protect from ESD I am using TVS Diodes ESD9C3.3ST5G. I have the board like so: DB37 -> Diodes -> Pullup resistor -> CPLD. The 1K pullups are for a different purpose and are not related to ESD protection. My PCB is 4-layers with the following stackup: Signals Ground 3.3V Signals The diodes connect to the ground using a via. The trace to the via is thick - thicker than the trace to the CPLD. The ground plane is completely unbroken with the exception of through-hole pads and vias. I assume this protects against at least some mild ESD. But what do I need to do further? This is not a commercial device and will be used internally - however I do need it to be reliable. One of the things I thought was to add series resistance (22 Ohms or so) between the diode and the CPLD. However, as all the pins on the CPLD are inputs so they're already high-impedance. The ESD should go towards the ground via the TVS diode. Is my assumption correct? I have also read that adding a capacitor in parallel with the diode can help. My signals aren't high speed so this shouldn't distort them much. However, do note that I'll have to 74 of these caps as I have 74 signals. So before I went and added these I wanted to know if this was worth it. Here's a closeup of the layout: Finally, one last question - the above described the input side of my board. The output is similar in the sense that I have two further DB37 connectors and a CPLD. In this case, the CPLD's pins are outputs. The layout is like so: CPLD -> MOSFET -> DB37 In this case, I don't have any diodes. However, as I've read recently, MOSFETs are far more sensitive to ESD than other devices, should I add diodes here as well? The MOSFET's drain is connected to the DB37. This DB37 is then connected to the input-side DB37 described earlier. If a MOSFET is on, it's drain-to-source resistance would be quite low. And as such, this could prove an attractive path for the ESD pike to go through rather than the TVS diodes on the other end. Am I correct that I should add TVS diodes here as well? If so, oh boy, 72 more diodes! AI: The TVSs on the inputs makes sense and your layout looks reasonable. The question is how far do you want to go to get what level of protection? It's a probability game. Just the TVSs should take care of most ESD events. If you want to go a little farther, put a resistor in series with each input before the TVS, not between the TVS and the CPLD. This gives the TVS some minimum guaranteed impedance to work against. Going even farther, add a little capacitance accross the TVS. That will slow down the edges of really fast spikes so that the TVS can catch them effectively. It goes on and on, with each level of higher complexity decreasing the probability a damaging event will be encountered even further. Only you know what environment these boards will be in, the cost of the extra board space, and the cost of failure.
H: Why do you need 2 resistors when hooking up a transistor as a switch What is the point of R2 in the following diagram: I get that R1 controls the current to the Base, but what does R2 do? AI: The R2 resistor is used to bring the voltage on the base into a known state. Basically when you turn the whatever source of current you have at the other side of R1 off, the whole line would go into an unknown state. It may pick up some stray interference and that may influence the operation of the transistor or the device on the other side or it may take some time for the voltage to drop just with just the transistor base. Also note that the source of the current going through R1 may leak and that may affect the way transistor operates. With the R2, which is in configuration called pull-down resistor, we are certain that whatever excess voltage there may be in the branch containing R1 will be safely conducted into ground.
H: Open Source version of MOST? Is there an open source version of the MOST protocol? From the above link: MOST (Media Oriented Systems Transport) is a high-speed multimedia network technology optimized by the automotive industry. It can be used for applications inside or outside the car. The serial MOST bus uses a ring topology and synchronous data communication to transport audio, video, voice and data signals via plastic optical fiber (POF) (MOST25, MOST50, MOST150) or electrical conductor (MOST50) physical layers. MOST technology is used in almost every car brand worldwide, including Audi, BMW, Hyundai, Jaguar, Land Rover, Mercedes-Benz, Porsche, Toyota, Volkswagen and Volvo. AI: If by Protocol you mean available functional open source software, then maybe not. It's said to be coming from several and may or may not have arrived. If by protocol you mean protocol the "MOST cooperation site may be of value - but I'd expect that you were well aware of this already. Here is their specifications and procedures page including PDFs of last years version 3VOE2 and older 2006 Rev V2.5. MOST Specification, Rev 2.5, 10/2006 is 242 pages long and 3V0e2 is 262 pages. You have to register to access them but access is free. They'd probably allow the terminally enthused to build something from scratch BUT are probably not what you are after, Organisational procedures downloads here and here Background for interest from here MOST Protocol Gaining Ground By David E. Zoia Ward's AutoWorld, Nov 1, 2006 12:00 PM The Media Oriented Systems Transport networking protocol, which has worked its way into mostly high-end European cars over the last five years, is gaining traction in Asia and eventually could see wider use in North America, a key supplier says. Designed to allow onboard infotainment systems to talk to each other, while reducing wiring needed to connect devices such as DVD players and radios, the MOST operating standard is in place on 38 vehicle platforms (soon to be 40), say officials from Hauppauge, NY-based SMSC. MOST was developed by a consortium of companies, beginning in 1998 with OASIS (since purchased by SMSC), DaimlerChrysler AG, BMW AG, Audi AG and Harman/Becker Automotive Systems GmbH. It since has expanded to include 16 auto makers and more than 70 suppliers. Its first application was in the BMW 7-Series in 2001, but the migration into mid-range vehicles is growing, and the list of vehicles now employing the protocol includes some low-end models such as DC's Smart and Mitsubishi Motors Corp.'s Colt. Other vehicles with MOST networks include Mercedes A-, C-, E- and S-Class cars and the Porsche Boxster and 911. In using MOST in one platform, DC reduced the number of cables from six to four, cut cable length by 25% to 29.5 ft. (9 m) and eliminated two of every three conductors per cable, SMSC says. Likewise, cable costs were slashed more than half. Initially, the MOST standard was designed to work with plastic optical fiber, in part to eliminate electromagnetic interference (EMI) issues, but also because of its lighter weight and ease of recycling. But using plastic optical fiber requires wiring harnesses to be assembled differently, and that may have caused some auto makers to shy away from the technology. However, earlier this year, under the direction of Toyota Motor Corp., the MOST consortium developed a way to substitute inexpensive and easy-to-handle unshielded copper wire in place of optical fiber, allowing OEMs to employ MOST while maintaining existing production methodologies.
H: What is this component (labelled L1)? What is this component? It looks a bit like a capacitor, but not exactly, and it is labelled L1 on a small circuit board where there are capacitors labelled C2 and C3… AI: An inductor. Essentially a coil of wire round a ferrite core. Here's one without the heatshrink around it:
H: Please help identify this diode This is a part from a (severely amateurish) Piezoelectric transducer amplifier circuit. I am looking to identify this diode so that I can find a datasheet for it as well as possibly purchase more. The original circuit PCB is shown below. I have drawn a schematic of the board (also below). Note that the marking in this circuit is of a zener diode; this is an error. AI: In the circuit you show (copied below) the diode can be replaced by a 1N4148 or 1N914 or any small signal diode. BUT there should also be a small series resistor as, as shown the diode will load down the transducer on positive half cycles. Can you show us that circuit in its original context? Piezo transducers usually require "all the voltage they can get" and it is unlikely that the loading is intended. The diode is shown as a Schottky (signified by the squared bars on the end of the cross line on the sysmbol) BUT that is probably due to the user choosing a symbol that was "about correct). I'm surprised that you say that "it goes" as the circuit has either been designed by a grand master first class with honours or thrown together by someone who has a very poor understanding of how an op amp works. That's not meant to be rude - it's just that it would be a miracle if it works - so it it does it's either masterful or a product of advanced playing. LM741 pinout below. The LM741 is being operated from a 6V (low) single supply (far from rail to rail) Circuit is negative rail referenced - LM741 is not rail top rail and results are highly unpredictable but tending towards death. Pin3 non inverting input is ground referenced with no formal bias above ground. Input bias current in R2 and input offset voltage will set pin 3 at "unknown". Vout/pin 6 to Vin_Inv/pin2 + R1 + piezo may make an oscillator and transitions of piezo below grund MAY provide comparator action from IC. Or not. SO Change opamp to LM324 or LM358 Chnage pinouts to pins with same names on eg LM358. Add 10k from pin 3 to B+ Add 10k to start in series with LED and diode. Make diode shown a 1N4148 or similar. Maybe add small cap across LED. (0.01 - 0.1 uF)
H: Copper PCB traces not connected? I'm still really new to electronics. I'm trying to get used to reading PCBs and what not. I just got a new multimeter and I wanted to test it out so I was using the continuity test on the board's copper traces. But what's really weird is it was saying that a point on the trace isn't connected to another point on the same trace. To clear up what I'm trying to say, here's a pic: The multimeter's continuity test says the connection between A and B is open. I also measured resistance and it said it was infinite. To be sure it wasn't the multimeter I tested it on the below strips of solder and the continuity test said it was connected as it should. So am I completely misunderstanding how these PCBs are made? Is there some kind of coating on the top of the traces that I can't see? Thanks a lot, mikfig AI: The copper is covered with solder-mask, a sort of resin. You need to scrape it off, or use sharp pointed probes.
H: Is it safe to disassemble an unpowered PC power supply? Once a typical PC power is unplugged, is there any danger of receiving a shock while disassembling it? Are there typically high voltages stored that one should be aware of? context: removing a cooling fan from an obsolete but functional power supply before recycling. Safety note to readers: this is a very general question, and the answers will indicate general guidelines about typical power supplies. Observe caution and refrain from performing any activity (such as touching wires or components with your bare hand) that you have not confirmed as being safe in your circumstance. AI: Assume: Typical PC power supply = AC mains powered. There is a short term risk of electric shock from capacitors - principally the two large capacitors used in a "half bridge' arrangement in many PC supplies. These are arranged in such a manner that the supply may be switched between nominal 230 VAC and 110 VAC easily. These capacitors will happily kill you if you let them. Discharge time for main capacitors is usually seconds with a supply designed to do this. It can be minutes. Worst case you MIGHT expect hours. You'd be most unlikely to find them alive after a day. [If you do, note the brand and buy them in future]. In any case, when dealing with large capacitors that have had high voltage on them I will short them with a piece of wire or screwdriver tip etc. Note that some capacitors will "recharge themselves" partially due to dielectric absorption. This can take place over minutes and can be exciting. Not usually a major issue but be aware of it. "The book" will say you should use a resistors, insulated probes and safety glasses. Using an insulated screwdriver tip, turning your head, shutting your eyes and flinching will usually allow you to "safely" discharge "rather large" capacitors with HV still on them (as long as the source of the HV has been removed) but it can be hard on the nerves, you can get spattered with bits of screwdriver tip, it can make it hard to undo screws in future and the insurance company may refuse to pay your widow. ie use common sense. (Long long ago I did this with 1000 Volts on a cap and the supply still connected "not quite on purpose" - definitely not recommended. The screwdriver tip needed re-grinding :-) ) Other caps of note are the smaller X caps across phase - neutral and the Y caps from either mains lead to ground. These are usually high quality non polarised and MAY happily hold charge for a long time - test discharging them is a good idea. These are usually not large enough to kill (YMMV) but they can hurt badly, and reflexively jerking your hand onto something sharp, hot or live is a risk.
H: Advice on relay set-up I'm trying to build a Christmas light show, using a netduino (arduino clone). There are plenty of tutorials on the web, however they always lends themselves to US power supplies. Could someone please recommend to me the best way to switch a 10A 240V power suppy (x8 for different lights) via the 5v arduino supply? I can't cut into the lights themselves, so I would be switching an extension cable, hence the high amperage. I have found suitable relays online however they are rated at a 12v switching supply. Thanks!! AI: There are plenty of 5V relays available. The trick is getting ones that switch a high enough current. If you can't find one, then use a 12V one and power it with 12V. Whether you're using a 5V or a 12V relay you'll require something between the Netduino and the relay to be able to provide enough current to switch the relay - be that a transistor, or a chip like the ULN2803. Either of these can switch 12V as easily as 5V. If you want to use the ULN2803 with the Arduino/Netduino I have designed a handy shield you can etch yourself with Toner Transfer. The other option (which will be much quieter, albeit at more cost) would be to use a "Solid State Relay". This is essentially an opto-coupled triac which does the same job as a relay but without any moving parts (except photons). These, being opto-coupled, use about the same current to switch as an LED uses to light up, so can be linked direct to the Arduino/Netduino with nothing more than the normal current limiting resistor for an LED. Added RM: Majenko's 'shield' implements this circuit. Its a good useful universal driver circuit. Note the connection of pin 9 to V+. This connects the on chip catch diodes to supply to dissipate stored energy in the relay coils when they are turned off. If you don't make this connection you will end up with an exciting high voltage generator - possibly a short lived one. (Circuit from(here) which does not give any other detail.
H: Brushless motor specs to maximize stall torque I'm interested in a brushless motor having a high stall torque (not much in RPM). What specifications of a BL motor would give a fair indication of its stall torque, provided that voltage is fixed ( 12V ) current is also fixed ( say 10A max ) I'd like to identify quickly from a list of motor specs (found on the Net) what to expect from a torque point of view. For instance, number of poles, kv, weight, diameter, length... AI: Rushing. More later maybe ... Note that "stall torque" is often used to mean locked rotor 0 RPM torque BUT you use it in the sense "dropout torque at a given speed". That's entirely fine as long as you note that some references will mean the former and not the latter. Criticism (kind / constructive) welcome. Written at a rush and unchecked. Better is possible. See writer "Toper925" comment here He notes: There really is no single equation that fits all states of a PMSM but this one works in general: Te = 1.5p[λiq + (Ld - Lq)idiq] Where: p is the number of pole pairs λ is the amplitude of the flux induced by the PMs in the stator phase Lq and Ld are the q and d axis inductances R is the resistance in the stator winding iq and id are the q and d axis currents I'd need to read more on what he said to make total sense. Stall torque is when torque is not sufficient to "pull in" the next rotor pole piece using the available magnetic field. SO, I'd expect More pole pairs better. I'd expect better than linear gain as distance halves with doubled pairs BUT magnetic force at worst falls as distance cubed (only a considerable number of magnetic pole diameters away so not in most sensible motors), comes closer to falling with distance squared as gap falls to near pole width and at best can only approach linear at close proximity. SO more ples should give less interpole distance so ... (but pole sizes are down so ...). Torque = power per rev. If the power falls faster than RPM your margin is dropping until you reach the point of no pull in. At a quick glance I think that this is what this man here is alluding to about half way down below the graph. Leading to ... If you have a power curve you also have a torque curve as the two are related by motor rpm. (Torque = k x Power / RPM). If you have a speed-power plot for you load you should be able to overlay this on torque curve and see where load torque is > generated torque. This will be better than real world (probably). Lowest R should help as it allows greatest I but this is really a secondary effect for two motors with the same power at the same RPM. Induced flux should play an immense part. I'd expect non saturating magnetic (eg steel) cores to provide superior results EXCEPT if you can get all gaps so small that field is well maintained by magnet. Rule of thumb is you can get about 0.5 Tesla at an airgap of 1/2 a magnet diameter using a top class NdFeB magnet. Say N52? N45 won't be too bad. Note that the US process NdFeB magnets are cast but ground and sintered subsequently and are inferior in max possible flux to the Japanese versions. This should all be covered in the flux spec.
H: npn transistor base current question Hi i am new to using transistors for signal amplification. Can someone explain to me how to figure out the amount of current being drawn into the base of the transistor when it is in the common emitter configuration. ( see link below for circuit diagram). I would also like to know what else i would need to do to create a crude Class A audio amplifier. AI: You have a crude Class A amplifier there now. Input to base. Output from collector. Gain is about Rc/Re = 10k/1k = 10. Brief answer re base input current appears at "cut to the chase" below, but ... Close enough, Ib = (Vdd x Rbu/(Rbu+Rbl) - Vbe) / Re / Beta Don't even start to try and wonder about it or which resistor is which. By the end it should make sense. Calculate voltage at base point with transistor removed. Call 110k = Rbu= R_base_upper. Call 10k connected to base Rbl = R_base_lower. Call Voltage where base connects Vb. Call 20 V supply Vdd Vb = 20v x Rbl/(Rbu+rbl) = 20 x 10/120 = 1.666V. V base to emitter = Vbe Vbe for an operating silicon transistor is about 0.6V Can be somewhat different but use 0.6V for now. As Vb = 1.666V then Ve = Vb - Vbe = 1.666 - 0.6 = 1.066V. Ve appears across Re (1K) so I_Re = 1.07/1000 = 1.07 mA. We can call this 1 m or 1.1 mA close enough for this example. I'll use 1 mA for convenience. Now "it happens" as a function of the formulae related to transistor action that the impedance of the emitter is 26/I for I in mA. "Don't ask why for now" is good advice. The answer is - because as you will discover in due course, that's the way it is. So at 1 mA Re =~~ 26 ohms. At 2 mA Re = ~= 13 ohms. At 0.5 mA Re ~= 52 ohms. This is the effective resistance of the emitter junction to current flow. I'll call that Rqe rather than Re as I've already used Re as the external emitter resistor. Call transistor current gain Beta, because that's what it is traditionally called for traditional reasons. If you look into the base you effectively see Re multiplied by the current gain of the transistor. That's because for every mA that flows ij the emitter circuit you only need 1/Beta as much in the bases ciurcuit to control it so it APPEARS that the resistance is beta times as large. Assume our example transistor has Beta = 100. This is well inside the range of normal for small signal transistors. Looking into the base we see Beta x Resistance in base circuit = Rbase to signal = Beta x (Re + Rqb) = here about 100 x (1000 + 26) = 102600 ohms or ~= 100 k ohms. Note I said "to signal" as DC will or may have its own rules. (All obey the same rules but other factors affect what is seen - eg if we put a 10 uF capacitor across Re it is approximately 0 ohns to AC at audio signals so "vanishes". I said before that gain was ~= Rc/Re = 10 That was before we allowed for Rqe and before we bypassed Re to remove it for AC. If we do the above gain becomes about Rc/Rqe = 10000 / 26.4 =~ 385 Cut to the chase: Now, during the hand waving and mirrors we hid something. I said Vb worked iut at 1.66V. The current down the Rbu + Rbl string to ground will be i=V/r = 29/(110k+10k). This current is just enough to set Vb = 1.666V as we calculated BUT with 1.666v on Vb the same current will flow via Rbl to ground. ie no base current will flow. Your original questiion was "how much base current" and that seems to say "none". However, with no base current the transistor will turn off, Ic will drop, Vre will drop and so Ve will drop causing more than 06V to appear on Vne so the ransistor will turn on and restore. Vb will fall just enough to draw the extra current needed fro Rbu and to reduce the current in Rbl. It will do this automatically and it will draw "just the right amount". JTRZ (h=just theright amount is enough such that Ib = Ie/Beta. So we see that is more and less to what happens than appared. The correct example is dynamic and needs load lines on a graph. But "bood enoug" result goes. Based on above. Vb = 1.666V so Ve = !.066 V. I_re = 1.066/1000 = 1.066 mA. ~+ 1.1 MA as before. BUT beta = 100 so Ib = Ie/Beta = 1 mA/100 = 10 microamp. Close enough, Ib = (V+ x Rbu/(Rbu+Rbl) - Vbe) / Re / Beta After going through the above that should not be as scary as it would hev been previously. E&OE - could easily have typo'd something there. Please point out if errors seen.
H: How do I make a real-world verison of this LC circuit? I'm trying to build the LC oscillator show on the bottom of this page for some school project and I'm having a bit of problems translating the theoretical circuit into a real-world one. Here's the schematic: I think I get how the circuit works on paper. We have a LC resonant circuit which will produce a certain output frequency. Because the energy in the circuit gets transferred out due to differences between theoretical components and real world components, the transistor is there to keep adding the energy into the circuit. The transistor is controlled by the coupled coil L2 in which we get current induced by the coil L which keeps switching the transistor For the real world circuit I can use more or less whatever components I want, so my main limitation is that I only have a 1.2 mH 1:1 transformer available. In some simulations I used that transformer and a \$ 470 \mu F\$ capacitor (I just happen to have one in my drawer) and the expected frequency should be around 212 Hz. For some reason, the simulations don't seem to be working as expected and I can't figure out why. For example here's a link to falstad circuit simulator and it's showing bad connections. I also only get the bottom half of the sinusoid. In Multisim, I'm getting flat line on the oscilloscope with this circuit: I don't know how to pick a right transistor for this circuit so I just took 2N2714 randomly. Here's my question: How do I figure out why this doesn't simulate well and how do I determine what I need to look for when picking a transistor for the circuit? UPDATE Here's a new link for falstad simulator and it's an improvement. I'm still not getting expected oscillations from it though. AI: Transistor is zero biased for DC. Just out of head but try. Lift ground end of T1 primary off ground then Connect 1k to ground from end of winding. From same point connect 4k7 to V+. If no action or not ideal adjust say 4k7 up and down and observe. BUT As above plus. Disconnect emitter from ground and connect 100 ohms to 1k from emiter to ground. And connect a capacitor from emitter to ground. The transformer at 1:1 is feeding back FAR more than is needed. Here's another variant: Disconnect BASE end or primary from base. Connect a 22k and 1k in series to ground from primary end. (Primary end - 22l - 1k - ground Connect a 0.1 uF from 22k/1k tap to base. Connect a say 100k from base to V+_ May need another resistor base to ground such that vbase is about 0.7V nominal DC. Adjust 22k in 22k/1k divider to change feedback magnitude. This is not an ideal way to vary feedback level and I have not tried to calculate impedances of inductors at frequency etc - very much 'out of head' values BUT I'd expect it to "sort of work". If you get amplitudes which are either too small and decay or which grow, try connecting an NTC thermistor or lightbulb in series with the cap to the base. You'll need to play with levels and values. There are better ways of doing this but the Red Queen is chasing me so ... . Report back ...
H: What are the advantages of using FPGAs over TTL in intro computer architecture? I teach the one and only computer architecture course at a liberal arts college. The course is required for the computer science major and minor. We do not have computer engineering, electrical engineering, other hardware courses, etc. My primary goal in the course is for students to understand all the way down to the gate level how computers work, which I believe they learn best through a hardware lab and not just through a textbook (Computer Organization and Design by Hennessy and Patterson). My secondary goal is to excite them about computer architecture and increase their excitement about computer science. Preparing them directly for industry is not a goal, although motivating them to study more computer architecture is. The students have generally not had any experience building anything or taking a college-level lab course. Typically, 10-15 students take the course per semester. I have been teaching the course since 1998 in a manner similar to how I was taught computer architecture and digital electronics back in the late 1980s at MIT: using DIP TTL chips on powered breadboards. On the first hardware lab assignment, students build a full adder. About halfway through the semester, they start building a simple computer with an 8-bit instruction set. To reduce wiring, I provide them with a PCB with some of the electronics (two D flip-flops, two 4-bit LS 181 ALUs wired together to act as an 8-bit ALU, and a tri-state buffer). On the first of these labs, they derive the (very simple) control signals for the two instruction formats and build the circuit, entering instructions on switches and reading results from lights. On the second of the labs, they add a program counter (2 LS163s) and an EPROM (which my original question was about, before it switched to how I should teach intro architecture). On the final lab, they add a conditional branch instruction. While the students spend a fair amount of time wiring and debugging, I feel that's where much of the learning takes place, and students leave with a real sense of accomplishment. People on this forum have been telling me, though, that I should switch to FPGAs, which I haven't worked with before. I'm a software engineer, not a computer engineer, and have now been out of school for a while, but I am capable of learning. I wouldn't be able to get much money (maybe a few thousand dollars) for replacing our existing digital trainers. We do have a single logic analyzer. Given my goals and constraints, would you EEs recommend that I stick to my current approach of switch to one based on FPGAs? If the latter, can you give me any pointers to materials with which to educate myself? As requested, here is a link to the syllabus and lab assignments. Addition: Yes, it is a digital logic course too. When I got to my college, students were required to take one semester of each of computer architecture and digital logic, and I combined them into a single semester. Of course, that's a statement about the past, not the future. AI: Given the goals of the class, I think the TTL approach is fine, and I say this as an "FPGA guy". FPGAs are a sea of logic and you can do all sorts of fun stuff with them, but there's only so much that's humanly possible to do in a semester. Looking at your syllabus, your class is a mix of the logic design and "machine structures" courses I took in undergrad. (Plus, it's for CS majors. I'm all for CS majors having to face real hardware--letting them get away with writing code seems like a step back.) At this introductory level, where you're going over how assembly instructions are broken down, I see no real benefit to having students do things in code versus by hand. Doing HDL means learning the HDL, learning how to write synthesizable HDL, and learning the IDE. This is a lot more conceptual complexity and re-abstraction. Plus you have to deal with software issues. Generally the point of a course that uses FPGAs is to practice creating logic that is useful--useful for talking to peripherals, serial comms, RAM, video generators, etc. This is valuable knowledge to have, but it seems very much out of the scope of your course. More advanced classes in computer architecture have students implement sophisticated CPUs in FPGAs, but again, this seems out of the scope of your course. I would at the very least devote a lecture to FPGAs. Run through a few demos with a dev board and show them the workflow. Since you're at Mills, perhaps you could contact the folks at Berkeley who run CS150/152 and go see how they do things.
H: How to work with Dot Matrix LCDs? I am new to LCDs and I am trying to interface my LCD (used in Nokia 3310 cell phone) with PC via Parallel port. I searched on Google and I found many programs and schematics which can used to draw image on it. But I want to understand the actual functions of the pins of LCD named as VCC, RES, etc, so that I can develop my own program on C#.Net. The Pin arrangements are as follows: AI: You're going to want to get the datasheet for the device. I'm pretty sure it has a SPI serial interface which is pretty 'standard'. A better option than your parallel port might be to get a USB SPI device like the Bus Pirate. I think you'll find some routines on the net and you might look at Make or Sparkfun.
H: Arduino software serial - full duplex I need two serial ports for this Atmega328 Arduino project, but this processor has only one hardware UART. The processor, hardware design, and programming environment are already set, and I cannot change the hardware or processor at all, so a software solution is required. The included Arduino libraries provide a SoftwareSerial library which I have discovered is only half duplex - during the send routine, interrupts are disabled, which of course means that the interrupt driven receive routine is shut down. Before I implement my own full-duplex library, I wanted to find out if others have found a simple solution for this, or if there are libraries out there that implement it correctly. AI: I've not used the Arduino, but have written efficient soft UARTs on quite a number of platforms. Which approach is best on a given platform will depend upon what types of bit-munging operations it can perform most efficiently. I would offer a few suggestions, though: Assign maximum priority to the serial-polling ISR, and run it at preferably 3x the desired data rate. Sample all your inputs and write all your outputs at the start of this interrupt routine, and then figure out what the outputs should be for the next pass. This will help to minimize any timing skew that might otherwise be caused by variable interrupt processing time. For the receiver, instead of using a state machine as such, it may be helpful to effectively shift the incoming data into a big shift register. If the pattern of bits indicates a byte was received, grab the data and clear the appropriate bytes. ... near start of interrupt (for consistent timing) shiftreg >>= 1; if (IN_PORT) shiftreg |= 0x20000000; ... other interrupt logic, then... if ((shiftreg & 0x20000007) == 0x20000001) { int result = 0; if (shiftreg & 0000000040) result |= 1; // Note: constants are OCTAL! if (shiftreg & 0000000400) result |= 2; if (shiftreg & 0000004000) result |= 4; if (shiftreg & 0000040000) result |= 8; if (shiftreg & 0000400000) result |= 16; if (shiftreg & 0004000000) result |= 32; if (shiftreg & 0040000000) result |= 64; if (shiftreg & 0400000000) result |= 128; // Do something appropriate with result, then... shiftreg |= 0x3FFFFFFFF; } else if (shiftreg = 1) { ... Do something with long-break (will be detected exactly once) } Note that while the worst-case time may be significant, the normal-case time will be quite fast. Further, when an incoming byte is detected, one could copy it to another word of memory and do the bit-munging on a later interrupt. Since serial-transmit will only need to do something every third interrupt, the bit-munging could be done on interrupts where the serial-transmit routine doesn't run.
H: How does the gain factor adjustment on this current sense board affect the output voltage range? I'm looking at buying this simple current sensing board: http://www.sparkfun.com/products/8883. Here is its schematic: http://www.sparkfun.com/datasheets/Sensors/ACS712%20Low%20Current%20Sensor%20Board%20v12.pdf. The current sense chip outputs a voltage between 0 and 5v, depending on the current. The op amp on the board can then be adjusted to detect "very small current" changes. The op amp can be adjusted to have a gain between 4.7 and 47, but what does this mean? What is the minimum amount of current change the chip (link below) can detect? The current sense chip is this one: http://www.allegromicro.com/Products/Current-Sensor-ICs/Zero-To-Fifty-Amp-Integrated-Conductor-Sensor-ICs/ACS712.aspx. Edit I'm using the Arduino Uno's ADC, which has the same range as the output to this chip. So, win! AI: ACS712 datasheet here. 3 models available. Sparkfun say you have the 5A version. Datasheet says output of IC1 (page 5) is 180/185/190 mV/A min/typical max. Following amplifier gain is 4.7 to 47. So mV/A out ranges from 185 x 4.7 ~~~= 900 mV/A to about 9V/A. Vcc = 5V and opamp zeros at ~ 1/2supply so output can swing 2.5V (at best). 2.5V/900 mV =~ 2.75A full scale. 2.5V/9V ~~= 0.275 A full scale. ACS712 data sheet says accuracy is +/- 1.5% all up at full scale at 25C. Say 2% accuracy all up with 'a bit of other error allowed for'. Revisit later as required. SO if you adjust this to read say 2.5V/A and if your ADC will accept 2.5V full scale then you have an absolute accuracy of +/- 2.5*2% = +/- 50 mV. Or for he one Amp input +/- 2% = +/- 20 mA. This is specified as a fraction of full scale reading and it does NOT say it gets less at lower inputs. So at 12 scale you get 4% error, at 10% scale you get +/- 20% error. At 2% scale you are in the noise. 2% ~= 6 bits so an 8 bit ADC will handle this well enough. 10 bits better as then about no extra nose introduced by conversion. To answer the "minimum current question. Max gain was 9V/A or about 0.275 full scale. This gets "into the noise" at +/=- 2% * 275 mA ~= +/- 6 mA. E&OE.
H: Guidelines for sizing solar-powered electronics? Does anyone know of sizing guidelines or calculators for solar powering electronics? i.e. given power consumption, latitude and allowing for bad weather, accumulated dust and bird poop etc, calculate the size of solar cell and amount of storage to ensure that the electronics never run out of power? AI: Never is a long time ! :-) Obtain sunshine hours per typical day on a typical month at your location from the superb gaisma insolation et al site here. As you are in NZ Ive chosen the Wellington page. Th 4th graph down says the monthly mean insolation in kWh/m²/day Jan to Dec is as below. This is the equivalent full sunshine hours. Lowest is 1.4 hours/day in 6th entry = June 5.83 5.06 3.97 2.78 1.85 1.40 1.63 2.32 3.32 4.13 5.26 5.60 1.4 hours per day means over a 24 hour period you will get a mean solar Wattage per square metre of Watts = 1000 x 1.4/24 = 58 Watts per square meter of isolation = 5.8% of full sun panel power Solar panel efficiency = Zp typically ~ 13%. Bird poop degradation factor = Kbp = depends on cleaning etc. Say Kbp= 0.75. Average Wellinton June day = 1.4 sunshine hour/day but some days Watts ~= 0 So D = days you want to run with NO solar input. I'm going to stop naming K factors and lump them all into "Kother". Kother is a degradation factor comprised of all the factors you can think of MULTIPLIED together. Battery charge to discharge energy return - say 80% - depends on chemistry and several other factors. Temperature - about 90%of rated at 25C as panel gets hot. Panel matching to battery - addressed by eg MPPT controllers - Panel will be 18V oc for a 12V battery and energy loss without an MPPT controller will vary - say 80%. SO A Panel rated at say 100 Watts will power equipment run 24/7 in June in Wellington with a Wattage of 100 x 1.4 hrs/24 hrs x 0.75 bp x Kother (0.8 battery x 0.9 temperature x ...) / D days = 100 x 0.058 x 0.75 x 0.8 x 0.9 x ... =~ 3 Watts / D Below, Zp is allowed for by using the panel rated power. ie a 100 Watt panel will run 3 Watts of equipment in Wellington in June IF days are typical. If you get super black dark and stormy and want to last say 3 days with about no sun you get 3/3 days =1 Watt 24/7 per 100 W of panel with 3 days holdup. Pretty stunning ! Battery sizing = 1 Watt Hour per Watt of load x 24 hrs/day x D days holdup / Kbattery to load. Say a 1 Watt load and 3 days holdup = 1 x 24 x 3 / 0.75 say = ~= 100 Watt hours. E&OE !!!!!!!!!!! - the battery size and panel size don't seem quite correct. I may have dropped a figure somewhere there BUT the principle should be obvious and straight forwards A major aspect is getting the degradation factors correct. Ask questions if interested.
H: Why can my oscilloscope measure all frequencies equally well? I've got an oscilloscope that, according to the manual, looks like this (for AC): ---Cac--+-----+-------- | | Uin Cin Rin Udisp | | --------+-----+-------- Uin is the voltage input, Udisp is the voltage shown by the oscilloscope, Rin is the internal resistance and Cac and Cin are internal capacitances. I'm trying to find |Udisp/Uin| for different frequencies. So I rewrote this as follows with complex impedances: Uin---1/(j*w*Cac)--+-------------- Udisp | Rin+1/(i*w*Cac) | 0 ----------------+-------------- <=> Uin---1/(j*w*Cac)---Udisp-----Rin+1/(i*w*Cac)-----0 \_______Z1______/ \______________Z2_______________________/ Using Ohm's law, since the currents over both impedances must be the same, I get: Udisp / Uin = Z1 / Z2 However, this means that the measured amplitude (|Udisp/Uin|) does not depend on the frequency! I must have made a mistake somewhere, as the oscilloscope obviously can't handle all frequencies equally well. Where is the mistake? AI: I can see two problems here. Firstly, your analysis does depend on frequency. Replacing \$j\omega\$ with 's' for convenience, Z1 is given by :- \$Z_1 = \frac{R_{IN}}{1+\mathrm sR_{IN}C_{IN}}\$ ... from which the transfer function Z1/Z2 can be derived as :- \$\frac{\mathrm sR_{IN}C_{AC}}{\mathrm sR_{IN}(C_{IN}+C_{AC})+1}\$ This is a first-order high-pass function with a pole at a frequency \$\frac{1}{2\pi R_{IN}(C_{IN}+C_{AC})}\$ so your 'scope will display frequencies higher than this with no loss of amplitude ... according to your model. The second issue is that your model is incomplete. You are assuming zero source impedance and not taking into account the characteristics of the vertical amplifier which will roll-off at some frequency.
H: How do I know if which leg is the emitter or the collector? (Transistor) I'm new to electronics and here's a newbie question that I would like to ask: How do I know if which leg is the emitter or the collector in a Transistor (For both PNP and NPN) using only an analog multimeter? AI: This really works in practice. I've used it numerous times over the years. Required equipment: Meter with diode test or low ohms range. About 1 megohm resistor or a wet (licked) finger. Set meter to lowish ohms range such that a diode conduction can be seen - trial and error OR diode test if available. With an NPN transistor the base will have two diodes facing away from it. ie with most positive meter lead on the base the other two leads will show a conducting diode when the negative lead is placed on them With a PNP transistor the base will have two diodes facing towards it. ie with most positive negative (usually black) meter lead on the base the other two leads wil show a conducting diode when the positive lead is placed on them OK - now you know NPN from PNP and which is base. Now Connect positive to guessed collector for NPN and negative to guessed emitter. Set meter to 1 megohm plus range. Connect base to guessed collector via a high value resistor - probably 100k to 1M. A wet finger works well. Note reading. Now swap guessed emitter and collector and repeat. Again resistor is added from base to guessed collector. Note reading One of the two above will have a much lower R_CE reading when base is forward biased. That's the correct guess. Once you get used to this you can pick up a leaded transistor, juggle it with meter leads till you find the two diodes giving base and NPN or PNP then lick your finger and do a forward bias base test - and then declare pinout. Looks like magic to many. Works. You can or course formalize that on a breadboard and even add (gasp) switches to swap polarity etc. Note that you can get some idea of Beta (current gain _ from this once you learn to calibrate your wet finger.
H: Is it true that power transformer has maximum efficiency at full load? Is it true that power transformer has maximum efficiency at full load? In other words, is that possible practically? AI: All transformers are going to put out at least somewhat less power than is put in. In other words, there is no such thing as a perfect 100% efficient transformer (In real practical applications. Games can be played in a lab with superconducting materials and air cores to get close to 100% efficiency, but at best that's just for the transformer itself without system level considerations like how the power goes in and what happens to it after it comes out). Furthermore, in real transformers efficiency is traded off versus ultimate cost. It might be possible to make a particular transformer more effecient, but that would also cost more, possibly make it heavier, bigger, etc, so the manufacturer picked a tradeoff that they felt was best for the target market. There will be some maximum efficiency for any model of transformer at various operating points, including at full load. Or, if you're asking whether maximum efficiency occurs at full load, then probably not. The size of the core is one of the major cost factors of a transformer. Manufacturers aren't going to make it any bigger than necessary to meet the specs. The more power a transformer has to handle, all else kept constant, the bigger the core needs to be. Put another way, for any size transformer there will be a power level at which the core no longer acts "nicely" to allow for efficient operation. This doesn't happen abruptly at one point. Therefore at maximum power the not-nice effects are probably already starting at least a little bit. So to answer your question (if this is really what you asked), no, the maximum efficiency of most transformers is probably not at their maximum power level. Of course the best way to determine this for any given transformer is to look at its datasheet.
H: VHDL increase decrease integer value I have create project witch has an "counter" counter = Integer. I need to increase/decrease an integer value by pressing the buttons. the progress has 2 entitys, entity 1 should increase the value and entity 2 should decrease the value, Im not allow to do so with component how to do this? -- component 1 ------------------------------- entity MyCounter is port( clock: in std_logic; KEY: in std_logic; counter: in integer range 0 to 15; clk_out: out std_logic ); end MyCounter; architecture arch of MyCounter is component decrease port( clock: in std_logic; KEY: in std_logic; counter: in integer range 0 to 15; clk_out: out std_logic ); end component; begin p1: process(clock, KEY) variable counter : integer; begin if KEY = '1' then counter <= counter + 1; end if; end process; end arch; -- component 2 ------------------------------- entity decrease is port( clock: in std_logic; KEY: in std_logic; counter: in integer range 0 to 15; clk_out: out std_logic ); end decrease ; architecture arch of decrease is begin p1: process(clock, KEY) begin if KEY = '1' then counter <= counter - 1; end if; end process; end arch; AI: Your code doesn't compile, you can't use <= to assign to a variable. Nor can you assign to an input (which counter is defined as...) You also can't have two separate processes writing to the same signal (when it's of a non-resolved type, like integer). Is this an academic exercise? Why not just have a single process which does: if rising_edge(clk) then if up = '1' then count <= count + 1; elsif down = '1' then count <= count - 1; end if; end if; As you have a limited range counter, you'll have to be explicit about making it wrap around (or saturate) when you try and increment it or decrement it beyond the acceptable range. The simulator will die otherwise. The synthesis tool may or may not do what you require, depending - but it's better to be explicit with that sort of behaviour. Also, get rid of std_logic_arith - if you want vectors to be treated as numbers, use ieee.numeric_std.all instead
H: In a BJ-Transistor, why do we need to bias the junctions? I'm new to electronics and I'm kinda confused about transistors. In a bipolar junction transistor, why do we need to forward bias the emitter-base and reverse bias the collector-base? AI: You don't need to forward bias the B-E junction. Whether you do depends on what you want the transistor to do. To keep it off, you want to not forward bias the B-E junction. As for the C-B junction, keeping that reverse biased is fundamental to how BJTs operate. A BJT is basically a reverse biased junction that can be made selectively leaky. You apply a voltage accross C-E and with the base open nothing happens. The reverse biased junction doesn't allow any (except for small leakage we will ignore) current to flow. However, the special property of a BJT is that a little current thru the base messes up the insulating capability of the reverse biased junction. The gain, and hence the useful properties, of a BJT come from the fact that is only takes a little current to muck up the reverse biased junction such that it allows a lot more C-E current to flow. This ratio of C-E current to B-E current is the basic gain of the transistor. It can be as low as 5-10 in big mongo power transistors and 100s in high gain signal transistors. The B-E junction also looks like a diode to the external circuit. It will have a forward voltage drop when conducting just like a regular diode. In silicon, this is 500-750 mV for most non-extreme applications. If you want to use the transistor as a switch (either as full off or full on as you can make it) then you have to make sure there is no base current in the off case, and plenty enough to support the desired collector current in the on case. Driving the base to the emitter voltage is a good way to make sure the transistor is off. To turn it fully on, you need to provide at least 1/gain of the desired collector current. In other cases, a BJT might be used in "linear" (it's often rather non-linear, but this is the term used to mean in-between mode or not-switch mode) mode, like a audio amplifier. In that case you want to always keep it somewhat on and have the input signal change its operating point. If done right, this can amplify the signal. Different configurations give you voltage gain, or current gain, or some combination. In these cases, biasing the transistor refers to keeping it somewhere in the middle of the operating range so that a little input signal can change the output both ways. Biasing is basically setting up the DC operating point.
H: Connecting X10 to Arduino I'm trying to setup some DIY home automation, and I've run into a bit of a roadblock. I am attempting to wire an Arduino Uno into a RJ-11 cable in order to connect to a TW523 two-way X10 controller as shown here: http://www.arduino.cc/en/Tutorial/X10. They provide a diagram to connect the RJ-11 to the X10 interface, however it is not very friendly to newcomers. The RJ-11 has six wires, so how am I to know which one is the data pin, which one is the zero crossing pin, and which do I ground? Thanks! AI: The easy way - see EASIER and circuit diagram below. The educational way. Read on ... There is some confusion. The "official" PS04 tech note says that your socket/plug is numbered like this: BUT the accompanying brochure here says Which is left for right reversed.. Look closely at the RJ11 plug and socket and you will see that they have numbers on them - which may or may not help, as you the tow options are apparently mirror image opposites and, as the socket seems to be 6p4c (Gargoyle knows) the numbering may be 1...6 and not 1...4 so you may be dealing with pins 2..5 in real life :-). An aside: if you have not met them read up RJ11, RJ10 (which may not really exist), RJ45, 4p4, 6p4c, 6p6c and the rest ... . OK - the answer: The circuit diagram below will save us [tm]: Use an ohm meter or diode test. Ensure that you can detect a diode in series with a 1k resistor. Note that as you are new to electronics the following will very possibly seem like a confused flurry of gobbledeygook. It is. But it is also very simple basic common sense once you see what a diode test does and what a diode or opto_diode does etc. Work though it slowly and it should be easy enough [tm] The data input as shown below will look like a didoe (1N4001) + a 1K resistor n one direction and like a opto diode (MCT272 her) + 1K resistor the other way. Many DMM dioe tests apply 1 mA current and measure the voltage with 1k resistor = 1V drop displayed as typically 1000. So the diode + 1K will read about 1600. The opto diode will have a higher volotage drop- probably 1.5V - 2V or more (IR diode usually). So opto_diode + 1k resistot=r at 1 mA = 2500 to 3000. Many diode tests will not read that high so you may see the diode + resistor reading but not the opto_diode + resistor reading. The zero crossing input as shown below will look like a fowrad conducting zener diode + 470 ohm resistor in one direction (+ve on pin 2 as shown) and an open circuit the other way. A forward conducing zener diode looks like a very high voltage drop diode - maybe 1.5V drop. But EASIER: Looking at the circuit diagram below, you are not going to do any harm if you get the connections backwards. So Connect middle 2 pins to ground. IF you have a good reason for guessing one or other way as first choice first, use it. Otherwise: Assume left hand pin looking into socket is zero detect (as per brochure). Wire accordingly. Try it. If it works it works If it doesn't work, swap data and zero crossing and try again. If neither work, look for zero crossing signal on output pin. Note that you MUST supply power through a resistot to make the zero crossing opto output work - say +5V and 10K in series to port. The PSC04 diagram on page 7 from here applies:
H: Arduino Sketch Compile Error: Trying to Concatenate Float with String I am not sure if I should be posting this here or on Stackoverflow, but since this audience likely has the most experience with Arduino, I figured this would be the best place. I just bought an Ethernet shield, and as a first project with it, I'm trying to publish a TMP36 temperature reading to Pachube. While Pachube accepts multiple formats for your data, I'm trying to post this stuff in JSON, because I like JSON. However, I'm running into trouble getting my temperature value, which is a float, into the JSON string. I'm a Python/PHP developer, and relatively new to C, so I've googled a lot but haven't discovered the right way to do this yet. Here is my code: float temperature = 85.4; // Or whatever String jsonData = sprintf("{'version':'1.0.0', 'datastreams':[{'id':'%s', 'current_value':'%f'}]}\n", datastream1, temperature); I keep getting the following error from the Arduino IDE (version 1.0): "Cannot convert 'String' to 'const char' for argument '2' to 'int sprintf(char, const char*, ...)'" I found out I am calling sprintf() with the wrong number of arguments/arguments in the wrong order, since it does not return the formatted string. However, I'm not even sure sprintf() is the best function to use to accomplish the goal of getting the sensor's floating point value into a string. Is there a better way to do this AI: You cannot use sprintf() to format a float into a string on the Arduino. Not only is the format of the command wrong, but sprintf on the Arduino does not support floats. There is a function dtostrf() which converts a float into a character array. You can use it like: float temperature = 85.4; char temp[10]; String tempAsString; String jsonData; dtostrf(temperature,1,2,temp); tempAsString = String(temp); jsonData = "{'version':'1.0.0', 'datastreams':[{'id':'" + datastream1 + "', 'current_value':'" + tempAsString + "'}]}\n"; The format of the dtostrf function is: dtostrf(value, width, precision, output); where value is the float value you wish to convert, width is the minimum number of characters to display before the decimal point (padding with spaces as needed), precision is the number of decimal places, and output is the character array to put the results in.
H: Harmful to NPN transistor if collector circuit is broken? Is there any harm to having a conventional switch that can open the circuit between the collector and +V with an NPN transistor? While the base is still being excited by a pin of my controller? I am using a simple circuit to allow a micro controller to switch a light on and off. If it matters, the transistor in question is a TIP31 I found at Radio Shack. AI: No problem at all. The transistor 'degrades' to being a simple diode which receives some modest (I assume!) current from your controller.
H: How do I tell if a transistor is bad? I have just had a frustrating experience with an NPN transistor that came from a pack of 15 "switching transistors" from Radio Shack. The specs on the packaging say "Typical hfe: 200" but when I measure and calculate the values from an actual operating circuit it looks like the hfe is more like 8. (If I am calculating correctly, 35ma measured on the base is allowing only 280ma to flow.) Is it possible this transistor was simply damaged by ESD or something? I am fairly confident my circuit is sound, because when I replace the transistor with a different type (and changed my base resistor appropriately) the circuit functions fine. AI: You MAY have collector and emitter reversed. If you swap C and E you will usually get a functioning transistor with much lower hfe and generally poorer characteristics. Transistor pinouts come in all possible variants. Simple test jig: On a breadboard where a device can be plugged in - Connect collector via 10k to V+ (say 12V) Connect base via 1 megohm to V+ Connect emitter to ground. Measure drop across Collector resistor = proportional to collector current. Now swap C & E and repeat. A large difference in current gain will be evident. BUT many DMMs (test meters) have transistor testers built in. Assume C&E. Test. Swap assumed C&E. Test again. For leaded "jellybean" transistors I use BC337-40 transistors. In modest volume they can often be got for as little as most other sorts and they are excellent for most uses. 500 mA Ic, hfe of 200-600 (from memory). IF this is a TIP 31 (and you really really should give us the whole circuit and component details) then this is the pinout:
H: How do I make the turn off and turn on time equal in a NPN transistor? I have a simple NPN switch, see the diagram. I feed a 100KHz square wave (TTL) to the base of this transistor and it turns on very very fast (a few nSec) but it doesn't turn off as fast, it almost takes 2uSec for it to turn off. (I am looking at the collector of this circuit). The diode is a laser, transistor is run off the mill NPN (datasheet). I also tried with another NPN from ONSemi which is faster (at least what I think) same story. Why the transistor doesn't turn off as fast? How can I make it turn off in a few nSec? Is it better to use a MOSFET than NPN in this case? ** UPDATE ** I have added a 1K instead of that NA capacitor pad and use a faster BJT, things improved a bit. (Actually, I found that the BJT is similar speed but lower collector output capacitance, 2pF vs. 6pF). Anyway, now I see turn off about 120nSec. I will add a speed up cap and report results from here. AI: A faster BJT will probably help once you get the fundamentals sorted out. There are two (probably) new miracle working friends that you should meet. Anti saturation Schottky clamp Speedup capacitor. (1) Connect a small Schottky diode from base to collector (Anode to base, Cathode to collector), so that the diode is reverse biased when the transistor is off. When the transistor is turned on the collector cannot fall more than a Schottky "junction" drop below the base. The transistor this cannot go into saturation and charge accumulated is much smaller so is quicker to get rid of on turn off. Example of this from here Look at the internal block diagrams for Schottky TTL. Note how this compares. This is primarily what allows Shottky TTL to be faster than standard TTL. (2) Connect a small capacitor in parallel with the resistor. This is known as a "speedup capacitor". Sounds good :-). Better for on than off but has a role both ways. It helps to "sweep charge" out of the base emitter junction capacitance on turnoff and to get charge in there on turn on. As per example below from here. This page is VERY worth looking at. They note (more worthwhile material on page) Reducing storage time. The biggest overall delay is storage time. When a BJT is in saturation, the base region is flooded with charge carriers. When the input goes low, it takes a long time for these charge carriers to leave the region and allow the depletion layer to begin to form. The amount of time this takes is a function of three factors: The physical characteristics of the device. The initial value of Ic The initial value of reverse bias voltage applied at the base. Once again, we can't do much about the first factor, but we can do something about the other two. If we can keep just below saturation, then the number of charge carriers in the base region is reduced and so is . We can also reduce by applying a high initial reverse bias to the transistor. Fall time. Like rise time, fall time () is a function of the physical characteristics of the transistor, and there is nothing we can do to reduce its value. Putting all these statements together, we see that delay and storage time can be reduced by: Applying a high initial value of (to decrease delay time) that settles down to some value lower than that required to saturate the transistor (to reduce storage time). Applying a high initial reverse bias (to reduce storage time) that settles down to the minimum value required to keep the transistor in cutoff (to reduce delay time). It is possible to meet all of these conditions simply by adding a single capacitor to a basic BJT switch. This capacitor, called a speed-up capacitor, is connected across the base resistor as shown in Figure 19-7. The waveforms in the figure are the result of adding the capacitor to the circuit. When initially goes high, the capacitor acts like a short circuit around. As a result, the input signal is coupled directly to the base for a brief instant. This results in a high initial voltage spike being applied to the base, generating a high initial value of . As the capacitor charges, decreases to the point where is held just below the saturation point. When the input first goes negative, the charge on the speed-up capacitor briefly drives the base to –5 V. This drives the transistor quickly into cutoff. As soon as the capacitor discharges, the base voltage returns to 0 V. This ensures that the base-emitter junction is not heavily reverse biased. In this way, all of the desired criteria for reducing switching time are met. (3) See how that goes. If not good enough we can see if we can add some regenerative drive next. LSTTL & even faster friends: Warning !!!!!!!!!!!! Looking in here whence the below diagram came from, is liable to result in you and your soldering iron and/or breadboard staying awake all night :-). Many good ideas. Can you do a Miller killer ? :-). Note that low power Schottky uses Schottky diodes whereas the earlier Schottky TTL used Schottky transistors - an apparent step backwards.
H: How will this Verilog line be synthesized? How will this Verilog line be synthesized? data = (s == 0) ? bus0 : 16’hz The problem is that if I use mux/buffer it won't put Z if s!=0 because the output of the mux/buf is x (undefined) if the input is z. AI: I'll assume you're working in an FPGA. If you're talking about an ASIC, wait for an answer from someone who knows something about ASICs. First, is data a wire or a reg, and is it connected to a pin? If it's a wire, the line should begin with the word "assign". If it's a reg, the line should be included in some kind of always or initial or similar type of block. It would also be better to use '<=' in place of '=' to get simulation to better match synthesis. If data is an inout pin, this will synthesize as a tristate buffer. If data is an internal register, this is probably not synthesizable code, unless you are working in a very old FPGA (XC4000 era or earlier?). What is actually produced is at the whim of your synthesis tool and might be different for different tools. It would be much preferrable to set to all 0's or all 1's, and then explicitly OR or AND together all the different drivers for the data bus. In either case, if you are simulating this code, rather than synthesizing it, and there are no other drivers for data, the simulator is quite right to set the value to 'x', because there's no way to predict which way the tri-stated signal will drift in actual use. Most simulators simply simulate the code exactly as it is, rather than guess what it will synthesize to and then simulate that. That means that un-synthesizable code will simulate perfectly well, even though they won't necessarily behave correctly when implemented in your FPGA.
H: UART signal distortion with AVR While evaluating the Libelium Waspmote board for wireless sensor networks, we discovered a strange communication problem. We tried to set up a link between the waspmote and another board via UART at 115200 Baud using 8N1. This is the resulting waveform on Tx for sending 9 times 0x55 (01010101b) : The levels of high and low degnerate to the treshhold of detection: starting out with a High level of 3.3V, the peaks drop in to about 2.7V and the lows start out at about 1.1V and drop to 0.7V. According to the target boards specification, the peaks should be > 2.3V and the lows < 1 V for correct operation. It looks to me as if some capacitve behaviour emerges, but I have no clue why this happens. I am in need of a clue on what is happening, what i am doing wrong, or what i can do to fix this problem. Some additional info: The microcontroller on the waspmote is an Atmega1281, and it's uart pins are directly connected to the communication link (no drivers in between). I can not reduce the baudrate since the target board accepts 115200 baud only. UPDATE 1 I made a detail shot of the signal. We are looking at a transmission at about 125kHz - which seems to be a bit far off the desired 115200 baud I'm aiming at. UPDATE 2 I measure identical waveforms when I disconnect the traget board and put the oscilloscopes probe directly at the microcontrollers UART-Pin. This seems to rule out problems with the target board. However, the measured baudrate is exactly 125000, which is an error ofabout 8% from the desired target baudrate of 115200. Since the UARTs specification limits the baudrate skew to 2%, I guess there's my problem. However, since the waspmote board is locked to 8Mhz clock rate, the Atmega1281 on the board can not produce a more acurate 115200 baud clock through the prescaler registers ( I checked the manual). I guess I'll need another board to communicate with my target board. Thanks, everybody. AI: Your problem is likely in using the wrong baudrate: 112500 is most likely a mistake, the standard rate in that range is 115200 (a search of the manufacturer's website for this number finds many hits, but none for 112500). You could also not be producing the programmed baud rate on one end or the other due to divider granularity; sometimes changing the oversampling of the UART can help. EDIT: Specifically, a value of 8 (divisor of 9) will get you 111111 baud from 8MHz if you set the "double speed" mode bit. Secondarily, you have a problem such as lack of a common ground between the boards, or haven't grounded the scope to them, thus resulting in the distorted waveform. It's not clear yet if that is what the receiver sees, or if it's merely a measurement mistake in applying the scope. Additionally, have you verified that the un-named external board also runs without a serial level translator? Most modular inter-board serial communications is at RS232 levels and logically inverted from the logic-level signals, though there are exceptions.
H: How to work with FTDI V2DIP1-48? Could someone please direct me how to interface with this chip? I am a total newbie in electronics, and after buying this chip, well, i have absolutely no idea how to connect it. The chip has an USB port, so i was sure that it needs to be connected through it to a PC (perhaps with some jumper setting). I couldn't find a double male usb-a cable, so i bought parts for it with the chip. The USB parts didn't reach me, so i was going to use some old mice and printer cables to salvage the parts - but that made me think - is it really a good idea to connect it like this? I'm just trying to connect it and check what happens - hopefully some hint on how to go from there, not a fire. Hell, i don't even know the pin order for such a cable. I bought the V2DIP1 hoping i could cut down costs of my robot i decided on a FTDI chip instead of an arduino ADK to get a serial connection from an android device to an Arduino or directly a H-Brdige, or a button/sensor etc. My reasoning was that the ADK devices have and FTDI chip internaly anyway (they do, right?), and i have a arduino uno already. So, what i need from this chip is at least to make some connection to android (or even a PC, for now) and set/read some pins on/from it - any hints on how to do this, please? The chip i bought: http://www.tme.eu/en/details/v2dip1-48/ftdi-modules/ftdi/ An FTDI tutorial on how to attach to android (but the board is different :/): http://www.ftdichip.com/Support/SoftwareExamples/Android_Projects.htm AI: Connecting the USB-A on the board to the PC is not the solution. According to the v2dip1 data sheet at http://www.ftdichip.com/Documents/DataSheets/Modules/DS_V2DIP1-48.pdf a custom debugger interface is required to load firmware. The interface is documented with a schematic in the application note: http://www.ftdichip.com/Documents/AppNotes/AN_138_Vinculum-II_Debug_Interface_Description.pdf It appears to consist of an FT232R usb-serial converter and some logic to produce a bidirectional serial signal from the separate transmit/receive lines, as well as some mode pins.
H: How do I wire a motor driver power supply? I'm trying to wire and control TB6612FNG Dual Motor Driver Carrier, but am doing something wrong. Why is the motor not running? I have the vcc and gnd connected to a 5v power source, and ao1 and ao2 connected to my motor. When connecting the power source directly to the motor, the motor runs. pwma, ain1, ain2, and stby pins are connected the pins as expected from the sketch. I also have the gnd pin on the logic side of the board connected to a gnd pin on the arduino(uno v2). PWMA is connected to pin 5, which is a digital pin. const int stby=2; const int in1=3; const int in2=4; const int pwm=5; void setup() { // put your setup code here, to run once: pinMode(stby, OUTPUT); pinMode(in1, OUTPUT); pinMode(in2, OUTPUT); pinMode(pwm, OUTPUT); forward(255); } void loop() { } void forward(int speed) { digitalWrite(in1, HIGH); digitalWrite(in2, LOW); digitalWrite(stby, HIGH); analogWrite(pwm, speed); } AI: Vcc is the logic supply, i.e it powers the chip. VMOT is the motor voltage. the chip has two H-bridge drivers that basically attach VMOT across the motor in either reverse or forward polarity. Both of these need to be powered. They give you two so you can use a higher voltage on VMOT which may be required by the motors. Make sure you don't exceed the voltage specs: Recommended motor voltage (VMOT): 4.5 – 13.5 V Logic voltage (VCC): 2.7 – 5.5 V If you put 5V on both Vcc and Vmot, they should be powered adequately. There may be additional issues with your other wiring and code, but, I won't address them until you fix your power problem is resolved and we can be sure there are other issues. ADDED: Here is the schematic of the breakout board, this seems to show that you still need to attempt powering both. Vcc and Vmot are NOT connected on this board, have you tried using a multimeter to measure if they are on yours?
H: ATMEGA328P: Can I re-use PB4(MISO) w/ a pull-up resistor w/o interfering w/ SPI? I have a Freetronics Eleven with their Ethernet Shield and I would like to add a DS2502-E48 to the circuit to provide the hardware MAC address. This nifty little gem from Maxim uses the Dallas 1-wire bus, and if possible I would like to reuse one of the pins already tied up on the Arduino/Shield rather than reducing the pins available for prototypes. The SPI pins (11, 12, 13) are already claimed by the shield, but I only need to talk to the DS2502-E48 for a few ms during initialization, so I am wondering if I could use pin 12 (MISO) briefly as the 1-wire data line. With no CS line active for any SPI device, they'll be ignoring the bus, so there shouldn't be any interference there. But the 1-wire spec calls for a pull-up resistor connected to +5V… Would that interfere with SPI activity later? Alternatively could I get away without the pull-up resistor in this case? I am vague on all theory, but it seems like the pull-up is there so that parasite devices get power. If I use the internal pull-up to power the pin for a few ms, then talk to the DS2502-E48 long enough to get the data I need, can I just let the line revert to it's normal SPI function afterwards? Note that I don't currently have plans for more 1-wire devices… If I need 1-wire for a prototype I would dedicate a different pin. AI: It would be extremely easy to provide a pullup that was active only during initialisation and that "vanished" completely thereafter. Active: PNP transistor is turned on by a capacitor at powerup and pulls pullup high. Cap is charged and transistor trns off after 1 to 2 time constants. Passive: Capacitor provide V+for pullup resistor via a diode. Cap charges (or effectively discharges depending on perspective) with a separate resistor and pullup drive disappears aftr 1 time constant or so. Diode makes cap "invisible" when "charged". (1) An "active pullup" would be easier to "design" properly than a passive and could consist of a capacitor and a "digital" transistor (ie internal base resistors). So could be very small - two components plus actual pullup resistor. Adding another r or 2 may help get timing more predictable but 1R version should be OK. Digital PNP with internal R from base to emitter and internal R from base to base input pin. Capacitor base pin to ground. Collector to pullup. On turn on Vcap = 0 so base input pin is at 0 so transistor is on. Cap charges via internal base resistor. When Cap reaches ~= V+ -0.5 transistor turns off. Size /cost / values: See (2) below for capacitor sizing and cost, but note that a much smaller capacitor value may be used by choosing a much larger base resistor value to charge the capacitor than can be used with the passive design. eg a 10k base resistor would allow about a 1 uF cap and something as extreme as this ROHM PNP with 100k input resistor datasheet here would allow probably a 0.01 - 0.05 uF range cap. Available in 4 pkgs from SOT23 down to VMT3 1.2mm x 0.8mm !!! :-) for the terminally enthused. ).047 uF X5R cap can be 0201 (if desired) for equal amusement at under 1 cent Transistor cost dominates here in this case at about 10 cents !!! but much much cheaper will be available. (2) A passive pullup is probably larger and more costly as installation cost will predominate in volume manufacture. But: This could "safely" be as little as C1 = 1 x cap (C+ = V+), R1 = 1 x resistor (C- to ground), D1 = 1 x diode (junction of R&C to pullup), + R2 = pullup to wherever. C1 starts with 0 charge so when V+ rises C+ is pulled to V+ and C- also. Cap now discharges via R1 so C-falls from V+ to ground. D1 isolates cap from pullup once cap is discharged. Pullup provides whatever value is required for bus. I2 R2 = pullup is say 5 to 10+ times as large as R1 then R1 will dominate discharge time. Size /cost / values: If you need "a few mS" say time constant = 10 mS. Maxim say pulup should be about 4k7. This is shown the same for parasitic powering and when Vdd is available so I strongly suspect that a larger value is acceptable when Vdd is provided BUT lets stick wityh 4k7. (Other issues is time constant od R oullup +_ parasitic capacitance on 1 wire bus). Make R1 = 1k. Time constant = 10 mS so C1 = 10 uF = not nice, but bearable. eg this TDK 0805 pkg, 10uF, 10V, Y5V material, costs 2.5 cents at 2000 volume and under 2 cents above 10k volume at Digikey. Probably half or less from China. Y5V may be a bit "exciting at say +20%/-80% across temperature (-55/+85) and still not marvellous at say 0-55C. Rather better X5R (+/- 20% across temperature) is also ins ame size pkg (0805 x 1.5mm tall) at about +50% price premium (Digikey 2.8C/26k) Given the horrific price of the 1 wire IC you may not mind the few cents for the cap. (3) PIC10F or similar drives pullup :-) Or then there's this which I think may be a one off offer, or a mistake or last years April fools day joke or ... . 33 cents/10 k for microcontroller with 5 x 10 bit ADC, Brownout, power on reset, IIC, IRDA, SPI, UART, PWM, internal osc, watchdog, 8kB flash, 128 byte eprom, ... !!!!!!!!!!!!! datasheet. What a pullup controller that would make :-).
H: Is it worth it learning how to use 7400 series "jelly bean" logic IC's or are they completely obsolete? My road map for learning electronics included the 7400 series logic chips. I started in on electronics by following the labs in the "Art of Electronics" lab manual which includes labs with these chips. I ended up building several custom Microchip PIC and Atmel microcontroller boards before doing these particular labs. Now I am eye-balling FPGA's and getting excited to try one of those out. Should I leave the 7400 series behind or is an understanding of them considered fundamental to understanding the more modern programmable logic chips? Are some of the 7400 series still used in new (good) designs for simple stuff? Are there still particularly useful 7400 series chips that get used all the time? I guess it wouldn't take long just to do the 7400 series labs, but, I just wanted a sense of how obsolete they are since I had such a difficult time sourcing the parts. I couldn't find some and I ended up spending way more money than I thought was acceptable. AI: Don't think for one minute that just because you have an FPGA that learning about 74xx is obsolete. For designing with FPGA you must be able to 'see' the logic working in your head at a discrete gate level (you will learn this skill from discrete logic chips 74xx, cmos 40xx ). Programming an FPGA is NOT like writing a computer program, it looks like it is, but only the idiots will tell you it is. you will see many ,many people on the net talk about their FPGA design is big or slow, in reality they just don't understand how to think at a true multiprocessing parallel gate level and end up serial processing most of what they try to do, this is because they just crack open the design tools and start programming like they are writing 'C' or 'C++' In the time it takes to compile a design for an FPGA on a home computer, you can breadboard a simple logic design in 74xx Using FPGA for a design you MUST work with simulators rather than with the 'hard' FPGA That is to say, if your 74xx design is malfunctioning you can fiddle with the connections, with an FPGA you must re-write, re-run a simulation, and then spend upwards of 30 minutes re-compiling the FPGA design. Stick with the 74xx or 40xx range, build some 'adders', 'shifters', and LED flashers with gating, once you are used to seeing discrete chips it becomes easier when working with a massive 'blob' that is an FPGA
H: How critical a resistor value for MSP430 spy-bi-wire on reset? When setting up a circuit for the TI MSP430 - the reset line in all example circuits has a 47k Ohm resistor (R1 below) on it. How critical is that specific value and why that value? This is what I've currently been using to do this. Can I use something else higher or lower? 47k isn't an SMD part I have on hand typically. AI: I would expect that several factors will put constrains on the size of the pull up resistor: It must be big enough such JTAG driving circuit (programmer/debugger) will be able to override it, It must be small enough that leakage current/noise will not change logic value of the line, The RC constant that remove /RST after supply ramp up will have to be chosen to ensure proper reset. Check documentation of uC and JTAG programmer for leakage and drive strength. Based on that size your pull up resistor. I would try to keep RC constant the same which would mean re-sizing capacitor. Note however that schematic you posted put maximum restriction on the capacitor to 2.2nF. Standard disclaimer: You should follow manufacturer recommendation. There is good reason for that as good gals and guys that made the chip may have put really strange things into it (that are just waiting to bite you). What is worst such things may not be documented as describing them would reveal trade secret. If needed contact your support channel (usually not possible for small customers or DIYers - in this case experiment!). Note that I am not affiliated with TI and I do not have "inside" knowledge of the device.
H: How do I define solar irradiance in the context of a solar cell? This is homework. I've tried my best to find the best answer that I could understand and could be accepted by my lecturer. I've searched my lecture notes, wiki and google to find some good explanation defining solar irradiance. But somehow I still don't understand how I should 'define solar irradiance'. Can someone give me a few good sentences explaining solar irradiance. What are the changes, if any, in a photovoltaic cell (in terms of short-circuit current and open-circuit voltage) if the irradiance is reduced by 50%? AI: Just looking at the graphs and understanding them will greatly increase your knowledge. The last two graphs answer your questions about what happens to voltage and current as light levels change. The black body and irradiance curves will show you how the irradiance is made up spectrally, what sort of results occur and the effects of the atmosphere Lot's of related and useful material below, but a summary is: Solar irradiance is the amount of sunshine falling on a surface BUT in the Photovoltaic (PV) panel context, this is measured relative to two main standard measures - based on energy incidence and wavelength distribution. The standard level of solar energy incidence at the earth's surface = "One sun" of solar insolation which is defined as 1000 Watts per square meter of irradiance under spectral conditions as defined by Am1.5 (= Air mass 1.5 - see below) at 25 degrees C. The standard measure of spectral distribution comes in two forms - one for typical PV cells which are usually pointed at or near the sun and which receive about 1 sun max insolation on the surface, and the other is for "concentrator cells" which use dishes or lenses or mirrors to concentrate the sun. I won't say much more about Concentrator cells except that they may receive energy from about the whole sky surface at once so some light comes from very long paths through the air and some by much shorter ones. This mix of paths changes the spectral distribution of the light received. Amount of light available. Absorbtion of spectral energy at different wavelengths depends on the mount of air that the light has passed through an what else was in the air (water, CO2, ...). Air Mass 0 = AM0 is the condition in space where there is NO air. = Air Mass 1 = AM1 is the condition when panels point straight up and the mass of air is the shortest possible from surface to space. Air Mass 1.5 = AM1.5 is the mass of air when the light comes through the atmosphere such that there is 1.5 x as much air in thr path as when the panel points straight up. AM1.5 usually is taken as occurring at panel angle = 45 degrees to vertical. This is the measure most usually used for PV panel measurements. Be aware of the fantastic Gaisma site http://www.gaisma.com . A large numbero of locations on earth have their own page such as eg Nairobi, Kenya http://www.gaisma.com/en/location/nairobi.html Learn how to use the graphs there. For Nairobi here is the table which tells you what to expect month by month. Monthly mean irradiance peaks at 6.44 kW-hour per square meter per day. in February and 4.4 hours per day in July. Actual above atmospehere insolation is about 1.35 kW/m^2 and at surface it varies with location and season and time of day - at midday in some locations is usefully above 1000 W/m^2. The Am1.5 conditiin is related to the typical path through the atmosphere which causes absorption of some wavelengths more than others. The Wikipedia page on air mass explains the Am1.5 condition thus - The air mass coefficient defines the direct optical path length through the Earth's atmosphere, expressed as a ratio relative to the path length vertically upwards, i.e. at the zenith. The air mass coefficient can be used to help characterize the solar spectrum after solar radiation has traveled through the atmosphere. The air mass coefficient is commonly used to characterize the performance of solar cells under standardized conditions, and is often referred to using the syntax "AM" followed by a number. "AM1.5" is almost universal when characterizing terrestrial power-generating panels. The irradiation level with wavelength above the atmosphere closely but not perfectly follows that of a black body radiator.In the diagram below the greay crve is the amplitude with wavelength for apefect black body radiator and the yellow-orange curve is solar output. Graph 1 - Black body radiation curve compared to solar output in space After the light has travelled through the atmosphere the spectral levels will be modified as shown below.As can be seen from the labels, atmospheric water causes a number of absorbtion areas,ozone causes losses in the UV area and oxygen abd co2 also have absobtion lib=nes. - This is in addition to gross degradation of level due to the partial opacity of the air at all wavelengths. Here are some sites related to AM1.5 issues. ASTM . Table of standard AM1.5 response in 0.5nm wavelength steps !!! Here the PVeducation.org site introduce AM0 and AM1.5 "direct and circummslar spectrum](http://pveducation.org/pvcdrom/appendicies/standard-solar-spectra) for concentrator use. Solarlux - more of the same, but useful Graph 2 - Solar radiation received at earth surface (red) and in near-earth space outside the atmosphere (yellow). PV panel CURRENT output varies APPROXIMATELY linearly with insolation level as per graph below. http://www.altestore.com/howto/images/article/IV_curve.jpg Even more useful is this curve: As well as the V-I plots, which show the decrease in current with decreasing light level, it shows power versus voltage curves (dashed lines) which show how power varies as you trace along one of the smooth lines. Towards the lef side you have heavy loads and high current but low voltage so low power. As you decrease loading voltage rises so power rises. As load continues to decrease power approaches a peak value and the falls rapidly as load is furthr reduced. The peak of the power cure is called the MPP = Maximum power point. Note that as light levels drop the power peak moves diagonally to the left and down. Devices which maintain the panel at optimum load to keep output at a Maximum as light changes are called MPPT = Maximum Power Point Tracking controllers.
H: how to design a power amplifier's layout in l-edit? i want to design a power amplifier in Tanner L-Edit. I want to write code in the .ext file but I don't know what syntax or language the .ext file is expecting. Is it spice? I couldn't find a good tutorial. The second option is to use the Dev-Gen tool but it produced this error: Device = Mosfet Channe = N Single Transistor Length = 1.00 Single Transistor Width = 22.00 Transistor Multiple Count = 22 Bulk Pattern = 0 Gate Finger Pattern = 0 Source/Drain Finger Pattern = 0 Generated by: Dev-Gen ver. 14.11 If I check the SPICE paramter back annotation as in this screenshot: All I get is the error (when I choose the .ext file Generic_025.ext) Extract definition file is not selected. Please click Browse EXT File button to select the file. AI: You seem to be going about things in a bit of an odd way, L-Edit is used for laying out IC's, from Tanner EDA you should really be using s-edit to design the schematic before laying out, as mistakes at the IC level can be very costly. I believe that the .ext file is the extract definition file, the format for this is in the manual, it has been some time since I have looked at this. Normally your silicon foundry will provide you with a process development kit which will include the design rules and extract definition. If not you will need to create this or get someone else to do this. I know tanner EDA and the European distributers EDA solutions provide this service but that costs money. The Dev-gen function is only useful for creating individual devices such as capacitors and mosfets, to go from there you will need to create metal interconnects.
H: Cheap visual indicator for a PA loudspeaker line I have a PA system which is outputting at most 200Vrms AC peak, around 100Vrms AC nominal, from the transformer. The current is around 4Arms. Since the system is comprised of 12 output transformers, and the test system puts them all in the same room, I'd need a visual indicator of which are actually playing and which are in fault. Which could be the cheapest/easiest solutions to do such a thing? I thought of putting a small light bulb on each AC high-voltage line, but I'm afraid it would not be a good solution. AI: Many possibilities. - How much do you want to spend per location and Have you got AC or DC power at each point? IF this was line powered,what maximum power can you afford or want maximum to be taken per transformer from the audio signal for driving the inicator (eh 100 mW, 10 mW, 1 mW ...?) Neon: The classic easy and cheap approach would be to use a Neon bulb and a resistor Would take some fine tuning in the design but not hard, line powered and there will be many existing circuits available. Note that, as Olin says, and as per graph at ane, for Voltages below 100v it will not always "strike". LED Something using an LED will also work and be easy to do. You can easily produce a low voltage signal that varied with speech etc and which can drive an LED 'in time' with the sound, Or you modify the same circuit to light an LED steadily as long as there more than a certain voltage present. Component count for a steady or flashing indicator can be Line1 - Diode-|>|- Resistor - LED -|>|- Line 2 LED flashes with AC As above but add capacitor across LED LED steady Tap resistor add zener from centrepoint of resistors to line 2 Adds protection against overvoltage. A 100 VAC RMS line will lose 100 mW for every mA drawn. A 1 mA driven LED indicator can be easily "good enough" for the purpose. eg as an extreme example a Nichia "Raijin" white LED (about as efficient as any on sale on earth) operated at 1 mA will produce about 0.5 lumen of light - which will illuminate a one inch square to about 600 candella or about twice the brightness of a typical modern LCD screen at full brightness. A VU/bar / dot meter type display also easy subject to powering answers. VU meter using analog meter is passive. Minimum "Neon" strike voltage Paschen curves. Discussion here
H: Is it safe to run and charge a deep cycle battery in an enclosed space like a bedroom? I'd like to experiment with running a small server (5.5 watts) / 85AH deep cycle battery / charged via 30 watt solar panel from my bedroom. I generally keep the window open, but want to make sure it's relatively safe for me to keep the battery inside and out of the sun. I hear the recharge process can release fumes which, if concentrated in a small area, can be toxic, but want to know if discharging also creates fumes and, in either case, if keeping the window open is preventative enough to prevent a build up. Thanks for your response. AI: Not "safe" without extra care. Death unlikely but likely possible if you "just do it". Can be made "safe" Discharge will not release 'fumes' in general use. Risk from "gassing" (Gargoyle knows) can be kept small but not zero when charging with a panel of that relative size. ie 12v say & 30 Watt = 2.5A. 24V = 1.25 A. + say 3% and 1.5% ~ of bat 1 hour rate. Small but non zero chance of Hydrogen and sulphuric acid fumes if battery not designed to vent unless 100% sealed with full recombination control. Ventilation would be an extremely good idea. More if required ... Long long long ago I charged a truck battery at a moderately high rate in a small closed room where I was sleeping :-). Took many weeks for my throat and nasal linings to "recover". Data point: Just came across this [here](http://www.vonwentzel.net/Battery/00.Glossary/ ) while looking for something else: Gassing: This is a very dangerous condition that can occur if batteries are charged too fast. One of the byproducts of Gassing are Oxygen and Hydrogen. As the battery heats up, the gassing rate increases as well and it becomes increasingly likely that the Hydrogen around it will explode. The danger posed by high Hydrogen concentrations is one of the reasons that the American Boat and Yachting Council (ABYC) requires that batteries be installed in separate, well-ventilated areas. " ... As the battery heats up, the gassing rate increases as well and it becomes increasingly likely that the Hydrogen around it will explode. The danger posed by high Hydrogen concentrations is one of the reasons that the American Boat and Yachting Council (ABYC) requires that batteries be installed in separate, well-ventilated areas." | From here | And ABYC site here American boat and Yachting council website here http://www.abycinc.org/ No open access data available on AYBC site - you have to be a member to read about how to be safe.
H: How does one prototype with SMT chips where the layout must be kept tight to avoid parasitic inductance? Is it necessary to go straight to ordering a professionally made PCBs when one wants to test a surface mount component circuit involving high rates of change of voltage (dv/dt) and current (di/dt)? That is, this question refers prototyping SMD PCBs when one must minimize interconnect length to avoid parasitic inductance. Does this requirement make readily available breakout boards useless? (http://www.futurlec.com/SMD_Adapters.shtml). I've etched my own PCBs, but, I have found that soldering fine pitch parts without a soldermask difficult. Have people found this to be a viable option even with leadless packages with 0.5mm pad spacing and a big thermal pad such as the QFN? For a particular example I refer you to this question: What is causing large oscillations in my DC/DC boost converter? Is this ground bounce or some other effect? This was my first attempt at SMD circuit, a DC/DC converter, and in dealing with parasitics. It was based around a small QFN and I couldn't think of any way to prototype the circuit other than to go straight to getting the board done professionally. A very tight layout was indeed critical to getting the board to work. I found that my layout wasn't sufficiently tight and I will need to make another board revision. Did I have a better option to getting the board done professionally? I am asking in case there is another option I don't know of. Does anyone try to solder 30 gauge wire wrap wire onto the small pads and wire the chip up somehow? AI: What's your work environment? Mentioning toner transfer makes me think you're a hobbyist (which is fine), but as a hobbyist you're doing this because it's fun. Your time takes on a different value, and your budget outlook is quite different. As a professional, I build circuit boards because it makes money for my employer. I'm paid fairly well, and it's not economically sensible for me to mess around with toner transfer and trying to solder to that board. I take my time and try to do it right the first time, send the boards out for manufacture, and move on to other projects. When the boards get back, I send them through the reflow oven or have a tech solder them up (the former is easier with soldermask, the latter is easier with silkscreen and soldermask) and test. If it works, great! If it doesn't, I revise the board accordingly and try again. Usually, the board works the first time, but if not, I revise it and send it out again. Making a toner transfer board (or, at my workplace, a board cut out with a PCB router) is valuable when there's a major time crunch and you'd rather spend extra time to make sure that your prototype for the prototype works, rather than counting on the real prototype working the first time. I'm not going to sell or mass-manufacture routed boards, and they're laid out fundamentally differently than professionally made boards: Vias are free on professional boards, and difficult, large, and time-consuming on self-made boards Soldering is much more difficult. Keepaways, plane spacing, and thermals all behave very differently without soldermask. I'll work to make soldering easy on a self-made board, but lay out a professional board differently. Trace/space is smaller on a professional board. This could lead to major layout differences on some boards. Especially with high-frequency signals, moving things closer together can change impedances and cause problems. Some parts simply can't be soldered effectively on toner-transfer boards. 144-pin QFPs, QFN and BGA parts, and other tight layouts are far, far easier with soldermask. In most cases, it's a better investment to send out for a few samples of the final product and wait for shipping than to do a toner transfer board as a prototype. If you enjoy doing toner transfer stuff, enjoy getting better at soldering, and your time isn't a part of your budget (hint: It isn't, even if you're a hobbyist - you have limited time too), then toner transfer makes some sense. If not, just get the real thing.
H: What can cause this damage to the GPU? I bought a computer for a person in which, when delivered, the video card (Gigabyte Nvidia GTX 570) never gave output. The only way the display got basic VESA output was when I moved the card into in the PCIe 8x slot (was on PCIe 16x) but of course blue screen on drivers install. The warranty was void since they detected burned capacitors and excess of solder. I've noticed in the pics from warranty that some components were burned and others where some solder was melted. You can see the pics here: https://i.stack.imgur.com/ZKDaJ.jpg How can this damage occur? My guesses are: Overvoltage: I think I would have noticed any behavior/sound of it; also, the PSU should block this. Wrong overclock configuration that led to heating the GPU. Video card was defective on arrival in some way. AI: The on each photo, the central part looks hand-soldered to me. On the last two pictures for example the excess amount of burnt flux is visible. Also while the components do no appear to be beautifully soldered, I don't see why they wouldn't work because they all appear to have electrical connections. If nobody tried to hand-solder the components, it may be possible that someone tried to bake the card and may have added extra flux to the components to make the process go more smoothly. If that was the case, then we're probably not seeing the main damaged area. People usually bake cards when they believe that the solder balls on one of the BGA chips (and that's usually the GPU itself) are cracking and have bad connection. Unfortunately from what I've heard the only relatively cheap way of seeing the damage there is to make x-ray images of the card itself and even then not many people would go through the trouble of actually replacing a BGA component. The damaged capacitors also in my opinion support the baking idea since they can easily be overheated during the process and leak or explode. If the card really wasn't "repaired" by someone else, then only thing that could in my opinion cause such problems would be really really bad overheating. There are stories of SMD resistors for example desoldering themselves because they heat up too much, but then again you have some problematic capacitors too.
H: Why use a resistor when blocking DC? This may be a silly question, but I was wondering about the resistor involvement of a DC blocking network employed at frequencies 5MHz to 2400MHz. Most of the designs I have seen are an RC arrangement: ----||----- | R /// Now the RC combination I know develops the a time constant on charge and discharge. However, if you are just wanting to block the DC part, why put a R in at all? From I remember the statement was always (when regarding AC and caps), what happens on one side happens on the other. AI: Amongst other things the resistor serves to provide "DC restoration". ie it gives the output AC waveform something to vary relative to. Imagine you were going to use a comparator to provide zero crossing information about the AC signal. Without the resistor the question is "zero relative to what?". In the real world an isolated output may acquire or lose charge. The drive capacitor may leak, light may selectively remove or add electrons to the output circuit, the wind from the mountains may have electrons stripped off its molecules and it may then deposit positive charge on the output circuit - which unlikely sounding circumstance is what happens with the French Mistral and various other winds. The resistor provides a reference path. Anything big enough to move the output relative to ground must drive the resistor and so have finite / real power. As you say - the RC form a low pass filter.
H: How do I test a circuit without an oscilloscope? Just what the title says; I'm playing with simple beginner circuits, signal amplifiers and stuff. Without fancy laboratory equipment such as an oscilloscope, how should I test the output signal is amplified ? AI: An Oscilloscope and multimeter is standard for electronics work, and not regarded as fancy laboratory equipment. You can pick a second hand analogue scope up on eBay for a few dollars which will make your life a lot easier. To answer the question though, if your signals are audio then one easy way of testing is a small speaker/pair of headphones. If loading is a problem you can rig up a little fet amplifier. Another option would be a bulb of some sort, a VU meter, etc. A multimeter on AC will give some indication of signal level (maybe not so accurate depending on quality of meter and signal frequencies. One cheap solution is to use a sound card and some free scope software. This will only be good for AC frequencies between ~20Hz to 20kHz (possibly a bit higher depending on sound card) but is certainly better than no scope at all. Visual Analyzer is a pretty good example of such a tool. If you hack together a probe of some sort (e.g. stereo headphone leads with shield and signal for right left channel = 2 probes) The sound card input will probably only be good for up to around 2 or 3 volts, but a small opamp circuit can be used to divide/amplify and make it usable over a greater input range if necessary. I think there is an example circuit given to use with the software at the link above.
H: What happens when reaching the max temperature on a temperature sensor? I need to monitor the temperature of a hot plate so it stays at 210C I am just using a Arduino and lcd to display the temp using a DS18S20 (I have it ready but not actually using it to measure the plate with this) but that's only rated to 100C so I am buying a LM34CZ DKF503N5 / DKF103N5 which goes to 250C. My question is what will happen if it goes above 250? will it de calibrate it? will it explode? or something else? It is possible that it could go higher than that but for short periods of time until I can get the correct temperature on the plate. I did read a few datasheets and it does not say anything about exceeding the rated temperatures.. that is why I am asking you experienced guys.. EDIT Sorry I was on a US site and never realised it was F i switched over to UK and got the correct ones.. completely different models though AI: Thanks to 0x6d64 for pointing out the C/F discrepancy. The data sheet says: Rated for full −50° to +300°F range In C that is -45°C to 148°C - not enough for your needs. Your main problem at that kind of temperature is going to be the melting of the solder you're using to attach the LM34CZ. Personally I'd use a thermocouple. Rated an hundreds of degrees (usually 400+), they allow you to keep all sensitive circuitry away from the hot area. You'll need a converter chip to allow you to reliably use a thermocouple of course. Most people use the MAX6675, but that is being phased out to be replaced by the MAX31855. Both are surface mount, so you'll need to etch a PCB to mount it on, or get a breakout board (8 pin SOIC). Both the chips are pin compatible with each other, and provide an SPI interface the Arduino can talk to easily. I have had a MAX6675 working on my Arduino, and am waiting for some MAX31855's to arrive so I can check to see if my Thermocouple Library for the Arduino works with them.
H: What's so revolutional in Broadcom BCM20730 Bluetooth chip that's everywhere in the news? Trade magazines are full of reports about Broadcom BCM20730 Bluetooth chip that is expected to have power consumption so low that devices will work for years of a single battery set. Here is their press release. I don't get it. Yes, power efficiency is important, but chip manufacturers have been designing energy efficient chips for decades so far and modern computers and smartphones are full of those chips. Now some company claims they have some extremely efficient chip. How is that possible? How is any kind of drastic improvement possible in such design? AI: To put it simply, it doesn't do the same thing as older Bluetooth chips. The new chip uses BLE, or Bluetooth Low Energy. This is a mode which transmits packets at a high bandwidth in very short bursts, enabling the exchange of data with a very low duty cycle. When transmitting or receiving, power consumption is comparable with standard Bluetooth, but the time that this actually happens is so short that it doesn't really matter. The laws of physics haven't been changed, instead, the protocol has been changed (or, more accurately, a new protocol has been added to the Bluetooth spec.) I'm not sure what trade magazines you're reading, but this isn't the only chip to implement this protocol. It's a standard protocol, and TI and Nordic Semi also have implementations. Instead, 'Bluetooth' in this context doesn't mean what it used to. This isn't a bad thing, but if the magazines confused you to think that Broadcom (and Broadcom only) has made a huge breakthrough in Bluetooth technology, I'd re-evaluate my magazine selection. I've been interested in giving it a try, and have been looking at Panasonic's PAN1326 modules as a start. They integrate a chip antenna with a filter/LNA and a TI CC2564 under an EMI shield in a little module (about 1 cm\$^2\$ - you might want to wait for a breakout board if you're uncomfortable with soldering QFNs or can't do a PCB layout). The CC2564 requires a 32.768 kHz clock input and power (1.7-4.8V), and provides a UART and I2S interface. It's available for engineering samples and in small quantities from Mouser and Digikey. [Sorry, that reads like an ad - no affiliation. Just a summary of the specs, check the full datasheet here]
H: Is Atmega8L-8PU compatible with Atmega 328 on arduino UNO? I have an arduino UNO running my code perfectly. Now I want run the same code on an Atmega8L-8PU which is connected on a breadboard. Is it perfectly reliable to use this Atmega8 instead of the Atmega328 (if the compiled code is less than 8kb)? Also please tell me how to easily transfer the compiled code to this breadboarded Atmega8? AI: The short answer is that it should be no problem at all... in fact in the off-the-shelf Arduino IDE, if you select from the menus: Tools => Boards => Arduino NG or older w/ ATmega8. It will compile your sketch for the ATMega8. Furthermore, if you hold down the Shift key when you click the Compile button, the IDE will show you the path to the temp directory in which your compilation artifacts are created. Assuming you know how to burn a HEX file to an AVR and set the fuses for your crystal, you should be able to take it from there...
H: MMC/SD card interface - any access to wear levelling info? (counters, etc) I don't suppose there's something in the MMC/SD card specification for retrieving any information on erase counts on an MMC/SD card, is there? My goal is to get my embedded system to avoid writing to metadata like last access or modified times, allocate moderately sized files filled with 0xFF sa needed, and only append records within that. This is to reduce the risk of data loss, since power can be lost at any time. However, the wear-leveling algorithms of MMC/SD cards is an unknown, and possibly implemented very poorly. I need to verify that the cards don't attempt to erase data blocks if I'm only writing data over 0xFFs. So, if there was just about any kind of erase count (total for the disk, per block, whatever) available to read... that'd be great. I'm not entirely sure where this question lives... but since it involves SD card protocol level stuff, I figured maybe here. EDIT I believe I will go ahead and overcomplicate things. Disk tests proved that at least the SD cards I have will erase blocks even if the data you write is unchanged from the contents on disk. I'll store up to 128KB of data in directly controllable NAND (which I can control write behavior somewhat better on), then write 128KB chunks into a 128KB-aligned file on the VFAT partition. That should limit the exposure about as much as possible... but wow how ugly and complicated. AI: I don't know whether particular SD cards expose wear-leveling information, but for the most part I would suggest that your desire to avoid erasing blocks that hold FF's is misplaced. Even if a virtual disk block happens to only contain FF's, it will almost certainly contain other addressing information and error-correction data which will have to be rewritten if any changes are made to the block, regardless of its previous content. I believe SD card manufacturers are free to select their own algorithms for deciding when to rewrite blocks which haven't been accessed for awhile, and for ensuring data integrity in the event of power failure. Consequently, I don't know of any particular method of ensuring that an SD card won't get corrupted if the power fails during a write.
H: Connecting to Netgear 3500L serial terminal interface - using ft232rl I managed to lock myself out of my router. I think it must the firewall rules I changed. I can now only connect to it via serial terminal. On the website it says I need a 3,3v ttl serial cable. According to the tutorial it's self powered so I only need txd,rxd and gnd. Is it possible to use my ft232rl breakout from my arduino? I was thinking of feeding the ft232rl 3.3v on vcc and vccio. Then rxd and txd should equal to 3.3v when driven high yes? The voltage am measuring out of the breadboard psu is 3.68 but that doesn't matter does it? I don't have anything else that outputs close to 3.3v. Here's a picture of what I need http://www.myopenrouter.com/article/19840/How-to-Debrick-Your-NETGEAR-WNR3500L-Using-Ubuntu-10.04-Lucid-Lynx/?textpage=1 Picture of how it need to be connected to my router http://www.myopenrouter.com/article/19840/How-to-Debrick-Your-NETGEAR-WNR3500L-Using-Ubuntu-10.04-Lucid-Lynx/?textpage=2 This is how I intend to wire it. Oviously with txd,rxd and gnd connected to the router. AI: I base my answer on this datasheet. Update: included the information from Fake Names comments Short answer: Your schematic will work, if you connect Vcc to 3.3V, as VccIO will define the levels you drive. If you are a bit concerned about your supply voltage of 3.68V, you could also connect this voltage to Vcc only, and feed the 3V3OUT pin into VccIO: To ensure the stable operation of the internal oscillator of the FT232 you want to use a supply voltage of >4.0V (see page 9 of datasheet, note 1). This is not a problem since USB provides 5V. The voltage of the logic output is determined via the VCCIO pin, in your case you want to provide 3.3V there. The chip has an pin 3V3OUT, which can be used for this: Your circuit will then look like this: (with Vcc = 5V from USB)
H: How can I attenuate any signal to 5V peak-peak? How can I attenuate any signal to 5V peak to peak? I tried the following design : While I limited the output to 5V peak-peak, the circuit clipped the output to 5V instead of attenuating it. My main problem is that I don't know the input signal's amplitude. I don't know how to make a circuit that will attenuate the input by a variable amount to achieve an output signal that is always 5V peak-peak. What are circuit designs that will allow me to vary the gain or attenuation to produce a constant amplitude signal? AI: If you want to linearly attenuate a signal of unknown amplitude to a fixed amplitude, you will need a variable attenuation (or variable gain before or after fixed attenuation) stage, a way to measure the amplitude at the output (or in some versions, the input), and a feedback control system to adjust the variable stage based on the measurement to achieve the desired output. This is commonly known as an "automatic gain control" or "automatic level control" and it's a common feature in radio receivers for both voice and data use, as well as similar places where information is encoded or recovered, such as disk drives. If you do not care about distorting the signal, then various types of saturating constructs are possible where the gain "goes soft" as a certain level is neared, however by distorting the waveform from a pure sinusoid (flattening the tops) they introduce spurious harmonic frequencies. As a result, application of such non-adaptive methods is limited to situations where this is distortion is acceptable or can be cleaned up later. Your hard clipping is simply the extreme form of this. However, if the frequency range of interest is known, you might be able to clean up the output with a low pass filter passing the fundamental frequency but removing the higher harmonics, or with a phase locked loop to regenerate a clean signal at the same frequency as the input. But even an automatic gain control loop will slightly distort certain types of signals, for example those with low frequency AM modulation. The loop has some response over time to adjust the gain to achieve a steady output as the input level varies; typically the time constant of this response is chosen so it won't defeat the audio-frequency level-variation-over-time that is AM modulation, but there's a trade-off between and the time it takes to respond to a true change in input "level" and the tendency to partially cancel out lower frequency components of the modulation.
H: How do I get the name or number of device? In many cases when I am designing a circuit, I use transistors, ICs, etc, by using calculations. But when I go to the market I have to ask the product by its name which I don't know. How do I get the name of device,I am looking for? Is there any simple way? Or I have to memorize hundreds of datasheets? AI: Determining the exact part numbers is part of doing electrical design. After a while, you will get to know some parts, particularly general purpose ones. For example when I need a "jellybean" transistor, I generally use a MMBT4401 for NPN and MMBT4403 for PNP. These are widely available, cheap, with reasonable specs, and I know enough about them to know when to pick a part more carefully. When you do have to search for a new part, doing a parametric search on a good website is the best way. I like Mouser for this. They have the best parameteric search in the business, at least last time I checked. Their prices also seem to be generally better than other distributors, so if Mouser has a suitable part I'm usually done. Next I go to DigiKey because their web site is pretty good too (used to be the best until Mouser fixed theirs), and they have a wider selection. There will always be parts you don't know and have to look up. Over time you'll get used to some, but you can never hope to know more than a tiny fraction of what is out there. This is normal and you shouldn't feel bad about that.
H: Why can an oscilloscope only find frequencies 1/10 of the sampling frequency, despite Nyquist? The oscilloscope at my university states both its sampling frequency and the maximum frequency that it can detect. However, the maximum frequency is just 1/10 of the sampling frequency! Nyquist's theorem states that all frequencies up to half the sampling frequency can be reconstructed. What kind of problems are the oscilloscope constructors expecting? AI: There are a few reasons for this: Nyquist's theorem applies to reconstruction of sinusoidal signals of infinite duration from jitter-free, perfectly accurate samples. Real measurement device clocks have jitter and fixed frequencies, real samples have measurement error and real signals are not infinite sinusoids. Jitter is the difference between a sample's recorded measurement time and the actual measurement time. When the display overlays several periods of a signal to create a picture, jitter makes the trace spread out or smear. Other factors will do this as well. The period at which a device samples is not an exact half-multiple of the original -- it's the sampling frequency, and it's not going to change in relation to the input frequency. Sinusoidal reconstruction is sensitive to measurement error and noise near Nyquist's rate. I'd really rather not do any \$\frac{d(freq.)}{dV}\$ right now, but there it is. This error is reduced by averaging samples, which reduces the effective sample rate. Real signals are more than a single tone. They carry information, noise, and Christmas Spirit. A single-frequency sinusoid measurement is of little value, since that was never the original signal. It'd be like expecting anyone who looks at the Orion constellation to immediately interpret a hunter with a club. ==> ??? The measurement device (DSO) uses several staggered-clock, lower frequency parallel processes to achieve its impressive sample rate. Not all steps can be done in parallel, however, which can introduce bandwidth bottlenecks. These are largely a thing of the past in high-end equipment with the development of special-purpose ASICs, and fast GPUs and memory. Several DSO manufacturers have found it more profitable to develop and manufacture a single or only a few high-end circuits, then introduce limitations such as lower frequency clocks and anti-aliasing filters for their mid and lower-end offerings, instead of developing and manufacturing a different design for each target consumer. The 'scope you were looking at may indeed be originally designed to measure higher maximum frequencies than stated, but is somehow handicapped. Though I am far from an authority on the subject, I have heard the "10X" rule of thumb enough times to be repeating it here: an effective sample rate of at least 10X the signal frequency is required for intelligent reconstruction and analysis. As the listed sample rate on your school's 'scope is exactly that, I imagine the actual sample rate, taking into account the above considerations, is several times higher yet, but it all boils down to 10 samples of limited jitter and measurement error.
H: what is the color code of cables in earphones? What I see after stripping the cable is this: copper-red and yellow on right channel green and stripped red-gren on left Whose are for ground and whose for signal ? (edit: I'm asking this for ep-630 but the question I intend is more generic, first to all creative headphones, second, to all headphones, that is if is there a standard for color-coding in such products) AI: There are no industry standards for that kind of thing. The colors are unique to that product. Therefore, it is unlikely that anybody will know, remember, or care. The best way to figure things out is to carefully disassemble the headphones, noting what is connected where. From that info you can put it back together the same way.
H: How do I facilitate keeping multiple grounds, (i.e. AGND, DGND, etc...) separated in the layout when using Eagle? I've designed several PCBs where I needed to keep the ground returns of different parts of the circuit separated, i.e. analog, digital and high power. I use Cadsoft Eagle for schematic capture and layout. It is easy enough to define different ground symbols in the schematic editor. They each have their own net name. However, the grounds must all eventual be connected at one point on the PCB to define the overall ground reference. When connecting one ground (or supply) to another, Eagle generally overrides one of the net-names with the other, i.e. removing their distinctiveness. This is sensible from a idealistic electrical viewpoint that assumes that the wires have no impedance. However, in the real world there is no such as zero impedance, or ground for that matter! This net-name overriding behaviour is getting in the way of PCB design. How do I work around this behaviour? This isn't a big problem in the schematic drawing because the supply symbols are retained and the net names are hidden. However, in the layout editor, after connecting grounds, only one unique ground net-name remains. It is possible in the layout to manually keep the distinct grounds separate even though they have the same net name, and to connect them at one point. Thus it is still possible to achieve the design goal with only one uniquely deified ground. However, it is a logistical nightmare keeping the distinct ground traces separated when they have the same net-names. Is there a better way to do this? I have tried making my own Eagle part where the multiple and distinct grounds connect electrically, but, do not have the same net-names. The part was just a series of physically overlapping SMD pads. Each pad could be connected to a unique net-name thereby preserving the distinct grounds, but, it provided an electrical connection between the grounds. This seemed to work well with the drawback that the Design Rules Check (DRC) thought that the overlapping pads were a problem. In fact, Sparkfun has an eagle part that does this, however, they opted to keep the pads separated, i.e. not overlapping. This solves the DRC problem, but, then the board is then not connected properly electrically. This caused bugs in one of my boards before. Is there a good solution to this problem? Is Eagle weird in its handling of this? Do other EDA tools do better than Eagle in handling this? I am doing something wrong? This has been a source of irritation for me for some time now. AI: Create a footprint with GND and AGND pads. Draw copper between these pads. Yes, this will produce a DRC "Overlap" error as shown below: This is OK. There three buttons at the bottom: Clear all Processed Approve "Clear all" will temporarily clear the list for this run of the DRC. I'm not sure why that's useful; just close the window if you want it shortened. "Processed" will fade out the color of the red X. This is potentially useful if you're iterating through a long list of DRC errors and fixing them as you go; you can keep track of the ones you think you've corrected. "Approve" is the only one I use on a regular basis. This moves the error from the errors list to the approved list: and keeps it there on subsequent runs of the DRC. Note that this only moves this specific error with this specific pair of nets at this specific location. Closing this window and running the DRC again produces the notification "DRC: 1 approved errors" and no "DRC Errors" dialog. You can get this dialog back by creating an error, or (preferably) the errors command, the yellow exclamation point in the above screenshot, or the menu Tools -> Errors. The "Approve" functionality exists for a reason, the same reason that we have tools like #pragma GCC diagnostic ignored "-Warning" Sometimes, it's OK to ignore a DRC error. This is one of those times.
H: Xbee module works for 10 seconds I am trying to communicate between 2 arduinos using 2 xbee shields. I am trying to configure the Xbee shield with PAN ID, address etc. I am using X-CTU utility on a windows 7 64 bit operating system. I am able to configure one of the XBee modules with all the necessary parameters. I am not able to repeat the same for the other module. I able to communicate to the Xbee shield for the first 20 seconds. During this 20 seconds, the light on the Xbee shield is ON. The xbee shield responds to the communication query test and the serial number is verified. I am not able to repeat the query test after the light goes OFF. Is my XBEE shield broken? AI: (1) Noe enough information provided. (2) Too much happening. Probably. (3) If "I am not able to repeat the same for the other module." means, "ever in amy circumstancve when operated in the manner which allows the other one to work", then if the two are identical parts with identical configurations then one is, by definition (more or less) broken. Or both are. Otherwise, (4) Xbee shield is probably not broken. Re 20 second issue: If this happens with bad Xbee only then work that out first. If it happens with "good" xbee then somewhere there will be a boundary. You need to find it. Do the absolutely minimum necessary to get interaction with the shield that you can detect (LED on or supply present or some signal occurring. THEN STOP.Let it sit. Does it "die" after or 30 seconds or one minute or more? If not, work up in complexity from there. If it does stop as before, work down in complexity and find what XBee directed activity (even with Xbee not being accessed) removes "stopping"
H: From a toggle to an impulsion I'm trying to make a circuit (with no programmable circuits, only logic gates, flip flops and latches) that outputs a short impulsion each time it's input toggles from 0 to 1. Do you have any idea of how to do so? AI: Please try to use normal english. I'm guessing "impulsion" is supposed to mean a single pulse? If so, what you want is officially called a "monostable multivibrator" or more commonly a "one-shot". There are chips that do this directly, using a resistor and capacitor as the timing components to control the length of the resulting pulse. Check out the 74x121 and 74x122, for example.
H: Where does GPS interference such as that from Lightsquared come from? A recent government test shows LightSquared products affected 75% of GPS receivers on adjacent frequency bands. Is this most likely because (a) the Lightsquared transmitters bleed over onto the wrong frequency, (b) because the GPS receivers receive signals from adjacent bands in addition to their own, or (c) some other reason? AI: I work in an industry affected by the LightSquared system and may be able to provide some insight. The issue at hand does fall into the area of being with the GPS receiver. The bands that LightSquared wants to use are near the GPS L1 wavelength. These bands are currently employed by systems that send command and control packets to satellite systems. However the LightSquared signals are orders of magnitude greater in strength. The RF filters on high precision (dual frequency) receivers were not designed to block that much power at the edges of their bands and this is where the interference comes from. So, an industry never expected an adjacent band to be used in this manner and thus opted to save money (and a significant amount in the early days of GPS) on their filter design. At this point with the hundreds of thousands of high precision receivers in the field it has gotten to the point that the easiest fix is for LightSquared to employ better filters on their end. Otherwise most military and survey grade receivers will have to replaced or fitted with new supplemental filters. Once I am at my desktop I will update with some graphics showing the power and frequency distribution of the applicable signals. EDIT: As promised here is the update. From the below image you can easily see the power envelope of the LightSquared LTE signal. (This image originally came from: Javad's website, who is a manufacturer of GNSS receivers) Also, on the graph are the frequency response plots of some fairly typical filters used in various types of GPS/GNSS receivers. If you look at the power levels at the ground of the important GNSS/L-Band signals you'll see that even after the fall off of the GPS filter they are still swamped by the LightSquared signal. Also, I forgot to mention in the original posting that the traditional use of the spectrum occupied by the new LightSquared service was for Mobile Satellite Systems (MSS) which has a low power envelope like the StarFire/OmniSTAR signal on the graph. The reason why GNSS receivers use such a wide filter is that each satellite navigation system has its' own allocation of spectrum. To receive GPS L1 you must be sensitive to the signal centered at 1575MHz. GLONASS is carried at 1575MHz (L1 again) and frequencies that range from 1595MHz, to 1609MHz. It was most convient for vendors to design their L1 filter in a manner that gave them a flat response all the way from the center of L1 out to the far edge of GLONASS's ~1600MHz signal. When this filter is mirrored on the lower frequency side of the L1 center this results in a very wide and flat filter.
H: Does wiring a multi-cell battery pack to provide two different voltages adversely affect cell lifetimes? A robot-arm kit I am playing with uses 4xD-cell batteries wired in series to provide 6V, with an additional connection on the cross-bar at the end of the pack to provide 3V. This seems reasonable enough, but I wonder if it might have any effect on cell lifetimes? AI: The cells being used for both loads will be depleted faster than those being used for only one, at least if the lower voltage load is substantial in comparison to the higher voltage one. If you then re-charge them in a charger not suitable for unbalanced starting conditions, this could be somewhat (to even seriously) detrimental, yes. For chemistries with simple charging methods such as NiCd, NiMH, etc, simply using a low rate (1/10C) charger would probably not result in much of an overcharging problem for the less depleted cells - such chargers often have no timer or cutoff mechanism anyway (though they shouldn't be left connected constantly). But a higher rate or peak-detect charger would not be appropriate. For chemistries with more precise charging requirements, especially the various lithium cells, you would require a charger with a "balancing harness" - ie, an additional connector tapping out all of the internal cell terminals so that they can be individually charged and monitored to a safe level of charge. It doesn't sound like you are talking about these types of cells, though. If you have loose cells in a battery holder instead of a soldered pack, you could swap the doubly and singly used cells partway through the discharge cycle to partially equalize the usage.
H: Shouldn't these headphone wires be insulated? My headphones sometimes don't put out sound in one of the channels, so I opened them up and this question came to mind: Shouldn't the 3 copper cables that connect to the mini-jack be insulated? One seems to be pure copper, I'm not sure how they changed the color of the other 2 to red and blue but it still looks like bare copper to my eyes. AI: They are insulated. Each individual strand is coated in blue, red (is it red?) or clear enamel. It makes soldering it a bit of a pain, but makes for very flexible wires, and also reduces the high frequency impedance of the wire by massively increasing the surface area of each wire. It is called "Litz Wire", and the reasoning behind it is to reduce the Skin Effect which causes increased resistances in AC waveforms.
H: How do I build a bracelet that vibrates once every n minutes? I intend to establish a few new personal habits that eventually become second-nature to me. To assist myself, I want to wear a bracelet that vibrates every, say, 5 minutes all throughout the day as a constant reminder to keep up whatever new habits I'm trying to establish. Alas, no such bracelet exists on the market. I'll either have to design and build it from scratch, or somehow piece one together from purchasable parts. (I did think about using my mobile phone for this purpose, but I don't always keep it on my person and it's not waterproof.) My requirements, in decreasing order of importance, are very simple: The bracelet vibrates once every n minutes. n does not have to be configurable after the bracelet is assembled. Typical value for n is between 1 and 60 inclusive. (Optional) The power source is either easily replaceable or lasts no less than 30 days with the bracelet always on. (Optional) The bracelet is durable (i.e. it can take a fall) and waterproof (i.e. I can shower with it on, not necessarily go scuba-diving). (Optional) The bracelet can be turned off and on at will. I would prefer to build this thing from existing parts since I assume that'll be easier and faster, though as a result I understand I may not have as much control over the details. I imagine the end result will look something like this Adidas "ion loop" bracelet (basically, a regular bracelet with the vibrating component thrown on): How should I go about building this thing? Is there a small, vibrating component I can buy and just attach to any old bracelet? Or is there perhaps something better I can build with a bit more of an investment? Edit (after reviewing answers and doing more research): To summarize what I've learned so far, I need: A vibrating motor. I've chosen these two from Precision Microdrives to experiment with. A coin cell battery. I bought batteries for both motors. A timing element. This can be one of the following: a microcontroller (e.g. PIC 10F200) a 555 timer running in astable mode (plus the required resistors and capacitor) A transistor. Questions: Do I have everything I need? Which approach to generating the periodic pulse is easier to implement for the beginner? I'm not opposed to writing some code for the microcontroller, but I presume it also requires I download some software and purchase some means of loading the code into the chip. Will I find that overall a more or less pleasant experience than meddling with resistors and capacitors for the 555 timer? Finally, if there is a specific way I can make this question better (perhaps break it up into smaller chunks?), let me know. AI: For the vibrating part, look into the little motors used to vibrate cell phones. These are intended to be low power and just produce vibration. They cause the vibration by having a off-center weight on the shaft. Power will be more tricky. Some form of coin cell is probably the best bet. I've never used a vibrating motor, so am not sure how much current it requires and therefore whether a coin cell can provide it. Something small enough to be strapped to your wrist but run a vibrating motor every few minutes for a month simply may not be possible with today's technology. I'd probably flip it around and see what the best you can do is with one or two CR2032 coin cells. Those are mass produced in very high volume, so give the most energy for the cost in a small battery. This first thing to do is find specs on a vibrating motor and see where you're at. You can post them here so we can discuss where that leaves you. Added in response to your additional questions: I looked at the first motor you picked. While it's in a cute package, it doesn't look like a good fit considering feeding it power is a top issue. As I said in a earlier comment, the lower voltage motors seem to be more efficient. Jameco, for example, has several motors rated at 1.3V and 80mA, which is almost 1/3 the power your motor requires. Here is one of several with these specs. Since convenient batteries are 3V (one or two CR2032 is a obvious choice) and lots of chips won't run on 1.3V anyway, it makes the choice of drive clear. Use a microcontroller like a PIC 10F200 instead of a 555 timer. Long term timing, like 10s of seconds or more, gets tricky with analog electronics. But the real kicker is that the micro can PWM the motor whereas the 555 timer can only turn it on or off. You could use a second 555 as a oscillator gated by the first, but this is getting more and more silly. A 10F200 comes in a SOT-23 package, which is smaller than even a single 555 timer. Yes, you need some way of dumping code into the PIC. That may be a issue if you are only going to do this once. If you plan to do more electronics projects, then being able to utilize microcontrollers will be very useful anyway. For this project alone, you don't need any debugger hardware. This is a very simple program that can be completely tested with the simulator. The free MPLAB software suite from Microchip includes the assembler, librarian, linker, IDE, and simulator. All software you need to develop this firmware is freely available. As for the drive transistor, I would use a good N channel low side switch. A NPN bipolar would work too, but we are dealing with low voltages and efficiency matters a lot because battery life will likely be less than you want anyway. The IRLML2502 can do this job nicely, and is also in a SOT-23 package. Just connect the PIC output directly to the gate. To turn on the motor, the PIC will actually be doing something like turning it on for 3 cycles out of 7, or maybe straight half the time depending on how the motor does at low voltages as the battery discharges. The battery voltage will also be lower than rated when the motor is on due to the current draw. Don't forget the reverse Schottky diode accross the motor to kill inductive kickback.
H: XST Verilog - Casting real to integer constants When I try to synthesize the following Verilog code using Xilinx XST, I get the error, "Unsupported real constant". If I try wrapping that expression in an $rtoi function, XST gives a different error: "Unsupported System Function Call". Using the Xilinx synthesis tools, is it possible to cast a real constant to an integer constant? If so, how? module example(clk, n_rst, tick, done); parameter CLOCK_HZ = 50_000_000; parameter BAUD_RATE = 3_000_000; input clk, n_rst; output reg tick, done; reg [31:0] counter; always @(posedge clk, negedge n_rst) begin if (!n_rst) begin counter <= 32'h00000000; tick <= 0; done <= 0; end else if (counter == (0.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (1.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (2.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (3.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (4.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (5.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (6.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (7.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (8.5*CLOCK_HZ/BAUD_RATE) || // ERROR:Xst:850 - Unsupported real constant counter == (9.5*CLOCK_HZ/BAUD_RATE)) // ERROR:Xst:850 - Unsupported real constant begin counter <= counter + 1; tick <= 1; done <= 0; end else if (counter == 10*CLOCK_HZ/BAUD_RATE) begin counter <= 32'h00000000; tick <= 0; done <= 1; end else begin counter <= counter + 1; tick <= 0; done <= 0; end end endmodule AI: Since no other answers are forthcoming, I'll suggest an alternative approach. Instead of two parameters CLOCK_HZ and BAUD_RATE, just use a single parameter DIVIDE_RATIO. Then the values for comparison can be calculated as DIVIDE_RATIO[n:1], DIVIDE_RATIO, (3*DIVIDE_RATIO)[n:1], etc. and no floating point value is ever created. The disadvantage of this relative to what you have is that if the divide ratio isn't an exact integer, your approach would smooth out the errors in the tick rate over 10 cycles, whereas mine would have slightly more error in the tick rate compared to the "ideal" divide ratio. In addition, although its not what you asked about, I'd suggest looking at alternate ways of arranging your counter all together. As your code stands you're using a 32-bit register to hold (and doing 32-bit comparisons on) a counter that will never count above 600 assuming the default values you used for the parameters aren't overridden by the caller. I think you could get all the same states with 9 or 10 state bits. Edit -- an alternative approach: Another way to go that solves both the floating point problem and the accuracy problem, is to use a jump counter. (freehand code, not tested): parameter jump = xxx; /// jump = 2^32 * BAUD_RATE / CLOCK_HZ reg [32:0] ctr; always @ (posedge clk) begin ctr <= ctr[31:0] + jump; tick <= ctr[32]; end By allowing the counter to just roll over instead of resetting to 0 after the terminal count, you get a tick rate that averages out correctly to the limits of 32-bit integer math, but you don't have any floating point to confuse the Verilog compiler or synthesizer. You'll need to add the reset logic and a second counter to count ticks and generate the 'done' signal. To get exactly what you had before you'll also need wire real_tick; assign real_tick = tick & ~done; If the tick output has to be glitch-free, you'd have to do that in sequential logic.
H: Interrupt Service Routines and I2c together I would like to ask a question that has been on my head for a while I have done coding small ISR's for pic and AVR controllers and i have successfully tested them on board.And i have just learned some days ago that you need to keep ISR short. So I have this ISR that runs each 2 ms from timer. Well the doubt I have is If I have an I2c communication running parallel and then the interrupt occurs, What will happen to the I2C communication. Will the data transmission gets damaged?. If The ISR takes 2ms to execute, what will happen to the I2C communication meanwhile. Can it cope with such delays? Or is it my lack of understanding. AI: The processor won't execute any foreground code during the interrupt. If the IIC is strictly handled in hardware, then that won't matter. If this processor is the IIC master, then it won't matter either since you own the clock and can go as slow as you want (most slaves allow this). However, a interrupt routine taking 2 ms with other things going on, like IIC communication, at the same time sounds like bad overall architecture. The right answer is to step back and understand what all the processor needs to accomplish, what limited set of things really are low-latency that it must react to, and re-architect the firmware from there. Propagating a bad design by working around previous mistakes just makes things even worse.
H: RF proximity sensor around a perimeter I'm trying to build a proximity sensor that triggers on nearness of the sensor to a perimeter antenna, sort of like an underground invisible fence. I want to feed that input into a microcontroller which will respond when it approaches the perimeter. Most of what I'm finding online is dealing with RFID, which is not exactly what I'm looking for. Are there components that I can use that will transmit/receive simple signals? If I need to build this with discrete components, are there schematics? The sensor should be sensitive only over a short range (~1m)? Ideally this could be configured by increasing or decreasing the power of the transmitter. I understand that the question is a bit vague, but I'm not looking for super detailed responses, just a nudge in the right direction. AI: You can use simple magnetic induction from a perimeter wire to a portable coil. If you used an audio frequency such as 10kHz to drive a current thru the perimeter wire, maybe 100mA RMS, this should easily be picked up on a portable but also small multi turn coil. The level may only be a few millivolts at 1m from the perimeter but this can easily be amplified and filtered and converted to a dc level that approximates to received signal level. Because the orientation of the receive coil can cause a null in the signal you might want to use two receive coils at right angles to each other to get full coverage at any angle. I would, on the receiver want to try and filter out unwanted frequencies such as power AC so a bandpass filter set at the operating frequency would be ideal. This can be built around an op-amp and the op-amp can provide gain although it's probably best not to try and use the same op-amp for filtering and gain. Use a rail-to-rail op amp to make maximum use of possibly a limited battery supply.
H: Input voltage of LM317 drops when lead acid battery is connected on output I have built a voltage regular circuit with LM317. Its input is connected to my solar panel. As in many circuit examples, there is a voltage divider to bias the adjust pin. Also, I have connected a diode on output to prevent backward current flowing into voltage divider. When no load is connected on output, I measure the output of my solar panel, it is also the input of LM317. It is generally over 18V. I set the output voltage to 8V by using a pot, and it works perfectly. In this connection, due to the voltage drop on diode, I get about 7.2V at the end. Now, when I connect my 6V lead acid battery (it says 7.20V - 7.50V for charging), I measure the input of LM317, and see that it drops to about 4-5V and stays there. I don't have much experience with lead acid batteries, but some days it works perfectly, and output stays really high, other days, battery doesn't charge at all and above situation is seen. What is causing this? Is it normal? P.S. After charging batteries, I use it to light hallway with white LEDs. .. After a while ... I used a 12V power adapter last night as substitution of solar panel, and measured voltage at different points. I saw the same effect. That means this effect is not about solar panel. AI: A solar panel is not a constant voltage, or constant current source. It can be thought of as a constant power source with maximum rated voltage and maximum rated current. The power is relative to the light hitting the panel, the voltage is maximum with no current, and drops as current is drawn from the panel. If you are using a 10W panel, and it's in its full rated sun exposure, you'll get 10W out. If you draw 1A in that situation, the voltage will be about 10V. If you draw two amps, the voltage will be about 5V. If your battery is full, you probably aren't going to draw much current, so the voltage is higher. If the battery is nearly empty, it will draw a lot of current, and it will cause the panel's voltage to drop. In your specific case, what you're finding is that the panel can't provide full charging current all the time - whether that's due to less than full sun exposure, or a low-charge battery depends on the situation. However, you can still use this system, even though the voltage is low. If you disconnect the battery and measure its voltage, then connect it to the charging system and measure the voltage at the battery, you'll find that the attached voltage is higher - the battery is accepting current from the system, and is charging. It isn't charging as fast as it could be, but that's due to the panel's limitations. If you want to learn more about this, and what professional solar charging systems do in order to handle this effect, do a search for MPPT circuits - maximum power point tracking. The solar panel is most efficient at a certain voltage and current for a given sunlight input, and these circuits attempt to track that maximum point so you get as much power from the panel as possible. Also, note that SLA batteries are very forgiving. It may be that you can eliminate the voltage regulator, and just use the diode in the circuit. This will increase the voltage at the battery since the regulator drops 1.5V-3V depending on load, and thus charging efficiency. Given that you're having a hard time keeping it charged, I'd expect the solar panel is unlikely to damage the battery, but check the panel's maximum current at 7.2V and see if the battery can accept a constant trickle charge of that rate.
H: Should I Remove the Power When Unplugging Components From an Arduino? When I am done with a circuit and want to build another, should I remove power from the Arduino or can I just remove the unnecessary parts and start plugging in the necessary parts? AI: It is best to remove power while re-wiring a circuit, so, yes, disconnect the USB cable, and any other sources of power. While disconnecting and re-connecting things, you may introduce short circuits, or put the circuit in undesirable states (eg disconnecting power to a chip while leaving power on its I/O pins, thus powering the chip throough protection diodes.)
H: AP1509 DC-DC Power Supply calculating Inductance? I'm working on an embedded system which I want to enable USB Host on for a few devices. As I'm supplying USB Devices with current and am not sure of my own on board current requirements I decided I'd aim high and go for the Diodes INC AP1509 which can supply up to 2Amps. Along with the data sheet there is an Application note ANP013 which shows how to calculate the required Inductor and Capacitor. My question is that the formula used to calculate the Inductance required uses Time on (Ton) in the formula. But there is no indication as to what Ton is. I know that this DC to DC converter will turn on and off at high frequency to give the required output Voltage and current but I've no idea what Ton or Toff will be. Am I missing something? How do you calculate Inductance and Capacitance? I'm a Software Engineer really so I'm sure there might be something very basic here I've missed. AI: For a buck operating in CCM (continuous conduction mode), which is what ANP013 is addressing: \$V_{\text{out}}\$ = \$D V_{\text{in}}\$ and \$T_{\text{on}}\$ = \$\frac{D}{F}\$ while \$T_{\text{off}}\$ = \$\frac{1-D}{F}\$ The easiest way to calculate the inductance is: L = \$\frac{T_{\text{off}} V_{\text{out}}}{2 I_{\text{Load} (\min) }}\$ There is more about choosing buck inductors here. The equation in the referenced question will give an over estimate of inductance, which will be somewhat higher than you get from the equation shown above.
H: dsPIC 30F6012A will not read RD9, appears to be software problem I'm using a dsPIC 30F6012A. I have two PCBs with this chip, both displaying the same symptoms, implying it's not one-off damage. RD9 is definitely being driven to five volts, confirmed with a multimeter. Older versions of my firmware read digital input RD9 without problem. Newer versions do not; RD9 is always read as low, regardless of the actual voltage on the pin. There are no differences between the code versions that are obviously related to RD9. RD8 and RD10 read correctly. I've updated MPLAB X and the XC16 compiler to the latest versions, without effect. What software issues could cause a digital input to always read low? The relevant assembly for my current compliation is: 177: TRISD = 0xFF07; 002214 2FF074 MOV #0xFF07, W4 002216 881694 MOV W4, TRISD debounce_input_state.RTR = PORTDbits.RD9; 0027C6 8016A4 MOV PORTD, W4 0027C8 DE2249 LSR W4, #9, W4 0027CA 624261 AND.B W4, #0x1, W4 0027CC FB8204 ZE W4, W4 0027CE 620261 AND W4, #0x1, W4 0027D0 DD2249 SL W4, #9, W4 0027D2 804346 MOV debounce_input_state, W6 0027D4 2FDFF5 MOV #0xFDFF, W5 0027D6 630285 AND W6, W5, W5 0027D8 728204 IOR W5, W4, W4 0027D2 8845C4 MOV W4, debounce_input_state I've tried different reads of PORTD in different places, without apparent benefit or change. LATD is never referenced in my code, and the reference to TRISD above is the only reference. Forcing TRISDbits.TRISD9 to 1 immediately before read doesn't have any benefit. There are only two peripheral attached to the same hardware pin, and they're explicitly disabled, and should not interfere with digital input in any case. Debugger agrees with my observations: PORTD<9> never reads high, while <8> and <10> do. TRISD<9> is set high. PORTD<9> is shown as going high in the debugger on my old firmware. Relevant code from old firmware is as follows: 172: TRISD = 0xFF07; 002210 2FF070 MOV #0xFF07, W0 002212 881690 MOV W0, TRISD 530: debounce_input_state.RTR = PORTDbits.RD9; 0027E0 8016A0 MOV PORTD, W0 0027E2 DE0049 LSR W0, #9, W0 0027E4 604061 AND.B W0, #0x1, W0 0027E6 FB8000 ZE W0, W0 0027E8 600061 AND W0, #0x1, W0 0027EA DD0049 SL W0, #9, W0 0027EC 8045C2 MOV debounce_input_state, W2 0027EE 2FDFF1 MOV #0xFDFF, W1 0027F0 610081 AND W2, W1, W1 0027F2 708000 IOR W1, W0, W0 0027F4 8845C0 MOV W0, debounce_input_state It appears to be semantically identical, just different register names. AI: As past me (what an arrogant gasbag) points out, setting C1CTRL<15> enables IC2, disabling RD9 as GPIO. Even if you manually disable IC2 after that point, RD9 still can't be used for GPIO.
H: Cannot get a digital square wave on oscilloscope from the GPIO of the Raspberry Pi? ENVIRONMENT: Running "Raspbian" on Model_B Raspberry Pi (Revision 2) w/ ribbon expanding the GPIO out onto a Breadboard as shown in the following image. SETUP Here is a close up of the GPIO setup on the breadboard and the connection of my probe. My probe is connected to the Green wire which is connected to pin 7 (CE1). My ground is obviously connected to ground which is the yellow wire. I'm using GPIO pin 7 (CE1) as an output which I have my probe connected to and my ground is connected to the ground pin. I've set probe on 10:1 setting. My program reflects the example for the "C" "wiringPi library" program located here . You will need to scroll down as the example is located towards the end. I'm also attaching a image below of my program. I'm unsure what the (if) statement is doing but as you can see i'm setting the pinMode to (7,OUTPUT) and using a (while) loop to toggle pin on and off as fast as possible. I'm hoping to achieve a digital square wave from this program to view on my oscilloscope. However, i'm getting a bad signal on the screen as you can see below. THE PROBLEM I'M HAVING: Can someone help me troubleshoot my setup so I can get a digital square wave to display. The link I attached above gives an article on how they set their test bench up. The even show the signal that was displayed on the oscilloscope. However, for some reason I cannot replicate their results. Below is an article for the spec sheet of the GPIO. Again my board is revision 2. SPEC SHEET FOR THE GPIO: http://elinux.org/RPi_Low-level_peripherals PROBLEM HAS BEEN RESOLVED: Thanks to K-Sid's comment below and the wonderful link I have fixed the issue. I'm posting the new image of the signal being analyzed. It's showing a frequency of 4.3MHz which is around what it should be. AI: There are a couple of issues with your code that can be easily fixed. First, you are calling wiringPiSetup which means you will need to refer to the pins by their WiringPi designation which can be found on this page: https://projects.drogon.net/raspberry-pi/wiringpi/pins/ You are then setting pin 7 (wiringPi designation) to be an output which is actually GPIO 4 (physical pin 7) and not the CE1 pin as you mentioned. CE1 would actually be wiringPi pin 11. The next problem is in the while loop. You are doing a digitalWrite on wiringPi pin 4 (not 7 as you configured) and are always setting it low so it would never toggle high even if configured correctly. The following code should be what you are looking for but is not tested. This assumes you want to use CE1 which is normally used for SPI but should work with WiringPi as an general I/O pin: if (wiringPiSetup () == -1) exit (1) ; pinMode(11, OUTPUT); while(1) { digitalWrite(11, 0); digitalWrite(11, 1); }
H: Number of machine cycles in microprocessor 8085 The DCR instruction in MP 8085 has has 1 machine cycle, i.e. opcode fetch cycle. But the DCR M instruction has 3 machine cycles. What are those three machine cycles? AI: The \$3\$ machine cycles are: Opcode Fetch Cycle Memory Read Cycle Memory Write Cycle Internally, depending on the opcode, each machine cycle takes from \$3\$ to \$6\$ T-cycles (or T-states) to accomplish the \$1\$ machine cycle. T-states are one clock period long, and the instruction length is measured in T-states. For example, a typical Opcode Fetch has \$4\$ T-states: the first \$3\$, T\$1\$-T\$3\$ are used to fetch the instruction, and T\$4\$ is used to decode it. Instruction cycles take from \$1\$ to \$6\$ machine cycles. The 8085 also has some external status pins that can be used to identify which machine cycle it is currently in. These are the \$\mathrm{IO/\overline{M}}\$ signal, the \$\mathrm{S0}\$ and \$\mathrm{S1}\$ signals. Opcode Fetch: \$\mathrm{IO/\overline{M}} = 0,\$ \$\mathrm{S0} = 1\$ and \$\mathrm{S1} = 1\$ Memory Read: \$\mathrm{IO/\overline{M}} = 0,\$ \$\mathrm{S0} = 0\$ and \$\mathrm{S1} = 1\$ Memory Write: \$\mathrm{IO/\overline{M}} = 0,\$ \$\mathrm{S0} = 1\$ and \$\mathrm{S1} = 0\$ There is also I/O read and write cycles, which are not part of this DCR M instruction, but when those cycles are active in other opcodes the control/status pin \$\mathrm{IO/\overline{M}} = 1\$
H: Help me understand the pinout of this 21" LED display driver I am trying to connect a 21" LED Display driver's input pins to my power board. There is a datasheet also but it doesn't have the input pin diagram. Therefore, I have got the below attached input pin diagram from the Chinese manufacturer. The things that I have understood by looking at pinout and datasheet of LED Display driver's is that on/off control takes 5V and that brightness takes the PWM input. The questions I have in mind is: Which ground is for which voltage. Does both 12V have common ground and the ground for on/off is separate. Will the system still work if I don't give the adj brightness (PWM input) input? I just quickly want to test it, so will the brightness default to a certain value or is it necessary to connect the adj. Will the on/off take 5V momentarily like a switch or do I need to supply constant 5V to keep the display on. Datasheet Input pin specs: AI: There is only one ground, and it is for all the connections. Possibly. It's not noted, in the datasheet, so you should assume it requires some form of input to work properly. Unknown. It's not noted, so assume it requires an external 5V source. I'm being vague because the answers to the questions you're asking are largely not in the documentation for the LED driver. It's possible the driver has internal pull-up/pull-downs that would make it operate without external controls inputs, when fed 12V, but it's not noted in the datasheet. You should contact the manufacturer, and ask for a proper datasheet.
H: Using Battery (li-ion) with higher capacity Just got portable radio Ambient Weather WR-111B. It is using CR123A 3.7V/800 mAh rechargeable lithium ion battery. On ebay I see CR123A 3.7V for a different capacity than 800mAh: 1200mAh or 2200mAh. My question: is it safe to use for this radio (or any other hardware) a battery with right voltage but with a higher capacity (800 mAh vs 1200mAh or 2200mAh) AI: Yes, it is safe. What is important in supplying power in batteries is the voltage. As long as you can supply the same voltage, then different capacity batteries will work, the only difference being different run times. A similar basic logic applies to power supplies as well. If your laptop has a 19 volt 1.5 amp power supply that you plug into the wall, you could replace it with a 19 volt 5 amp power supply. The laptop would only pull or grab the 1.5 amps that it needs, the power supply does not push the current into your computer. The voltage however, should stay the same. You should not go with a 19 volt 0.5 amp power supply as the laptop would try to pull more current than the power supply is built to supply and it would overheat. I am getting a little of topic. Go for the higher capacity battery if you want to spend the money.
H: System response types Whenever I am given a system type with a certain transfer function, I am always asked to proceed to find out the 1. impulse response and 2. step response of the system. My question is, what is so special about these two response types that other responses, like for example parabolic response, is not what I am asked to find out? AI: Actually, when you apply impulse signal to any LTI system, the output you get is 'impulse response'. Similarly, when input to LTI system is step signal, the output it produces is known as 'step response'. Now, sampled version of any signal can be represented as the product of original continuous time signal with shifted version of unit impulse signal (Sifting Property). Hence, the response of LTI system to any input signal is nothing but convolution of input signal & impulse response of LTI system. Hence, impulse response is very important practically. That's why they usually ask about finding impulse response of LTI system. For mathematical details, you may want to look at this.
H: What is the point of a small mark on a DIP IC opposite the pin 1 indicator? I have seen an unusual mark on an IC. Can anyone tell me does it have any functional or testing significance? AI: Perhaps this image would help. As you can see the metal pressing to connect the pins to the chip have a central bar that is exposed at the end of the resin.
H: Why use IEEE 802.15.4 over WiFi? I am researching about the deployment of sensors within smart cities; If I was to place an sensor unit on a row of street lamps, then have a main street 'router' that allows these sensors to upload data via 3G/LTE/Cabled/WiFi connection - why would I implement a IEEE 802.15.4 (ZigBee) network, over placing WiFi connections on each sensor? Would I use ZigBee simply because its low powered? AI: It's low powered for sure and can easily be battery powered. It can support up to 64,000 nodes and if you are data collecting small amounts of data from multiple locations this is a benefit. Transmission bandwidth is smaller than WiFi which means the receivers are more sensitive and, for a given power transmitted, the "error free" transmission range is bigger. When multiple devices are used the nodes can form together and act as repeaters for more distant devices thus keeping power low. The actual zigbee radio (node) is just a chip plus an antenna i.e. it's relatively small compared to a typical WiFi solution.
H: Have I damaged this DC-DC converter? I bought this DC-DC Adjustable Power Converter Module, to convert 12V DC to 5V DC. Initially it was working fine, but I connected IN- and OUT- pins to the each other and used it as a common ground for LED Display driver which takes both 12V and 5V as input but has one ground. After this it doesn't seem to work, the output voltage is stuck at 1.24V, no matter how much I vary the resistor which is there to control the voltage. Can you help me find out what component I have damaged and how? Edit 1: This is the schematic of my circuit: The output of DC-DC converter is 5V, which is fed to the pin 3 of the Display driver, I have a major question regarding the connection of ground pins. The Pinout for the LED Driver is here: Datasheet for the driver can be found here. I have questions regarding the ground of the display driver. There are two grounds, are both the same grounds? Should they be connected to the DC-DC converter input ground or output ground? AI: I'm assuming that your module is wired like the Typical Application shown on the LM2577 datasheet, which I reproduce below: As per datasheet, \$V_{out}\$ is determined by the following formula: $$V_{out} = 1.23V (1 + \frac{R_1}{R_2})$$ To get the 1.24V that you're reading, \$R_1\$ must be 0 (zero). Assuming also that \$R_1\$ is the trimpot in your module, I would hazard a guess that either the trimpot is at its lowest value (\$0\Omega\$), or it failed short (burned internally closing the circuit as a wire). In any case, it seems that some component in the module has failed. Can you measure the resistence between the trimpot contacts with a DMM and check if its really \$0\Omega\$? The measurements were these below, based OP's comment. The trimpot seems to be stuck at 5.2 Kohm. Here are the readings: \$5.2 k\Omega\$ between pins 1 and 2 \$5.2 k\Omega\$ between pins 1 and 3 \$0 \Omega\$ between 2-3. Resistance does not change, even if the rotate the screw on top a lot. Based on the above evidence, it looks like the trimpot is broken (failed short). If it was working, resistence between 2-3 would increase as you turned the screw, while the resistance between 1-2 would decrease (resistance between 1-3 would remain constant at 5.2Kohm in a working trimpot). Try and replace it and see if the module works again. Also, based on this answer to this question of mine (Why some LM25xx DC-DC adjustable step-up converters have two negative connections (IN- & OUT-) instead of only one ground?), both IN- and OUT- connections are likely to be shorted in your module already, so your shorting them could not have damaged the module.
H: Provide full specifications of the given IC? I have searched a lot in the internet about this IC, but I didn't get any answers. The markings are: 9903AJ DM74LS94N AI: DM74LS94N is obviously some variant of the famous 7400 series logic ICs. Therefore I'd google for "74LS94 data sheet" "74LS94N data sheet" "7494 data sheet" and see what turns up. I'd also identify the makers logo and, if possible, pick that makers data sheet if multiple hits are returned. n.b. Wikipedia says 7494 is "4-bit shift register, dual asynchronous presets" so I'd hope a 74LS94 would be the low-schottky (LS) version of that.
H: Are opamps as a voltage regulator effcient? If I setup an opamp in a non-inverting configuration as follows: Vrail+ is 7.5V, Vrail- is GND (0 V) Vin is 2.5V, Vout = 3.3V (in other words, the gain, aka, 1+R2/R1 is 1.32 [V/V]) Iout = 100mA (connected to some load) What are the source of my losses? How efficient are these types of configurations? Do I only take the quiescent current as the only loss? AI: The inherent efficiency will be the same as any other linear regulator, give or take, depending on the op-amp quiescent current (could be uA to mA for the op-amp just sitting there with no load). \$P_D = (V_{in} - V_{out}) \cdot I_{load} + I_q \cdot V_{in} \$ 100mA will require an expensive op-amp or a booster stage on the output. There's another problem- linear regulators are designed and specified for capacitive loads such as the bypass capacitors on whatever you're going to connect to the 3.3V rail. If you connect an op-amp as shown in your schematic to such a load it will probably oscillate and/or overshoot. That could damage your load, and even if the bypass capacitors kill the apparent oscillation it will greatly increase the power consumption of your circuit. I suggest that unless you have very special requirements, you should use voltage regulators to regulate voltage and op-amps to manipulate signals. It's not that you couldn't compensate such a circuit with additional components so it would be stable, it's just that I don't see the point.
H: Energy meter design/mcp390x I am considering the mcp390Xa series for a energy meter project. What I am not understanding here is where the voltage part of the watt calculation is happening. Is this up to the micro to measure voltage and apply it to the output pulses? When used it a non micro situation, is it assumed to be 115v, or whatever may be expected in that local? Supposing I use a decent micro, say a pic32, are there any advantages to rolling my own setup using something like an mcp3911? See reference design AI: The MCP390xA contains two ADCs — one for voltage and one for current — and a multiplier. Each output pulse represents a certain amount of real energy passing through the meter, averaged over time by an onboard DSP. See the reference design for details.
H: Computer line-in voltmeter I'm about to make a voltmeter from computer line-in. In some strange way I can not see direct current from computer. Why does it work only with alternating current? What information does captured wave contain? Could someone please explain basic principles of how does line-in work? How does sound capturing work in particular? Sorry if this isn't the right place to ask. AI: Why does it work only with alternating current? Line-in is for audio signals. A DC signal represents silence, whether it is 0V 0.5V or 1V. Therefore the desgners of the Line-in circuits are not interested in DC levels at all. As pjc50 commented, technically, DC is typically filtered out using a series capacitor. What information does captured wave contain? Line-in is designed to be used to accept varying voltage levelswhich represent variations in air pressure over time. Typically such variations caused by spoken conversation or music near to a microphone (or indirectly from a recorder, or synthesised versions of this). So long as the analogue signal is sampled at a high-enough frequency, the stored values can later be used to reproduce a good approximation of the analogue signal sufficient to potentially reproduce the variations in air pressure over time (using an amplified and loudspeaker/headphones/earphone).
H: Reading noise from allan variance plot for MEMS sensor per IEEE Std 952-1997 I am following the Standard Sensor Performance Parameters from the "MemsIndustryGroup" to test some Gyroscopes: I conducted a test and plotted the square root of AVAR (Allan Deviation) against Time per IEEE Std 952-1997 using MATLAB: I am confused however, by how I can read the Quantization Noise, Angle Random Walk, Bias Instability, and Rate Random Walk from this plot. The Standard Sensor Performance Parameters state to read them when T = 3^1/2, T = 1, Slope = 0, T = 3. When I read these values, my results look like this: I was wondering if I am doing this correctly. The example plots from both Standard Sensor Performance Parameters and IEEE involve slope lines that do not have anything to do with reading my plot: EX1 EX2 What is the proper way to read these noise parameters from my Allan Variance/Allan Deviation plot? Is my approach of reading the values correct, or should I try to make my graphs use the slopes as seen in the two examples? Etc. AI: The example plots show how five different parameters of the device characteristics contribute to the overall shape of the Allan Variance plot. However, it does not follow that you can always unambiguously derive the five parameters from any given plot. Depending on the relative values of the parameters, the effects of one or more of them may be completely masked by the others.
H: Advice Needed On Removing Stubborn Circuit I'm new to soldering and I've done some research on what I need in terms of material and tools and what I need to do in terms of removing and replacing a circuit. The circuit I'm replacing is a Laptop (ASUS g53sw) power jack. This component has 5 connections onto the circuit board and while I've been able to remove a good bit of the existing solder with a wick and flux I'm finding this component is still stubbornly stuck to the board. I'm in need of some good advice on how to remove this as I want to avoid damaging the system. I've read a number of articles and watched some good videos but I still need some pointers as I don't doubt a professional could handle this. AI: Usually, there is one pin that is making it hard to remove. That is usually the ground pin, and it will be attached to the ground plane. The ground plane will try to suck away the heat as fast as you can apply it. This is where you need a high wattage iron, so you can get it hot quickly. On a good day, you can remove the solder, then wiggle each pin until it breaks loose. Again, usually all except the one difficult one. Then you know which one to work on. Failing all that, there is plan "B". Destroy the connector--crush it, for example--and once all the plastic is gone, each metal contact can be dealt with on its own, instead of having a 5-piece puzzle.
H: Is it possible to use a digital pressure sensor with a ATtiny4313? I have a pressure sensor as follows, tested and works great with the Arduino Uno: Output is digital through SCL/SDA..... Will I be able to use this directly with the ATtiny4313 coding with Arduino language? On the Arduino Uno it's a piece of cake to connect up and use. I have not yet got the hang of the protocols and the datasheets are beyond my current knowledge and understanding. AI: Stop thinking Arduino and challenge yourself learning the bare metal microcontroller. 4k flash is not a lot for an Arduino sketch and none of the Arduino libraries are guaranteed to work, although some do. It is not supported though and there is no definitive list of libraries or library calls that work on different microcontrollers. Check the ATtiny4313 datasheet and search for TWI (two wire interface). The datasheets is like the bible for your microcontroller, everything you ever wanted to know about it is written in there and in my opinion the Atmel datasheets are pretty good to read. From experience I know I2C is a bit tricky to get working, but you can check the Arduino library for how they solved it. The ATtiny and ATmega families are closely related and the code will be reasonably easy to port. Acutally what you can do is work from your Arduino and port the Arduino specific code line by line until all Arduino specific commands are ported. Easy to test, and you can do it step by step. Then porting from ATmega to ATtiny is pretty straightforward.
H: Building a small 4-bit adder on a breadboard I am very new to using IC and basically a breadboard in general, but I am doing a project on how computers add and thought it would be nice to have a practical demonstration. My main question is, for the parts that I am going to list out, would a 5 volt input be ok? What size of resistor should I use to get a 9 volt battery down to 5 volts? And what size resistors would I need to use for the LEDs? Parts: C&K BD01, Lumex SSF-LXH400SRD, ST M74HC08B1R, TI SN74LS32N, TI SN74HC86NE4, I am new to all this. AI: It looks as though a 5V power supply is suitable for the parts you have listed. The easiest way to generate this 5V from a 9V battery is using a 5V voltage regulator such as a 7805. A resistor won't be able to produce a reliable 5V source from 9V, because the current drawn by the circuit will not be constant. The 7805 needs a couple of capacitors close to it for stability (see, for example, figure 6 of this datasheet). I note that you have a mixture of TTL (74LS...) and CMOS (74HC...) parts. Mixing logic families like this is often not guaranteed to work correctly, due to differing output and input voltages thresholds between the logic families. A very quick look at the datasheets for your parts suggests that high output voltage of the TTL part is possibly as low as 2.7V, whereas the CMOS parts may require at least 3.15V on the input to register a high value. Though this can be fixed with level translator chips or pull-up resistors, I would advise just getting some 74HC32 (or 74AHC32) parts to replace your 74LS32 ones. See this question for a description of how to calculate the appropriate resistor for LEDs. However, I suspect that your LED current will be limited by the maximum output current of your chips. You can get this value from the datasheets for the logic chips. Note that there is usually a per-pin current limit, as well as a total limit for current provided or sunk by all outputs. Though in this circuit you might get away without them, it is always advisable to put a 100nF decoupling capacitor across the power supply pins of each logic IC.
H: Routing traces for GPS antenna input I'm trying to integrate a breakout board circuit from SparkFun into my own design. It uses an external coax antenna with a SMA connector. I've brought their circuit over in its entirety, and from a hookup standpoint, it's identical. I'm worried about routing the antenna input to the GPS chip in my circuit though, as I have servos on the same board. Are there any rules of thumb to follow here? It'll be hard to see, but here's a picture of the layout, with the current GPS line highlighted: GPS datasheet: http://dlnmh9ip6v2uc.cloudfront.net/datasheets/Sensors/GPS/Venus/638/doc/Venus638FLPx_DS_v07.pdf AI: GPS (or any radio) RF trace to the antenna should not go across the whole board because of the interference, as it appears in your design. Some common sense suggestions are: Place the gps chip to the antenna connector as close as possible to shorten the route. Avoid placing other components and even other traces near the antenna trace, this includes the other side of the board. Make sure the impedance of the route matches the requirements for the chip and the design (for example, 50ohms). This depends on the material and thickness of the board and width of the trace. There are trace impedance calculators online, for example, the calculator at eeweb.com In my opinion you should either use the SparkFun board that is properly tuned and tested, or transfer it completely, including the connector, and choose a PCB material that is similar if not exactly like the SparkFun board.
H: Reversing a Photoresistor I'm a total newbie at this, but I have a photoresistor set up so that it controls the shorting on an audio circuit. When light is on, it shorts and cuts the sound. When it is dark, it closes and allows the circuit to run normally. How can I reverse this so that light will make the sensor close the short, thus allowing sound to run through? More simply, I just want the photoresistor to open with darkness, and cause more resistance with increasing light. Sorry for being so layman about it, but like I said, I'm very new at this. Thanks for any help. AI: Suppose that you have a divider like the one below and the DC source is the AC signal (using DC helps with the simulator) simulate this circuit – Schematic created using CircuitLab If the photo-resistor is in place of R1 then the output behaves like shown below and the output voltage increases as the resistance lowers (more light) if the photo-resistor is in place of R2 then the output behaves like shown below and the output decreases when the resistance lowers (more light) In both graphs the vertical axis is the output voltage and the horizontal axis is the resistance value (starting from left side and increasing to the right)
H: PC internal piezoelectric vs magnetic-driven speaker Do magnetic-driven speakers provide better "quality" (more frequencies) than piezo speakers? Do they consume power even when not in use? AI: Piezoelectric speakers do not have a very flat frequency response, which makes them less than ideal for reproducing the audible spectrum faithfully. However, they can be made very physically thin, and are typically good at making certain sounds very loudly with very little power. They also tend to be louder or more suited for high (including supersonic) frequencies. Sometimes, when design constraints are more important than audio fidelity, an engineer may select a piezoelectric speaker over a dynamic loudspeaker (the kind that use a voice coil and a permanent magnet). For example, thin tablets or phones often use piezoelectric speakers because there's no room for the necessary magnets and coils. Neither speaker technology uses power when not in use (depending on your definition of "not in use"). The crystal in a piezoelectric speaker requires power to oscillate, and no power to just sit idle. In a piezoelectric tweeter: "An audio signal is applied to the crystal, which responds by flexing in proportion to the voltage applied across the crystal's surfaces, thus converting electrical energy into mechanical." Therefore, if no voltage is applied, the crystal does not oscillate, and no sound is produced. In a dynamic loudspeaker, with no current through the voice coil, there is no magnetic flux and thus no opposition or attraction to the permanent magnet. The speaker will sit idle at whatever position the diaphragm and suspension are designed to at rest. Within whatever technology used to drive a speaker, there are many variables which will influence quality. There are excellent piezoelectric drivers and poor dynamic drivers. What you select depends on the application, budget, and design constraints. If you need a single frequency, considerable volume, and low power consumption, a piezoelectric speaker is probably ideal (buzzers, warning devices, alarms). If you require audio fidelity (more accurate reproduction of frequencies across a range), a dynamic loudspeaker or other technology is probably a better choice.
H: Controlling a Link Sprite camera through an AVR - how to get the data to a PC? I have a Link Sprite camera through which I intend to take image captures and store them into an EEPROM. Later, I want to extract the data from the EEPROM and display the image on a PC. What are my options here? I imagine UART is required to transmit the data to the PC, but what measures need to be taken on a PC to correctly extract this information? Are there any programs that allow you to send and save arbitrary bytes of data sent over USB? I have purchased a UART to USB serial converter for this purpose, but am a but lost on where to begin with the associated computer program. AI: Sometimes for this sort of thing some of the older file transfer protocols such as XMODEM are worth a look. While the speed and error correction aren't as good as many other protocols an advantage is that it's a simple protocol that has a small memory footprint. A search for "AVR xmodem source code" yields quite a few results, for example: Procyon AVRlib: xmodem.c Source File On the PC side you can run a terminal emulator program and you'll find many that support XMODEM. Tera Term is one example of a free one that supports it. You'll just need to open the COM port that's been assigned to your USB converter and do a File | Transfer | XMODEM | Receive once your AVR has started the transmission.
H: pic33f UART Problems I've been tearing my hair out at this for a while. I have a dsPIC33FJ16GS502 and I've been trying to get it to transmit a single character to my computer but so far, I have been getting absolute garbage: The uC should be sending 'b' instead of 0x89. I have a gist of my code available here. I have a 16 Mhz crystal connected to OSC1 and OSC2 with two 27 pF capacitors attached. I also have a 10 uF electrolytic cap at Vcap (datasheet says I should really use tantalum but I don't have any at the moment). I'm using a pickit 2 to program the uC. The TX pin is connected to a FTDI FT232 usb-serial converter. Baud rate is 9600. Maybe I'm missing something really basic. Any help would be greatly appreciated! Edit: Here's a photo of my setup: Edit 2: Measurements from a logic analyzer. There seems to be a fluctuation between 0x89 and a comma: AI: Edit: The level information was confirmed to be okay (TTL out inverted-> TTL in inverted on an FTDI USB bridge) but I've left it in at the end of this answer in case anyone else needs it. The easiest way to deal with this sort of troubleshooting is to break it down and confirm the bits are working. An oscilloscope (or logic analyzer) will confirm that the timing is correct and that the signal is not inverted and is the proper levels. That eliminates potential issues with BRG setting, clock source or frequency settings and so on. If there is a mismatch between the number of start and stop bits or length at receiver and transmitter, then it can show up when characters are sent one after the other with no space, so it can help to space them out (it also makes it easier to interpret the logic analyzer or 'scope images). Not in this case, since it's interrupt-driven but it's even possible the buffer could be overwritten. I have had good luck using Realterm as a terminal program, also Teraterm and Putty to a lesser extent. Original guess as to problem (left for historical reasons). If you are not using an RS-232 level converter, that could be your problem. A typical unit is the MAX232. As well as shifting levels to appropriate voltages, it inverts the signal. Most RS-232 receivers will respond to 0/5V signals, but the inverted signal will lead to incorrect data being received. From the datasheet linked above: The chip contains charge pumps to get +/- 8.5V signals from a single 5V supply, with only a few external ceramic or electrolytic capacitors. You could try it out with an inverter if you don't have any of these chips around.
H: Understanding Current Draw I have a DC- adapter which gives me the output of 12V and 3.3A, I want to connect it to a device which requires 12V and a few hundred milli amps, would this damage the device? or any device would automatically draw the current it needs and not anymore ? If it matters the device is a display driver. Datasheet. Please, Help me understand the basics of current draw. AI: Rating on the adapter indicates that its output voltage is 12v and it can supply a maximum of 3.3A. when adapter is connected to a load, voltage will remain same. but output current depends on the load resistance. In your case this adapter won't damage your display driver. instead it draws only required current from the adapter output. The concept is just basics of ohm's law. imagine that you connect a 12 ohm resistor at the output of your adapter. according to ohm's law 12/12 = 1A. that means only 1A current flows through the resistor. Same here also. Current through the device depend on the voltage across the device and internal resistance of the device.
H: Powerful electromagnet? Is it possible to produce over 1000 lb of magnetic force over a distance of 4 inches(0.101 meters), using an electromagnet? How difficult would it be? Explaining the general spec's of such an electromagnet? Most importantly,the power input... how much power would this electromagnet need? A few kWatts? AI: Here is a formula that is useful Force = \$(N\cdot I)^2\cdot 4\pi 10^{-7}\cdot \dfrac{A}{2g^2}\$ F = Force I = Current N = Number of turns g = Length of the gap between the solenoid and the magnetizable metal A = Area With 100 amps through a 100 turn coil of area 1 sq m, the force on a magnetizable metal at 100mm is 6283 newtons (about 1400 pounds). But what about the permeability of the electromagnet's core and the permeability of the "iron" it's attracting to - air forms the gap and it dictates the flux density. The input power needed to do this is zero because no work is being done in creating this force. However, if you actually want to know the losses you need to think about how thick the copper wire is to pass this current and maybe trade off number of turns with amps. Here's an online calculator and here is a page that explains the theory.
H: Radio Transceiver bulkhead connection and Ground I have a problem regarding mounting of RF transceiver. The main board inside metal cabinet is floating and when I check the antenna SMA bulk connector its outer case has a connection to circuit ground. This would eventually short the chassis ground to the circuit ground via pigtail. I need advice regarding this issue. edit: from the comments below The frequency is 850MHz. Pout=20dBm. AI: Usually the antenna ground will still be effective when connected via a (say) 1000pF capacitor. Reason: the capacitor acts like a short circuit at high enough frequency. A 1000pF capacitor at 50MHz has an impedance of 3 ohms. I don't know what frequency you are using so the actual capacitor value depends on the application but generally this can be a way of keeping isolation from any low frequency currents that would otherwise pass through the transceiver and cause it problems. It would certainly block DC and this may be the bigger issue such as when using a positive ground supply. On the other hand, the transceiver may work perfectly fine when grounded to the chassis. Another option is to use an RF isolation transformer in the feed to the antenna.
H: Why some LM25xx DC-DC adjustable step-up converters have two negative connections (IN- & OUT-) instead of only one ground? Recently I came across several 4-pin LM25xx DC-DC adjustable power converter modules such as the ones below. LM2577 Adjustable Step-up Converter Module from Amazon.com DC-DC adjustable step up power converter module from HobbyKing.com They look like this: I'm only familiar with similar 3-pin LM25xx modules that only have one ground connection, such as these. Murata's OKI-78sr Murata's 78xxSR Series They look like this: I searched the Net trying to find a datasheet for any of the 4 pin modules, and found none. Unlike the 3-pin versions that have plenty of good quality technical information in their datasheets. So, my questions are: What are those IN- and OUT- pins for? Can I just short IN- and OUT- to ground and use the 4 pin modules like the 3-pin versions? The context for my question is this other question (which is currently on-hold) and the fact that I want to design one of such modules myself and wanted to broaden my options. Also, I realize that the 4-pin modules are adjustable while the 3-pin modules are fixed output. But I don't understand what that has to do with the differences in the number of negative pins. From the application notes from the adjustable versions of LM25XX, such as below, I cannot imagine how IN- and OUT- pins would be wired up. To me, the only option is to provide positive input and output and a connection to ground. AI: Can I just short IN- and OUT- to ground and use the 4 pin modules like the 3-pin versions? It's 100% that it's already shorted on the PCB. So you don't have to short it again. What are those IN- and OUT- pins for? Well, probably it's there so that you can connect the input and the output wires there. In many cases, the input circuit and the output circuit are separate circuits so their negative poles should be connected somewhere. Those pins can be used for this.
H: Voltage divider using capacitors A test circuit requires to generate 1V (50Hz, sine) using a voltage divider made of capacitors. Simulation of the circuit using two identical ceramics capacitors (±5%) gives half of the input voltage as output, as expected. But on breadboard using signal generator, two identical capacitors, and picoscope, I get very small (less than 100mV) output. Any idea about this? Here is the test circuit: AI: The reason is that a capacitive divider only works for AC. Another way to look at this is that its output impedance is inversely proportional to frequency, so is very high at low frequencies and infinite at DC. Your combination of small capacitors and low frequency means the outut impedance of this divider will be quite high, about 16 MΩ in your case. That means even a 10x (10 MΩ) scope probe will attenuate the signal significantly. If you changed the capacitors to 100 nF, then the output impedance will be about 16 kΩ and you should see close to half the input sine amplitude on the scope. However, you still won't see 1/2 the DC level since the DC component of the input will always be blocked.
H: What is this tube thing? (Madcatz drum pedal) Could someone help me out, I have no idea what this tube-like thing is. This is from a Madcatz Xbox360 drum kit pedal. The pedal stopped working and I opened the it up and found just this tube thing connected to a wire going into a controller via a 2.5mm headphone jack, that plugs into a PC or Xbox360 with a USB cable. I'm guessing it's a vibration sensor or something (for when the pedal hit's the plastic on the opposite side of this tube), and this is the only electrical component in the pedal. My best guess is that it failed and that's why the pedal isn't working, and I hope it can be replaced. The cord seems fine to me. Photos: https://i.stack.imgur.com/gD3w6.jpg AI: That is a reed switch. It's basically a switch that is closed by a magnet. In your case, it looks like it has a bit of sleeving over one end, possibly to protect it from vibration, but there is nothing else unusual about it.
H: Fully understanding LM386 datasheet minimum parts example I'd like to fully understand the circuit marked as "Minimum Parts" at page 5 in LM386's datasheet: Is there any reason for 10k resistance at the input potentiometer or is it just an arbitrary value? For an audio application, should that be a logarithmic pot? There is a resistor and a capacitor connected in series to ground right after the output. It looks like a low-pass filter to me, but I've usually seen those with the load connected between R and C, not parallel to both. What's going on? Why is there a 250uF polarized capacitor right before the speaker? Is it just a DC blocking cap? Why 250uF and not other value? Perhaps just a high value so that the resulting high-pass filter cutoff is low enough? AI: Is there any reason for 10k resistance at the input potentiometer or is it just an arbitrary value? It's more-or-less arbitrary. 20K or 5K would be fine too, 10M, not so much. They suggest less than 250K source resistance, which would imply a 1M pot driven from a low impedance source would be just okay. For an audio application, should that be a logarithmic pot? Yes. There is a resistor and a capacitor connected in series to ground right after the output. It looks like a low-pass filter to me, but I've usually seen those with the load connected between R and C, not parallel to both. What's going on? It's a type of compensation, to keep the amplifier from oscillating. You may notice that when you want it to be an oscillator, it's not required. Take note also of the minimum gain requirement. The part is only guaranteed stable for gain > 9. As Brian Drummond points out, it is a Zobel network that helps make the speaker look less inductive and more resistive. Why is there a 250uF polarized capacitor right before the speaker? Is it just a DC blocking cap? Yes. Why 250uF and not other value? Perhaps just a high value so that the resulting high-pass filter cutoff is low enough? It needs to be be low impedance compared to the speaker at the lowest frequency of interest. A 250uF capacitor has 8 ohms reactance at ~80Hz.
H: Why should I use a logarithmic pot for audio applications? Just got really curious about it reading this answer from Spehro Pefhany. There Spehro comments that one should use a logarithmic pot for audio applications. So I googled it. The best article I could find was one titled "Difference between Audio and Linear Potentiometers"[1] which now seems to have been removed from the original website. There they said the following: ##Linear vs. Audio Potentiometers, or "pots" to electronics enthusiasts, are differentiated by how quickly their resistance changes. In linear pots, the amount of resistance changes in a direct pattern. If you turn or slide it halfway, its resistance will be halfway between its minimum and maximum settings. That's ideal for controlling lights or a fan, but not for audio controls. Volume controls have to cater to the human ear, which isn't linear. Instead, logarithmic pots increase their resistance on a curve. At the halfway point volume will still be moderate, but it will increase sharply as you keep turning up the volume. This corresponds to how the human ear hears. Well, I'm not satisfied. What does it mean that the human ear isn't linear? How do the log changes in the pot resistance relate to sound waves and how the human ear works? [1] Original (now broken) link was http://techchannel.radioshack.com/difference-audio-linear-potentiometers-2409.html. AI: Consider this: - Sound level is measured in dB and, a 10 dB increase/decrease in signal equates to a doubling/halving of loudness as perceived by the ear/brain. Look at the picture above and ask yourself which is the better choice for smooth (coupled with extensive) volume controller. Below are the Fletcher Munson curves showing the full range of decibels that a human can comfortably hear. Note, that unless your stereo system is very powerful, a range of 100 dB is "about right" for volume control. The Fletcher Munson curves also relate loudness to the pitch of a sound. Note also that the curves are all normalized to 1kHz in 10 db steps: - Approximately every 10% of travel of the wiper on the LOG potentiometer can reduce/increase the volume by 10 dB whereas a LIN pot will need to move all the way down to its middle position before it's reduced the volume by only 6 dB! When a linear pot is near the bottom end of its travel (sub 1% of movement left) it will be making massive jumps in dB attenuation for just a tiny movement hence it would become very difficult to set the volume accurately at a low level. It's also worth pointing out that a LOG pot is only able to cope with so much dynamic range of adjustment before it does the same (below -100 dB) but, the point is, this will hardly be noticeable at the tiny, quiet end of its travel. You might also note that the markings on a pot such as CW and CCW tell you which end of a pot is the ground end and the high-volume end. CW = clock wise and CCW is counter clock wise end points for the wiper.
H: What is this white board called? I am just trying to to figure out what this is called. What I am referring to in this picture is the white board with all of the connectors and the led light attached. I am trying to purchase one but I have no idea what they are called. AI: That is a Breadboard. It's hooked up to an Arduino.
H: What is the purpose of this simple 1 capacitor 2 resistor high pass filter? I have seen the standard high pass filter with the -3dB cutoff frequency = \$ 1/2\pi RC\$. simulate this circuit – Schematic created using CircuitLab However I have seen this particular circuit which I'm seeing here and there, especially on the inputs and outputs of ADCs DACs etc. Is the resistor there to limit the input/output current? Would the -3dB cutoff frequency change at all? If so, what frequency would the new one be at? simulate this circuit AI: Spehro gave you the answer, now let me tell you why you could (should?) have known that by looking at the circuit. Two resistors in series are indistinguishable from one resistor with the sum of the two resistances. (I hope you knew this?) Hence when we take Vout in the second circuit from the R1/C1 junction, we have exactly the same circuit as the first (but with R1' = R1 + R2). But instead we take the output from the R1/R2 junction. These two resistors form a pure resistive voltage divider, for which frequency is totally irrelevant. So the fact that we take the output from R1/R2 instead of from C1/R1 can't influence the frequency response, except from the constant factor R2/(R1+R2).