Id
stringlengths
1
6
Tags
stringlengths
3
101
Answer
stringlengths
38
37.2k
Body
stringlengths
26
26.8k
Title
stringlengths
15
150
CreationDate
stringlengths
23
23
3846
|logic-analyzer|
<p>After being fed up with trying to get rxtx to work on Linux, I decided to write my own command line client called <a href="https://github.com/Earlz/monosump" rel="nofollow">monosump</a>. It's only dependency is mono(or .Net 4.0 on Windows). It's of course, quite basic, but depending on your needs it might work well for you. </p>
<p>I finally broke down and bought this board: <a href="http://hackaday.com/2010/02/28/open-source-logic-analyzer-2/" title="Hackaday.com">http://hackaday.com/2010/02/28/open-source-logic-analyzer-2/</a></p> <p>It "seems" like it would be really helpful, the problem I'm having is getting it setup, I am not finding much of a "how to" anywhere. Here are the problems I'm having.</p> <p>I would like to get it working on both my windows and linux machines, the problem with the windows machine is that using the logic analyzer software I can't see the "capture" button at the bottom of the screen cause of my netbook resolution, and since I can't change my resolution I can't get it working there.</p> <p>My Ubuntu machine I couldn't find a download for the S/W except in a .exe format, so I had to download and install wine on my machine, but when I plug in my board I'm not sure if it's detected. There appears to be a rxtx module I need to setup and install. But I'm not sure what version I should use. I found links to some of this from the comments (where I in fact commented) here: <a href="http://dangerousprototypes.com/2010/02/25/prototype-open-logic-sniffer-logic-analyzer-2/" title="Dangerous Prototypes">Dangerous Prototypes</a></p> <p>does anyone have any good suggestions on what to do at this point?</p> <p>Also anyone have/know of a clear step by step guide (with possibly copy paste commands for the command line portion? as the wget calls can get hard to read and I'm not sure what the link is most times)</p>
Openbench Logic Sniffer setup
2010-08-03T19:12:16.747
3849
|microcontroller|timer|pic|
<p>There is an example in the <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/33023a.pdf" rel="nofollow">PIC Mid-Range MCU Family Reference Manual</a> for Reading and Writing Timer1 in Asynchronous Counter Mode.</p> <p>Example: Reading a 16-bit Free-Running Timer</p> <pre><code>; All interrupts are disabled MOVF TMR1H, W ; Read high byte MOVWF TMPH ; MOVF TMR1L, W ; Read low byte MOVWF TMPL ; MOVF TMR1H, W ; Read high byte SUBWF TMPH, W ; Sub 1st read with 2nd read BTFSC STATUS,Z ; Is result = 0 GOTO CONTINUE ; Good 16-bit read ; ; TMR1L may have rolled over between the read of the high and low bytes. ; Reading the high and low bytes now will read a good value. ; MOVF TMR1H, W ; Read high byte MOVWF TMPH ; MOVF TMR1L, W ; Read low byte MOVWF TMPL ; ; Re-enable the Interrupt (if required) CONTINUE ; Continue with your code </code></pre>
<p>Since an 8-bit MCU can't read the whole 16-bit timer in one cycle, this creates a race condition where the low-word can roll over between reads. Does the community have a preferred method of avoiding these race conditions? I'm currently considering stopping the timer during reads, but I'd like to know if there's a more elegant solution.</p> <p>FYI, this is for a <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/41262E.pdf" rel="nofollow">PIC16F690</a>.</p>
Reading a 16-bit timer on an 8-bit MCU
2010-08-03T23:23:31.283
3869
|arduino|uart|serial|data|
<p>There's a neat trick you can do if the communication is in one direction only at a time (i.e. half-duplex communication). It won't work if both sides talk to each other at the same time (full duplex) but if it's your typical "do this" "ok here's the response" "now do this" "ok here's the new response" type of communications it works quite well.</p> <p>Since the UART link uses an idle condition of the transmitter at a logic high (1) level you would use a 2-input AND gate and connect the TX from each side to an AND input. The output of the AND gate is your input to your sniffer's UART (it's RX pin). Now take device B's TX line and also bring it to an I/O port on the sniffer. You will configure the sniffer to generate an interrupt when this pin goes from high to low.</p> <p>To recap: device A UART TX -> AND gate input. Device B UART TX -> other AND gate input AND sniffer GPIO pin. Output of AND gate -> sniffer UART RX line.</p> <p>UART communications consist of a start bit, some number of data bits, an optional parity bit, and one or more stop bits. Since the idle state is a logic high (1), the start of EVERY byte will be a logic low (0) and the interrupt on the sniffer will fire. While your sniffer is executing the I/O interrupt the UART hardware will be collecting bits from the AND gate. By the time the UART has received the stop bit, the I/O interrupt will be long done and the UART RX interrupt will fire.</p> <p>The interrupt-on-IO-change routine will set a "direction" variable to indicate that communications are in the "B->A" direction. The sniffer's UART receive interrupt would look at this "direction" variable and write the just-received byte to the appropriate buffer. The UART RX interrupt would then set the "direction" variable back to the default "A->B" state:</p> <pre><code>volatile int direction = 0; /* 0 = A -&gt; B */ void io_interrupt(void) { direction = 1; /* switch direction, now B -&gt; A */ } void uart_interrupt(void) { unsigned char b; b = UART_RX_REG; if(direction) { store_byte_to_device_b_sniff_buffer(b); } else { store_byte_to_device_a_sniff_buffer(b); } direction = 0; /* reset direction to default A -&gt; B */ } </code></pre> <p>This code is written for clarity and not necessarily what you'd write in a real-world situation. Personally I'd make "direction" a pointer to the appropriate FIFO structure, but that's another exercise entirely. :-)</p> <p>When device A is talking the I/O line does not move (it remains at a logic '1' since device B's UART transmitter is idle), and the UART RX interrupt will receive a byte, see that the direction is A->B, and store the data to that buffer. When device B is talking the I/O line will go low as soon as device B starts shifting data out, and the I/O interrupt routine will set the direction to indicate that device B is talking. The UART RX interrupt will eventually fire after all the bits have been collected and since I/O interrupt has taken care of setting the direction register appropriately, the received byte will be stored in the correct buffer.</p> <p>Presto: half-duplex communications between two devices captured with a single UART and I/O line on the sniffer, with no bit-banged UART communications.</p>
<p>I have a need to install an Arduino (actually just the IC) into existing hardware to enhance functionality. </p> <p>What I would like to do is connect the Arduino so that it "spys" on the I/O lines between two chips on a board. If the Arduino picks up a specific keyword on that UART connection, it will perform a specific action on a separate set of output pins. </p> <p>What I'm uncertain about is how to connect the Arduino in such a way that it can decode an existing UART connection without participating? If not possible, I am interested in theories, ideas, etc.</p>
Can the Arduino be used to "spy" on a UART connection between two devices?
2010-08-04T22:12:44.487
3881
|rf|antenna|
<p>50 Ohm is input impedance of feedline to the antenna. In general practice, we connect an antenna with 50 Ohm connector ( like SMA, Coax...) so feedline impedance should be also 50 Ohm.</p> <p>For Bluetooth antenna design at 2.4 GHz, you can also refer <a href="https://anilkrpandey.wordpress.com/2017/01/19/inverted-f-bluetooth-antenna-design-for-smart-phone/" rel="nofollow noreferrer">https://anilkrpandey.wordpress.com/2017/01/19/inverted-f-bluetooth-antenna-design-for-smart-phone/</a></p>
<p>This is an intentionally very open ended question. What does it mean for an antenna to be a 50-ohm antenna at some frequency? How do you make a 50-ohm antenna for say 433.92MHz? What are the options? What are the consequences of it being different from 50-ohms?</p>
What is a 50-ohm antenna? How would you make one?
2010-08-05T17:41:27.293
3895
|pwm|inverter|igbt|
<p>From your question, it sounds like the IGBT drivers themselves failed. Like most things, failure can be due to overvoltage, or due to overpower. Overvoltage is possible, but would probably be due to an sub-optimal circuit design.</p> <p>Overpower might indicate very high switching frequencies, an undersized driver for the IGBT you're running, or that the IGBT gate-emitter has gone to a dead short.</p>
<p>I'm controlling an IGBT inverter with a DSP. I'm pretty sure I turned on two IGBT's at the same time which made a short circuit. The PCB I'm using to step up the PWM signal to drive the IGBT's let the smoke out and I'm trying to figure what my problem is. If the IGBT did get turned on to cause a short then is it possible that the currents going into the IGBT driver got massive? Thanks</p>
Was this a high IGBT gate current?
2010-08-06T08:46:44.313
3911
|untagged|
<p>Don't limit yourself to only local EE's because it will greatly reduce your choices. </p> <p>I'm an EE that designs electronics (including Bluetooth) for entrepreneurs and small companies around the U.S. and UK. None of my clients are local, nor do they need to be.</p> <p>As others have explained not all EE's are the same and it is a huge field of study. For example, I would bet that very few EE's have experience designing Bluetooth. So be sure to hire one with the exact skills you need.</p> <p>I recently wrote an article on this very subject that you may find helpful:</p> <p><a href="http://teelengineering.com/contracting-the-right-electrical-engineer-for-your-project" rel="nofollow">http://teelengineering.com/contracting-the-right-electrical-engineer-for-your-project</a></p>
<p>I'm trying to find a local (nyc) electrical engineer, or electrical engineering company to help me make a small device that involves cell phones and bluetooth - at least I think it will involve bluetooth.</p> <p>My questions are simple:</p> <p>Are there any sites devoted to contract jobs for electrical engineers? How can I find small local EE companies that might be able to help me? How can I best judge the quality of an EE?</p> <p>Thanks! </p>
How can I find a good (local) electrical engineer
2010-08-07T06:43:08.440
3934
|oscillator|
<p>Cheapest DIY DDS signal generators (including sine wave):</p> <p><a href="http://www.myplace.nu/avr/minidds/index.htm" rel="nofollow">http://www.myplace.nu/avr/minidds/index.htm</a></p> <p><a href="http://www.scienceprog.com/avr-dds-signal-generator-v20" rel="nofollow">http://www.scienceprog.com/avr-dds-signal-generator-v20</a></p>
<p>A Google search will give you a few billion ideas. Which is the simplest/easiest/cheapest that you know of?</p> <p>Generating a square wave and then filtering out the harmonics isn't a good solution unless the filter frequency can be varied along with the square.</p>
What's the easiest/cheapest variable-frequency sine wave oscillator?
2010-08-08T03:03:43.547
3939
|serial|eeprom|
<p>Microchip also has an example of how to implement a USB mass storage device.</p> <p><a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1824&amp;appnote=en536602" rel="nofollow">AN1189 - Implementing a Mass Storage Device</a></p>
<p>Is it possible to format an SPI EEPROM (such as AT24C128) to be used as an SD card? So format it with FAT 32 and have a 16MB drive appear in windows?</p> <p>Thanks</p>
Serial EEPROM with FAT
2010-08-09T07:25:01.460
3941
|rf|filter|impedance|
<p>I will limit my answer to the electrical realm. Impedance (Z) is literally just V/I. It is as simple as that. But 'that' is not so simple in all cases. Let's start with simplist and work up.</p> <p>If the impedance is a simple lumped resistor and V is a DC voltage (frequecy = f = 0), we can rewrite Z=V/I to be R=V/I.</p> <p>If the impedance is due to a cap or an inductor, then impedance is frequecy dependent.</p> <p>If frequencies get high enough that components do not appear as lumped elements, then impedance is not only frequency dependent but location dependent. Sometimes these elements are designed to be distributed (e.g, wave guides, antennas and EM waves in free space), and sometimes not.</p> <p>The general tool which has been developed to portray these higher frequency effects in time and space (1 dimension) is . . . Z=V/I. But 'V' and 'I' are both complex vector quantities of the form (A)(e)^(j(wt+x)), where j=SQRT(-1), 'A' is a constant, 'e' is the base of the natural logarithm, 'w' is frequency in radians/second, 't' is time in seconds, and 'x' is distance along the 1-D path. Since 'Z' is a ratio of these two complex vectors, it, too, is a complex vector which varies in time and space. The electrical engineer manipulates these quantities for the time and location desired, and then takes the real portion of V or I (or Z) to get what is observed in the real world.</p>
<p>This is presented as both a resource for the community and a learning experience for myself. I have just enough knowledge of the subject to get myself into trouble, but I don't have the best grasp of the subject's details. Some helpful responses might be:</p> <ul> <li>Explanation of the components of impedance</li> <li>How those components interact</li> <li>How can one transform impedances</li> <li>How this relates to RF filters, power supplies, and anything else...</li> </ul> <p>Thanks for the help!</p>
What is impedance?
2010-08-09T07:50:04.333
3944
|usb|avr|lufa|
<p>AVR based 25 buttons joystick programmable from linux can be one of those projects: <a href="http://www.obdev.at/products/vusb/prjhid.html" rel="nofollow">http://www.obdev.at/products/vusb/prjhid.html</a>. USB has many standard device classes, and HID is one of them, convenient for keyboards, mices and joysticks, especially since all operating systems support it, which means that you don't have to provide driver for your device. You don't need to know the low level side of USB/HID if you use such example projects, but you can find a lot of info at USB official site and documentation.</p>
<p>I wonder which hardware will be the best for playing with USB because its looks like a lot of projects only use atmega8 (or even attiny). But would it really be easier with an AT90USB which have the built-in USB?</p> <p>I have already looked at some HID libraries (lufa, avr-usb, v-usb…) but they are complex. Does anyone have a link to a specific project or a one-case explanation of the USB implementation?</p> <p>For the details : I would like to make a ~25 button joystick and I work on linux.</p>
Which AVR hardware for USB?
2010-08-09T12:38:48.500
3995
|atmel|avr|xmega|
<p>Here I'm using avr-gcc v4.8.2 (both Atmel release and home-grown produce identical results), with AVR Dragon and avrdude 6.1-svn from September - there have been some updates since I believe. avarice 2.13svn works, used with avr-gdb 7.6, which I believe is also a bit dated now. Most of my interfacing in the meantime is via the Chip45 bootloader, in my case for Xmega128a4u</p>
<p>What are the hardware and software options for programming an XMEGA from Linux?</p>
What is the state of XMEGA programming from Linux?
2010-08-11T17:55:59.723
4000
|serial|manufacturing|
<p>NTE has <a href="http://nte01.nteinc.com/nte/NTExRefSemiProd.nsf/%24%24Search?OpenForm" rel="nofollow">a search engine</a> for finding part number for their replacement parts.</p> <p>For the MAX232, it looks like you want NTE7142.</p>
<p>Can you please tell me how to find part number of the particular chip.</p> <p>I was trying to find max232 chip locally, and I have been told that I need to provide NTE part number. I searched google, but could not find proper part number for chip</p> <p>Thank you</p>
how to find NTE part numbers
2010-08-11T22:40:26.670
4012
|batteries|power-supply|
<p>Completely discharging you battery is bad for <strong>all batteries</strong> (well, maybe not lithium-hydrogen batteries, but if you have those in your laptop, you know what you're doing anyways).</p> <p>The practice originates with NiCad batteries, due to a confluence of unfortunate design decisions. The common-knowledge belief that NiCads loose capacity if not fully cycled is <strong>false</strong>.<br> Basically, the shallow-cycling of NiCad batteries results in a depression of the discharge curve, resulting in many electronic devices which use NiCads <em>incorrectly</em> reporting the battery as being empty. Note that the capacity of the cell is not significantly reduced, the cell voltage is merely depressed by a small amount. The fact that the major portion of the NiCad discharge curve is very flat leads to a small change in overall cell voltage causing a large change in the battery "Charge State" readout.</p> <p>Note that the memory effect occurs only with NiCads, and was never actually even present in <strong>any</strong> other cell chemistries. The conflation of battery types, and naive assumption that all batteries are the same is what has lead to the belief about all batteries needing periodic cycling.</p> <p>It is probably more accurate to think about batteries as being able to store and release a certain amount of energy, rather than being able to withstand a certain number of cycles. Whether this energy is release in 500 half-cycles or 1000 quarter-cycles is largely not relevant (An increased depth of discharge will actually <em>reduce</em> the total overall energy capability of batteries, though not significantly unless the batteries is discharged <em>completely</em>).</p> <p>The manufacturer's that state that you should fully discharge and recharge your devices battery are stating this solely so that the internal battery charge <em>measuring</em> electronics can properly calibrate themselves. Basically, over time, the charge-state measurement will drift due to slight variance in the efficiency of charging and discharging the battery (basically, it's an integrator). A single full-cycle lets the electronics accurately measure the battery capacity without having to guess about the battery condition. The fact that if not fully cycled, battery measurement electronics will inaccurately <em>report</em> the battery state has led to the perseverance of the Memory Effect myth. The battery has not actually changed, the electronics are merely reporting an incorrect charge state.</p> <p>As far as I know, the biggest cause of gradually reducing battery life in electronics is time. Lithium batteries actually have a shelf-life rated in a few years, <em>whether they are used or not</em>. Proper storage practices can extend this shelf life, but they <em>will</em> decay over time, no matter what use you put them through.</p> <p>Deep cycling lithiums is actually quite bad for them, actually. Don't do it unless you have to (try to stay above 20% SOC).</p> <p>Note: I am skipping a few things, like the issues with whisker growth in nicads. See the below link on NiCad for further reading.</p> <p>See:<br> <a href="http://en.wikipedia.org/wiki/Memory_effect" rel="nofollow">http://en.wikipedia.org/wiki/Memory_effect</a><br> <a href="http://en.wikipedia.org/wiki/Nicad" rel="nofollow">http://en.wikipedia.org/wiki/Nicad</a></p>
<p>I've been told that <s>many kinds of batteries work best if they are used until they are completely drained, and then recharged.</s></p> <p>(Edit: <em>The <a href="http://www.repairfaq.org/ELE/F_NiCd_Memory.html" rel="nofollow noreferrer">"memory effect myth"</a> is quite widespread. Batteries work just as well if they are "topped up" every time.</em>)</p> <p>Right now I design devices the standard way: try to use the battery power as long as possible, and then when there is no power left it doesn't work at all.</p> <p>If there was some simple way of implementing the following, I might use it from now on:</p> <ul> <li>Two independent batteries (or more)</li> <li>Once you start using one battery, continue to use it until it is <s>completely drained</s> <em>reaches the manufacturer-recommended minimum voltage</em>.</li> <li>When the "in use" battery is completely dead, switch to using the next battery. Presumably you use some technique similar to the <a href="https://electronics.stackexchange.com/questions/401/switch-between-5v-power-supplies">"Switch between 5V power supplies?"</a> question.</li> <li>Once you switch to the last battery, go into some sort of low-power mode so it can still do the important things in "limp mode", but the user is notified to plug it into a charger as soon as possible.</li> <li>After plugging into the charger, go back to standard mode -- but if disconnected from the charger before the batteries are fully charged, go back to limp mode.</li> <li>(optional) When plugged into the charger, only charge the drained battery (or batteries) and keep them topped off; leave the one "in use" battery alone.</li> <li>(optional) keep track of precisely how much total energy could be extracted from each particular battery the most recent time it was fully drained. Use that number (perhaps modified using Peukert's law) to give extremely accurate estimates of future run-time.</li> </ul> <p>Why don't all devices do this?</p> <ul> <li>cell phones: first battery: talk like crazy. last battery: only emergency calls.</li> <li>laptops: last battery: throttle back to a slow speed that is adequate for looking up static documents</li> <li>handheld GPS: last battery: try to reduce energy by updating the screen less often, dimming the backlight, etc.</li> </ul>
How do I design a device to automatically switch to the backup battery?
2010-08-12T17:32:40.543
4015
|telephone|potentiometer|
<p>According to <a href="http://www.sandman.com/loopcur.html#CircuitLoss" rel="nofollow">this</a> document, from a company that sells circuit loss testers, telephone companies are required to provide -8.5 dB (relative to a 0 dB 1 KHz test signal). However it says "generally speaking, anything below a -7.5 gets hard to hear", and "the ideal db loss to look for is -5.5db."</p>
<p>I'm trying to dig up the "rule of thumb" value for what a telephone company would consider acceptable path loss when they run a new line out to a customer. I spent a lot of time in digital telephony but the number for a regular voice line is eluding me.</p> <p>I'd always considered 3-4dB to be the number, but some of the articles I'm pulling up are saying 5.5dB to even 8.5dB as within spec. This seems to be an awful lot of loss which would translate to quiet audio. I know the actual path loss varies with the length of the loop, but there are typical and maximum values that I'm trying to find.</p> <p>Does anyone have any rules of thumb or experience in this area? What is the typical path loss of a telephone line and at what level of attenuation will a telco actually do something to remedy the situation? </p>
Telephone line acceptable path loss?
2010-08-12T18:08:49.843
4022
|8051|programmer|flash|
<p>From Section 20 of the <a href="http://www.silabs.com/Support%20Documents/TechnicalDocs/C8051F31x.pdf" rel="nofollow">datasheet</a></p> <blockquote> <p>C8051F31x devices include an on-chip Silicon Labs 2-Wire (C2) debug interface to allow Flash program- ming and in-system debugging with the production part installed in the end application. The C2 interface uses a clock signal (C2CK) and a bi-directional C2 data signal (C2D) to transfer information between the device and a host system. See the C2 Interface Specification for details on the C2 protocol.</p> </blockquote> <p>So, yes, sounds like you need a special (non JTAG) programmer.</p> <p><a href="http://www.silabs.com/products/mcu/Pages/USBDebug.aspx" rel="nofollow">Here's one</a>, it's $35.</p>
<p>Or does that chip require a bunch of weird voltages that can only be generated by a "special" expensive device programmer?</p>
Can I download a new program to a Silicon Labs C8051F311 with a JTAG programmer?
2010-08-13T04:28:59.140
4027
|led|multiplexer|charlieplexing|
<p>The most significant disadvantage of "Charlieplexing" lights is that it limits the number of LEDs that can be driven with 'n'-way multiplexing to n(n-1). I don't see the tri-state driver requirement as being much of an issue with the technique as a whole. Certainly having to use two conventional drivers instead of a tri-state driver will reduce the benefit from CharliePlexing, but in some cases advantages may still remain (e.g. it may reduce the number of interconnect wires between a panel with the drivers and a panel with the lights or switches).</p> <p>As for Charlieplexing switches, the Wikipedia article fails to mention the biggest disadvantage: Charlieplexing does not allow a controller to passively wait for a button push. On the other hand, it's overly pessimistic about component requirements. In 1997, I produced a device which scans eight buttons using three I/O pins and one input-only pin on a PIC12C508, without need for any external diodes or other components except IIRC a pull-up for a PIC pin which didn't have one built in; the approach could have handled ten buttons with the addition of another pull-up resistor (for another I/O pin that didn't have one), but the customer only need eight buttons so there was no need.</p>
<p>I've reviewed the two methods, and multiplexing really only appears to have one advantage, that it would be easier to track down a failed LED than in a Charlieplex array.</p> <p>Can someone more knowledgeable explain any other trade-offs?</p>
Is Multiplexing ever superior to Charlieplexing?
2010-08-13T19:08:18.943
4042
|oscillator|theory|
<p>The oscillator is an amplifier with filter and loop back connection. In theory with no noise it will never work. In practice there is always some thermal/mechanical/electromagnetic noise. So noise is amplified, filtered and fed back.</p> <p>For this reason some modeling software fails to model oscillation. For the same reason oscillators with very high quality of signal (narrow band) have difficulty to startup (slow startup time). </p>
<p>Can someone explain to me / point me to a good explanation of the theory behind an electronic oscillator? The Wikipedia entry explains <em>what</em>, but not <em>how</em>, which is what I need to know.</p> <p>TIA.</p>
Grokking oscillators
2010-08-16T17:13:24.057
4060
|switches|digital-logic|flipflop|
<p>Make a T flip-Flop by shorting the inputs of a positive edge-triggered j-k flipflop and connect the pushbutton output to the clock input of j-k flip flop. </p> <p><img src="https://i.stack.imgur.com/NMaAP.png" alt="schematic"></p> <p><sup><a href="/plugins/schematics?image=http%3a%2f%2fi.stack.imgur.com%2fNMaAP.png">simulate this circuit</a> &ndash; Schematic created using <a href="https://www.circuitlab.com/" rel="nofollow">CircuitLab</a></sup></p>
<p>What are the simplest, cheapest, smallest ways to make a momentary switch produce a 2-state toggling output (latching momentary switch)?</p> <p>In other words, the output is continuously low, and when you momentarily press the button/tact switch, the output changes to continuously high, and then when you press it again, it switches back to low.</p>
Make a momentary switch control a toggle
2010-08-17T20:53:07.910
4064
|dsp|adc|cmos|camera|
<p>Hearing "tiny" and "adc", I'd think of <a href="http://www.linear.com/pc/viewCategory.jsp?navId=C1001" rel="nofollow">Linear</a> first. You might want to look through their stuff.</p>
<p>I have a problem: I've got <a href="http://www.ovt.com/products/sensor.php?id=49">five tiny CMOS image sensors</a> (2mm x 2mm), each in a small space (about 10mm x 15mm). They take a clock signal in, and output an analog signal, requiring an 8MSPS ADC each. Somehow I need to get the image data into a PC. This is difficult because of the tight space constraints.</p> <p>Ideally, I'd like to locally sample the data with a DSP, and video-encode it, at which point, it will be relatively easy to get into the PC via an EtherCAT bus which is close by.</p> <p>The problem is, how on earth can I get 8MSPS into a tiny DSP in a tiny space? I know there are some pretty small DSPs, but: Are there any tiny DSPs with 8MSPS ADCs? Are there any tiny 8MSPS ADCs?</p> <p>I have looked hard, but I cannot find any. Sad</p> <p>Many thanks</p> <p>Hugo Elias </p>
Tiny 8MSPS DSPs?
2010-08-17T21:16:17.953
4072
|heatsink|voltage-regulator|pcb|
<p>If you're stuck using linear regulators, you can put big power resistors in series with the inputs of the regulators to drop the voltage and share some of the heat dissipation. You're dissipating the same amount of power either way, but it might make it easier to fit on your board or whatever.</p> <p>If you're using an LM7833, for instance, and supplying 150 mA, the datasheet says the dropout is 2 V, so the input voltage has to always be above 5.3 V. From a 14 V supply at 150 mA, this is a <a href="http://www.wolframalpha.com/input/?i=%2814+V+-+5.3+V%29+%2a+150+mA" rel="noreferrer">2 W</a>, <a href="http://www.wolframalpha.com/input/?i=%2814+V+-+5.3+V%29+%2F+150+mA" rel="noreferrer">56 Ω</a> resistor. The resistor just needs air circulation around it, not a heatsink, and then your regulator only needs a 500 mW heatsink instead. The highest power dissipated in the regulator will be at the current when resistor and regulator are both dissipating the same power, which in this case is about 95 mA.</p>
<p>I have a project where my power supplies are giving me a bit of a headache. I have three voltage regulators that I am trying to run from a single bench power supply. There are two 3.3V regulators, and one 12V regulator. The current draw for the 12V regulator is up to 500 mA, and each 3.3V regulator peaks at 150 mA. </p> <p>When I hook up about 14V to the inputs of these regulators, the 3.3V regulators start to cook. Doing the math, that's about 1.7W of power dissipation for each of the 3.3V regulators. They're in a TO-220 package pointing straight up, and they got too hot to touch. I was able to throw a random heatsink I found on the tab and cool things down, but the top of the heatsink was about 2.5 inches high - very flimsy and cumbersome.</p> <p>I really don't want to sacrifice the single power supply input, and I also really don't want to go to an on-board switching supply for either the 12V or 3.3V supplies. What are some passive package+? solutions for dissipating up to 2.0W of heat that are physically secure and low profile (shorter than 1 inch)?</p> <p>Edit: My reasons for not wanting a switching supply are:</p> <ol> <li>I don't want to deal with switching noise in the analog parts of my design</li> <li>I'm less comfortable with designing a switching regulator than using a linear regulator</li> <li>The PCB that I'm working on is big and expensive. I don't have the time/budget to "try out" a regulator. A linear regulator with enhanced heat dissipation seems a lot safer way to avoid making coasters than a switch mode regulator.</li> </ol>
Low Profile Power Dissipation
2010-08-18T04:45:47.297
4080
|microcontroller|
<p>You've received a ton of great information on microcontrollers, but if you want to simplify your job on the display end, you might want to take a look at some LCDs that make designing GUI and displaying graphics easy. Although I haven't used its graph functions before, I have used Amulet Technologies' LCDs (both monochrome and color) and have been very pleased with how easy it is to use in combination with a little microcontroller. You just have to implement its RS232 serial protocol, which is pretty simple.</p>
<p>Ok so I have a project I am wanting to create but it would require a bit of processing power. The most powerful thing I've seen yet has been the <a href="http://www.mouser.com/ProductDetail/Atmel/ATMEGA1284P-PU/?qs=sGAEpiMZZMtVoztFdqDXO3QpeG9FlGm9" rel="nofollow">ATMega1284P</a>. Really by power I mean I need Program Memory and RAM, not raw MIPs. </p> <p>Is there anything else out there that is hobbyist friendly? </p> <p>By hobbyist friendly I mean not having to have any expensive machines to solder it (rework stations etc). Also of course being capable of buying just a couple of them without spending an arm and a leg. And of course having freely available compilers and other software tools. </p> <p>My project is to build a small (portable) calculator with simple graphing capabilities and possibly some limited programming capabilities. </p>
Are there any powerful processors that exist that are hobbyist friendly?
2010-08-18T16:57:58.783
4084
|infrared|connector|
<p>The connector is made by JST, as the linked page says. I know from looking at it and using lots of JST connectors that it's PH series connector, but you can also find that by looking at <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=9750" rel="nofollow">this</a> Sparkfun page, or by (tediously) looking through Digikey and JST catalogs. </p> <p>The plastic part of the connector you linked is called a "housing", and it holds the crimp terminals that are crimped onto the wire, and which slide over the housing. That one is part number PHR-3 (PH series, rectangular (1x3), three terminal). You can get it from Digikey <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=455-1126-ND" rel="nofollow">here</a>, or from Future Electronics. <strong>Mouser isn't a JST distributor.</strong> </p> <p>However, you'll definitely need the terminals that go with it. They're P/N <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=455-1127-1-ND" rel="nofollow">SPH-002T-P0.5S</a> for the 24-30 gauge wire. (You'll also need stranded wire for this. The picture is nice and big on the Digikey site, but the terminal is TINY. </p> <p>Unless you have <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Detail&amp;name=455-1128-ND" rel="nofollow">this</a> $400+ tool, you cannot effectively crimp these terminals. Note that I've sucessfully crimped these terminals with a PA series crimper, if you happen to have one of those on hand... You need to strip as little insulation as possible (The long tabs grip the insulation and provide strain relief, while the short ones grip the wire), a good hand on your soldering iron, and plenty of flux on both the terminal and the wire. It can be done.</p> <p>What you need instead is a KR-series connector. They're IDC style, (Insulation displacement connector) so you don't need to do any crimping. The datasheet is here:<br> <a href="http://www.jst-mfg.com/product/pdf/eng/eKR.pdf" rel="nofollow">http://www.jst-mfg.com/product/pdf/eng/eKR.pdf</a><br> and you'll easily see from the datasheet that what you want has the part number 03KR-6H-P. Unfortunately, Digikey doesn't keep these on hand. Finding them is left as an exercise to the reader.</p> <p>All that being said, I've also used the Sharp IR distance sensors before I had access to the crimp tool at my current place of employment, and simply desoldered the existing connector, soldered on my own wires, and hot-glued the assembly to prevent strain on the wires.</p>
<p>I bought one of these, and forgot to get the connector. <a href="http://www.sparkfun.com/commerce/categories.php?c=139" rel="nofollow noreferrer">http://www.sparkfun.com/commerce/categories.php?c=139</a></p> <p>Now I need to buy a hall effect sensor and was thinking/looking at mouser, Does anyone know the partnumber of a cable/connector similar to <a href="http://www.sparkfun.com/commerce/product_info.php?products_id=8733" rel="nofollow noreferrer">this</a>: </p> <p><img src="https://i.stack.imgur.com/Hs3p3.png" alt="enter image description here"></p> <p>OR how I would go about figuring out said connector p/n at other places too?</p>
IR Connector for Sharp
2010-08-18T18:58:56.750
4104
|connector|8051|in-circuit|
<p>I can't answer the 8051 specific questions, but I can help with your first problem. </p> <p>The standard method for doing this in industry (at least as far as I can tell) is to use pogo pins: <a href="https://i.stack.imgur.com/bLgXb.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/bLgXb.jpg" alt="image"></a><br> <sub>(source: <a href="https://static.sparkfun.com/images/products/09174-02-L_i_ma.jpg" rel="nofollow noreferrer">sparkfun.com</a>)</sub> </p> <p>The gold part sticks through some protoboard or another PCB. You connect your programmer to this circuit. This piece of PCB (or something thicker and sturdier like masonite or acrylic if you're doing hundreds of boards) also has larger pins which go through holes in your target board, to precisely locate your target board above the pogo pins. Light down pressure on the board makes contact between the spring-loaded pogo pins and the test points on the target PCB.</p> <p>The company I work at uses this kind of pins to program every one of the millions of circuit boards they make every year, and every trace has a tiny test point which is probed by a tester through these pins. </p> <p>If you want a debug header, there are other standard methods. I'm totally unfamiliar with this chip, so I can't answer that for you. 8, 14, and 20 pin headers are common for other devices. </p> <p><strong>EDIT:</strong> I took a quick look at the datasheet, and found on page 10:</p> <blockquote> <p><strong>3. In-System Programming (ISP) Function</strong><br> The SM5964 can generate flash control signal by internal hardware circuit. User utilize flash control register, flash address register and flash data register to perform the ISP function without removing the SM5964 from the system. The SM5964 provides internal flash control signals which can do flash program/chip erase/page erase/protect functions. User need to design and use any kind of interface which SM5964 can input data. User then utilize ISP service program to perform the flash program/chip erase/page erase/protect functions.<br> <strong>3.1 ISP Service Program</strong><br> The ISP service program is a user developed firmware program which resides in the ISP service program space. After user developed the ISP service program, user then determine the size of the ISP service program. User need to program the ISP service program in the SM5964 for the ISP purpose. The ISP service program were developed by user so that it should includes any features which relates to the flash memory programming function as well as communication protocol between SM5964 and host device which output data to the SM5964. For example, if user utilize UART interface to receive/transmit data between SM5964 and host device, the ISP service program should include baud rate, checksum or parity check or any error-checking mechanism to avoid data transmission error. The ISP service program can be initiated under SM5964 active or idle mode. It can not be initiated under power down mode. </p> </blockquote> <p>So, it looks like you can provide a bootloader program to read in the data from any interface you like. This can be some GPIO or the UART that you access with pogo pins, or go to an existing connector on the board. How do you get this program to run?</p> <blockquote> <p><strong>3.4 Initiate ISP Service Program</strong><br> To initiate the ISP service program is to load the program counter (PC) with start address of ISP service program and execute it. There are two ways to do so:<br> (1) Blank reset. Hardware reset with first flash address blank ($0000=#FFH) will load the PC with start address of ISP service program.<br> (2) Execute jump instruction can load the start address of the ISP service program to PC.</p> </blockquote> <p>However, I have no idea how you're supposed to get the ISP program on the blank chip. <a href="http://www.syncmos.com.tw/technical.php?page_sel=1&amp;pid=3" rel="nofollow noreferrer">This page</a> has a few programs and programmers, the MSM9042 looks closer to what you want for in-circuit (not socketed) programming. </p>
<p>I want something that can re-program a PQFP SyncMOS SM5964 chip already soldered to the target circuit board. I picture a ribbon cable that I plug between some sort of 2x8 or so header connector soldered on the target circuit board, and a 2x8 or so header connector on a chip programmer, with the chip programmer plugging into a standard PC serial port or USB port.</p> <ul> <li>Is there a standard connector and pinout I should design onto the target board for in-circuit programming a completely blank SM5964 chip soldered to the board? (For older boards, I can temporarily connect such a connector with a bunch of wires from that connector to pins on the chip).</li> <li>Is there such a standard in-circuit programming connector for other 8051 and 8052 chips?</li> <li>Is there a reasonably-priced programmer that can program such a blank SM5964 chip already soldered to the target board?</li> <li>Is there a standard bootloader firmware for this chip?</li> </ul> <p>So far, my web searches have turned up a few chip programmers such as the $295 <a href="http://www.logicaldevices.com/aw1.htm?gclid=COLf1I_3w6MCFQUiawodjG02gw" rel="noreferrer">XPRO-5000</a> that can program the SyncMOS SM5964 using a big ZIF socket and a PQFP adapter. I suppose I could solder some wires between a DIP socket and a female header, insert the DIP socket into the ZIF socket on such a programmer, and plug the female header into a in-circuit programming header on the target board. But it seems unnecessarily complicated.</p> <p>I expected to find answers to some of these questions at <a href="http://8052.com/" rel="noreferrer">http://8052.com/</a> ; perhaps I am looking in the wrong place.</p>
What is a good way to in-circuit update the program on a SyncMOS 5964?
2010-08-19T21:32:00.610
4112
|touch-panel|touchscreen|kits|
<p>Alternatively if you are lucky enough to need a touch screen size which is equal to an existing mobile phone screen, you may be able to pick up screens through ebay or touchscreen repair outlets. </p>
<p>Is there a company that will sell me a touch panel similar to the IPhone or IPad surface, in single quantities, complete with a Developer Kit?</p> <p>Can I get it in a specific form-factor (say, 2x7 inches)?</p>
Source for small Touch-Panels?
2010-08-20T19:23:35.543
4121
|cpu|overclocking|
<p>This reminds me of a great little article entitled <a href="http://doi.ieeecomputersociety.org/10.1109/MC.2004.1273994" rel="nofollow">The Zen of Overclocking</a> by <a href="http://en.wikipedia.org/wiki/Bob_Colwell" rel="nofollow">Bob Colwell</a> who was the chief IA-32 architect for the Intel Pentium Pro to Pentium 4 processors. </p> <p>Unfortunately the document is not available to the general public, but should be available to IEEE Computer Society members, and many/most universities networks. It was originally published in <a href="http://www.computer.org/portal/web/computer/home" rel="nofollow">Computer</a> magazine, March 2004 (Vol. 37, No. 3) pp. 9-12.</p> <p>A couple of brief quotes:</p> <hr> <p><strong>Abstract</strong>: <em>Overclocking is a large, uncontrolled experiment in better-than-worst-case system operation.</em></p> <p>... <em>This issue of Computer [magazine issue] spotlights what I call "better-than-worst-case" design. With normal worst-case design, any computing system is a conglomeration of components, operating within frequencies, power supply voltages, and temperature ranges that were set to simultaneously accommodate worst-case values of every single component. (Modern CPUs don't really do it quite this way anymore, but they once did, and it's easiest to think of worst-case design this way.)</em> ...</p> <p>...<em>Compare the seat-of-the-pants, maybe-it-will-work approach of the overclockers to the engineering challenge confronting Intel and AMD. First, note that this challenge isn't just the flip side of the overclocker's coin. Chip manufacturers must design and produce tens or hundreds of millions of chips; overclockers only worry about one. Manufacturers must set a quantifiable reliability goal, and no, it's not "zero failures, ever." That would be an unreachable—and not very productive—target because hitting it would require avoiding cosmic rays. Even at sea level, that would require more meters of concrete than any laptop buyer is going to find attractive. And even then, the concrete would only improve the odds. It would remain a statistical game.</em> ...</p> <p><strong>Conclusion</strong></p> <p><em>If you don't floss your teeth, they won't necessarily rot away. The vast majority of car trips do not include any metal bending, so why wear seat belts? And why not smoke? Not all smokers get cancer. Or you could adopt Oscar London's compromise, "If you smoke, why bother wearing a seat belt?" And some rock musicians from the 1960s are still alive, so maybe all those drugs are really beneficial, acting as some kind of preservative. As for me, well, I'm an engineer, and I live in a statistical world. I'm going with the odds.</em></p> <hr> <p>As to the specifics of whether over-clocking can cause permanent damage? Yes, in particular as the lithography technology improves at creating smaller scale dies (e.g. 35 nanometre) the thickness of the insulator / oxide is decreased as well. This means that this ever thinner barrier could fail due to high voltage or deterioration. So the related margin for acceptable error is decreasing (or the margin for failure is rising). </p> <p>I believe MOSFET transistors are still used for CPU design, so looking at some of the difficulties with <a href="http://en.wikipedia.org/wiki/MOSFET#Difficulties_arising_due_to_MOSFET_size_reduction" rel="nofollow">MOSFET size reduction</a> may highlight other potential issues that overclocking may cause. At the system-level, overclocking may also cause internal / cross-channel EMI / RFI within the CPU die or any of the other subsystems (e.g. RAM bus), and may reduce the Signal-Noise-Ratio (SNR) such that mechanical or external EMI/RFI are no longer tolerable, and end up producing random errors on the digital buses. </p> <p>And for the record I have damaged processors due to <em>stupid</em> over-clocking, and poor thermal dissipation. So beyond the theory, it is actually possible. </p>
<p>I've always been under the impression that overclocking of any sort of CPU (for a PC, or a microcontroller), its a bad thing. Your'e essentially operating the unit outside of the manufacturer's specifications, which means that the device may/may not work as intended. It may go faster, but at the risk of erratic behavior.</p> <p>I understand that the answer to overclock/not is a philosophical one depending upon how much risk you wish to take on with your devices. But,</p> <p><strong>What kind of permanent damage can be caused by overclocking a CPU?</strong></p> <p>(Note: I ask this because a number of my friends are gamerz and think overclocking roxors soxors... and for some odd reason after they do this their computers break with bluescreens and then <em>I</em> get called, and I want some ammunition to use so that I don't have to troubleshoot potentially flaky hardware so often...)</p>
Overclocking: permanent damage?
2010-08-22T19:41:35.887
4123
|microcontroller|arm|software|
<p>The "code density" of an instruction set is a measure of how much stuff you can get into a given amount of program memory, or how many bytes of program memory you need to store a given amount of functionality.</p> <p>As Andrew Kohlsmith pointed out, even on the same MCU, different compilers can get different code density.</p> <p>You might enjoy reading <a href="http://embeddedgurus.com/state-space/2009/03/insects-of-the-computer-world/" rel="nofollow">"Insects of the computer world"</a> by Miro Samek, which compares a variety of MCUs.</p>
<p>I have a conceptual question: What means "high" code density? and why is it so important?</p>
About Code Density and its definition
2010-08-22T22:11:08.533
4125
|eaglecad|cnc|gerber|
<p>Sounds like a cool project. The standard format for a drilling machine to accept is "Excellon file" format.</p> <p>Most CNC machines accept</p> <ul> <li>a G-code that is a slightly enhanced dialect of RS274D.</li> </ul> <p>Most PCB design software exports information about a file in two formats:</p> <ul> <li>drill files in "Excellon file" format, a variant of standard RS-274C. (This is the one you want).</li> <li>layer files in Gerber file format, a variant of of RS-274X.</li> </ul> <p>All three variants of RS-274 are very similar.</p>
<p>I am planning to develop a CNC drilling machine for a college project. The idea is to export the hole coordinates and drill size directly from a .brd file on Eagle, which will later be read by an MCU for processing. We're trying to define which format to use: <strong>gcode</strong> or <strong>gerber</strong>. Any suggestion for a third option will be gladly welcome.</p> <p>Which one is easier to work with or is better documented?</p> <p>Also bear in mind that we want other students to be able to do the exporting from Eagle without much effort.</p> <p>Thanks for your help.</p>
Which would better suited for a CNC drilling machine: gerber or gcode?
2010-08-23T06:27:00.850
4130
|msp430|debugging|
<p>To see why you are being RESET you need to check the system rest vector (SYSRSTIV) at address 019Eh and you will be able to see the cause of your reset. There are many things on a MSP430 that will cause a reset </p>
<p>I'm using the <a href="http://www.ti.com/lit/ds/symlink/msp430f5515.pdf" rel="nofollow">MSP430F5515</a> variant. I can't figure out any structured reason for it, but the chip clearly resets itself occasionally - i'm logging data and i put a 'known' string that only prints at startup in the code. I'm thinking it has something to do with my manipulation of the Unified Clock System registers, or maybe something to do with the High/Low side Voltage Supervisor functions (which I'm not changing from their system defaults). I'm pretty sure I don't have any kind of stack-overflow (no pun intended) going on, but one can never really rule that out.</p> <p>Getting to my question here... are there any register settings one needs to assign explicitly in your MSP430 startup code so that the system does not reset? Is there any diagnostics that I can use to determine for what reason (at least "the last") reset occured. I'm thinking using the MSP430FET-UIF programmer/debugger to halt the processor and look at some register values, though my gut says I can't attach to a running processor without resetting it and loading a new program... Any thoughts / advice would be appreciated...</p> <p>-Vic</p>
MSP430 seems to reset intermittently
2010-08-23T21:31:19.127
4137
|pic|clock|frequency|
<p>That's a weird place to have the board get hot. It could definitely be warm at the other end, near R4, T1, and the TX LED, but there's nothing happening on the end which you say is warm! (<a href="http://dangerousprototypes.com/docs/images/9/9b/URTiyCctii.png" rel="nofollow">Schematic</a>, <a href="http://dangerousprototypes.com/docs/images/3/31/UsbirtoyBrd.png" rel="nofollow">layout</a>)</p> <p>According to the datasheet (p. 363), the power dissipated in your PIC should be:</p> <pre>Pdis = VDD x {IDD – Σ IOH} + Σ {(VDD – VOH) x IOH} + Σ(VOL x IOL)</pre> <p>This uses the <code>Power = Voltage * Current</code> equation to say that the total power dissipated is the sum of the power consumed by the chip's operation (not including driven outputs) plus any power dissipation on the current sourcing transistors, plus any power dissipation on the current sinking transistors. See page 375 for data on output voltages and currents. However, it looks like there should be only minimal power dissipation according to this equation. </p> <p>Three things I would look at:<br> - The next page has a voltage/max frequency graph. It shows that you're only allowed to operate at 48MHz when you're running above 4.2V. Is this the case when you're operating off of your ICSP header? Running out of spec here might cause issues by not switching the transistors fast enough, and developing shoot-through currents.<br> - That micro includes an onboard 3.3V LDO for the USB. If you're drawing any current off of this pin, you will dissipate power in the micro. If you're not communicating over USB all the time, you can disable this regulator with the VREGEN configuration bit in the CONFIG2L register.<br> - You got it hot once, it may now have a weak internal short. Try a different microcontroller or board. This is unlikely, but possible.</p>
<p>How do I lower the clock frequency of a PIC18F2550 and recalculate the peripheral dividers?</p> <p>I'm trying to make it run cooler. Currently, it runs at 12MIPs/48mhz (USB-CDC-ACM).</p>
Lowering PIC Clock Frequency
2010-08-24T13:14:37.043
4139
|multiplexer|
<p>If one builds a rectangular memory array which is read using a tri-state driver in each memory cell, then one decoder circuit can control all of the cells in a row. One will need circuitry around the perimeter of the array to control it, but the amount of control circuitry will be proportional to sqrt(N)*lg(N). By contrast, if one tried to feed all the memory cells into a multiplexer, one would end up needing a lot more circuitry.</p> <p>The multiplexer-based approach does have some advantages. If one built a one mega-word memory using two-way multiplexers, each bit would have to pass through 20 multiplexers, but one could achieve a very high-bandwidth pipelined memory system if each multiplexer included a latch. It would take 20 cycles to perform any particular read operation, but in 100 cycles one could begin 100 different reads. Since the signal wouldn't have to go very far in each cycle and wouldn't be driving any large buses, the cycle rate could be extremely high.</p> <p>The issue of whether to use multiplexers or buses ends up being somewhat similar to the question of whether to use data repeaters when sending information over long distances. On the one hand, data repeaters add delay. On the other hand, the time required for a signal transition at one end of a stretch of copper to cause a transition at the other end is asymptotically proportional to the square of the length (since adding length adds both resistance and capacitance). Adding a repeater in the middle of a long wire may end up improving speed since the long run will be replaced by two shorter ones with somewhere between a quarter and half of the longer delay.</p> <p>If one were to double the width and length of a memory array without improving the 'oomph' of the row and column driver circuits, one would more than double the time required to switch the rows and columns. By contrast, if one were to use four smaller memory arrays and multiplex the outputs, one would only add a constant to the access time. Faster memories are subdivided into more small arrays connected by multiplexers; cheaper memories use fewer multiplexers but aren't as fast.</p>
<p>Why are tristates favored over multiplexers to select the output from RAM? The explanation that I've heard of is that the RAM is too large for using a multiplexer but I need more details.</p> <p>A theory we've come up with is that using a multiplexer would necessitate a tree of OR-gates to select the output which would dramatically increase the propagation time of the signal to the bus whereas with tristates, no matter the size of the RAM, the propagation delay would be constant.</p> <p>Is that correct?</p> <p>Thanks</p>
Use of tristates vs multiplexers in a RAM
2010-08-24T15:35:00.123
4145
|fpga|softcore|
<p>A simulation running on a PC might be more useful than a softcore, especially for testing algorithms.</p>
<p>Does anyone know of an FPGA soft-core implementation of Donald Knuth's <a href="http://www-cs-faculty.stanford.edu/~knuth/mmix.html">MMIX</a>? My google search only found old discussions of people who knew people who were working on an FPGA implementation.</p>
Is there an FPGA implementation of Donald Knuth's MMIX?
2010-08-24T23:18:41.073
4150
|rs232|uart|
<p>You can avoid all the 'electronics'completely if you can use two serial ports to do the sniffing. Each of the sniffer ports reads the TX line of one end of the connection. This also gives you extra status input pins to read all status outputs on monitored comms.</p> <pre><code> Tx --------------x------------------------------- Rx | Rx --------------|-----x------------------------- Tx | | | | | | | x------------ PC COM 1 Rx | x-------------------PC COM 2 Rx </code></pre>
<p>I wanted to sniff communication between two RS232 devices. <a href="http://embeddedfreak.wordpress.com/2008/08/17/rs232-serial-sniffermonitoring-circuit/" rel="nofollow noreferrer">This</a> link presents a simple solution but I want to make sure that my 'sniffer' does not load the communication link.</p> <p>To that effect, I was wondering if I could use a MAX-232 as a 'looping' buffer:</p> <p>RS232 in --&gt;TTL out--&gt;TTL in--&gt;Rs232 out</p> <p>The MAX-232 will be powered by an external 5v. Is this a fool proof way of sniffing without loading the line? Does the MAX232 even act as a buffer in this configuration? If not. are there inexpensive RS232 buffer ICs available? All the 74xx range of buffer ICs seem to work only at TTL levels.</p> <p>My communication link is only half duplex.</p> <p>UPDATE: I think I was not clear with my description. Please see the image: <img src="https://i.stack.imgur.com/zxG4Z.jpg" alt="alt text" /></p> <p>Both my devices already are on RS232 levels. I simply wanted to read the data using a COM port of the PC, but thought a MAX-232 in between (the loop buffer that I was talking about) might serve as a buffer. But then again, even the PC's COM port per se might have a MAX-232 inside it...</p> <p>P.S: I have not indicated the capacitors etc for the max232 in the above figure.</p>
RS-232 Buffer circuit
2010-08-25T12:19:26.273
4155
|charlieplexing|
<p>A "Charlieplexed" display (Wikipedia lists the concept as having been invented in 1996, but I'm sure the approach was used before that) represents a complete graph of all processor signals (every pair of processor signals has to have an LED on it). A complete planar graph of N nodes may only be drawn for N less than 4.</p> <p>I think the most natural way to visualize a Charlieplexed display would be as a square matrix with the LED's on the primary diagonal replaced with shorting jumpers. When laying out a board, simply shove the LEDs on either side of the diagonal inward so as to yield an NxN-1 physical configuration.</p> <p>The only disadvantages Charlieplexing would have over normal multiplexing would be the fact that Charlieplexing uses a nearly-square square grid, and that one has to in software shift the pixels on one side of the diagonal so as to account for the gap. Electrically, I would think driving a Charlieplexed display from a tri-state CPU pin should be easy: wire an NPN transistor (e.g. 2N2222) with the collector at VDD, base connected to the CPU pin, and the emitter tied to the Charlieplex line to supply the positive (row-scanned) drive; wire a current-setting resistor between the CPU pin and the column wire.</p>
<p>I'm sitting here with a pencil and paper trying to arrange a charlieplexed 5x8 LED matrix. I'm trying to arrange this in such a manner that no two lines cross each other. Without a guiding theorem of some sort, I keep isolating lines, that is, the line ends up completely surrounded in a box composed of it's neighbor lines.</p> <p>I'm looking at this problem and thinking "Some mathematician must have already solved this". Nodes, matrices, edges...it just feels like a topology problem. Anyhow, I don't have the maths to solve it, at least not conclusively. </p> <p>Anybody have any thoughts on this?</p> <p>To head this off - yes, this would be simple with multiplexing. I need to charlieplex this.</p>
Charlieplexing Topology Question
2010-08-25T15:31:30.503
4168
|pcb|dac|inductance|serpentine-trace|
<p>It's a serpentine track. They are often used where equal track lengths are required with high-speed designs. In this case it is probably used to implement a very short delay.</p>
<p><img src="https://farm5.static.flickr.com/4119/4930372298_73e5420f5a.jpg" alt="macro shot of a PCB with a squiggly trace on it"></p> <p>It's on pin 14, which is the master clock input (MCLK) of a <a href="http://www.wolfsonmicro.com/products/dacs/WM8761/" rel="nofollow noreferrer">WM8761: Low cost stereo DAC</a>. I'm guessing it's meant to act as a small inductor? But why would you want that on a clock input?</p>
What is this squiggly trace for?
2010-08-26T20:19:19.947
4171
|radio|frequency-modulation|
<p>My apologies for the lateness in my reply, but there is a project in the <a href="http://www.elektor.com/magazines/2010/july-047-august/the-elektor-dsp-radio.1391200.lynkx" rel="nofollow">July/August 2010</a> [just arrived yesterday...] edition of Elektor that may be of interest. It uses the <a href="http://www.silabs.com/products/audiovideo/amfmreceivers/Pages/Si473435.aspx" rel="nofollow">Si4735</a> DSP receiver IC that can decode RDS. </p> <p>Farnell part number for the IC is 1835849</p>
<p>I'm interested in doing a project to read <a href="http://en.wikipedia.org/wiki/Radio_Data_System" rel="nofollow">FM RDS data</a>. Can anyone recommend good chips for both the FM receiver and RDS decoder?</p> <p>For an FM receiver, I'd like to be able to control FM frequency (scanning of full range) from a microcontroller.</p> <p>For the RDS decoder, I'm just interested in an IC that's readily available with a simple interface (e.g. I2C or SPI).</p>
Good ICs for receiving and decoding FM RDS
2010-08-27T02:25:51.970
4172
|video|
<p>The IBM Portable PC behaved as though internal monitor was wired to the composite output of a stock CGA card. One of the side-effects of this was that when the mode was set to "color" 80 columns, colors would appear as gray stripe patterns rather than as shades of gray. This in turn would render many foreground-background combinations (e.g. blue on black) almost completely illegible. This was rather irksome given that (1) the internal monitor was monochrome, and thus chroma information would be useless to it; (2) even when using an external composite monitor, the colorburst signal was mistimed in 80-column mode, so one couldn't get color anyway.</p> <p>Incidentally, the Compaq's internal monitor seems to be unique; it uses the NTSC horizontal scan rate, but the vertical scan can be either 60Hz or 30Hz. I'm not sure why Compaq decided to use non-interlaced 30Hz, rather than jinxing the vertical circuit of the monitor to work nicely with the 6485's not-quite-right interlaced output, but it's the only machine I've ever seen with a 30Hz display scan.</p>
<p>I'm getting one of these <a href="http://www.old-computers.com/museum/computer.asp?st=1&amp;c=446" rel="nofollow">http://www.old-computers.com/museum/computer.asp?st=1&amp;c=446</a></p> <p>I'm planning to build a server inside it. And I was thinking of using the built in CGA-monitor as a statusdisplay (LCDInfo style, or whatever the cool geeks use nowadays). The screen is monochrome amber so it would probably look a bit like the Planar EL-screens some have been using in their mods. And I want to use an Arduino (or something like it) as a middleware solution... PC -> Arduino -> Screen</p> <p>I have been checking up a bit, and CGA is a RGBI signal using TTL-communications. 4 lines (RGB + Intensity), combined with HSYNC (15.75KHz) and VSYNC (60Hz). The 4 "color-inputs" are logic on or off. The combination of these generates up to 16 colors. However, as this is an amber screen, it would probably be easiest to start with "all-high" or "all-low"... White and Black.</p> <p>So the problem is the following... I could probably both wire and code the arduino to flip the TTL-lines on and off, but I'm not sure what I do with the HSYNC and VSYNC inputs. And how to time the TTL-flips to correspond to pixels on the screen. (The standard CGA resolution is 320x200).</p> <p>I'm not very good at electronics, but I'm very good at following instructions, and taking hints </p> <p>Has anyone tried this before?</p> <p><em>EDIT</em>: Could I maybe use a modified version of this? <a href="http://www.eosystems.ro/deogen/deogen_en.html" rel="nofollow">http://www.eosystems.ro/deogen/deogen_en.html</a></p> <p><em>EDIT2</em>: I don't <em>need</em> to use an Arduino. But I want to keep it as simple as possible.</p> <p><em>EDIT3</em>: It might seem that the monitor in question actually is a composite monitor, and not a "real" CGA input monitor. So that probably makes things a bit easier. But I'm still interested in how to generate a pure CGA signal using a microcontroller...</p>
How can I control a CGA screen with an Arduino?
2010-08-27T08:25:44.407
4173
|arduino|power|
<p>ShiftBrites actually prefer to run on 5.5V to 9V. Most reliable results seem to be with 6 to 7 volts. Regulation is not too crucial, but switching power supplies work well and are smaller and lighter than transformer based supplies. Each ShiftBrite can draw up to 60mA, so multiply that by the number of ShiftBrites you have to determine the current rating of the power supply.</p> <p>You definitely need to connect the grounds of all your supplies together. Just make sure the ShiftBrite V+ positive supply is not connected to the Arduino 5V supply if you are using different voltages! Actually, if you choose something like 7V you can power the ShiftBrite chain, and connect the same power to the Arduino VIN. The Arduino will regulate the power for itself.</p> <p>This simple wiring is all done for you on the ShiftBrite Shield, you attach external power to the screw terminal and plug the ShiftBrite chain into the six pin connector: <a href="http://macetech.com/store/index.php?main_page=product_info&amp;cPath=4&amp;products_id=7">http://macetech.com/store/index.php?main_page=product_info&amp;cPath=4&amp;products_id=7</a></p>
<p>I have an arduino project that is almost finished.</p> <p>Now it controls a series of ShiftBrites(ShiftBrties being 10bit RGB LED's) now they use a simple 4 wire configuration(Data, Logic, Clock, Enable) and +5v and GND. its all done over a wireless setup. ShiftBrites are connected to a Arduino and an xBee module. (My basic setup <a href="http://ashleyhughesarduino.wordpress.com/2010/08/01/shiftbrites-and-the-arduino/" rel="nofollow">http://ashleyhughesarduino.wordpress.com/2010/08/01/shiftbrites-and-the-arduino/</a>)</p> <p>The Problem is that the arduino can only output so much juice(Current) before everything starts smoking, my question is how would I connect it up so that the +5v comes straight off the power pack from the wall?</p> <p>Connect to the Vin point on the arduino? or Connect the +5v before the arduino? ???</p> <p>Thanks Hughesy</p>
Arduino how to get more Power
2010-08-27T08:32:18.073
4182
|led|driver|
<p><a href="http://focus.ti.com/docs/prod/folders/print/tlc59213a.html" rel="nofollow">Texas Instruments TLC59213A</a> is similar, but not as high voltage. Other than that, it looks like a good fit.</p>
<p>According to its datasheet, the TD62783AFNG is an 8-channel high-voltage high source-current driver. It is a Darlington arrangement that can source (not sink) up to half an amp through a pin. What similar chips are available?</p> <p><a href="http://www.semicon.toshiba.co.jp/docs/datasheet/en/LinearIC/TD62783AFNG_en_datasheet_091116.pdf" rel="nofollow">http://www.semicon.toshiba.co.jp/docs/datasheet/en/LinearIC/TD62783AFNG_en_datasheet_091116.pdf</a></p>
What's a good substitute for the TD62783AFNG?
2010-08-27T15:20:09.643
4185
|architecture|computers|
<p>Well, there is something like the ENIAC, where you have essentially individual ALUs and you "programmed" them by wiring the output of one alu to the input of another alu that was going to perform the next operation on that intermediate variable. Your "registers" and storage are the wires connecting the alus.</p> <p>I recently purchased the book "The First Computers--History and Architectures (History of Computing)", which in part focuses on this exact topic. I do not recommend purchasing this book though it is just a collection of academic papers, hard to read and I suspect probably published (for free) elsewhere. (I gave up on it before finishing the introduction)</p> <p>Once memory was invented and became practical, we kinda settled into the two popular ones Von Neumann and Harvard. Executing from re-wiring, punch cards, paper tape or things like that became less practical. And there is stack based (the zpu for example), which I suspect probably falls under the Harvard category and not its own.</p> <p>What about von neumann platforms that boot off of a read-only (in normal use) flash on one memory interface and have read/write data ram in another (that can sometimes operate on both in parallel) but from the programs perspective are in one address space? Or ones that have several internal and external memories/interfaces all operating in parallel but are von neumann for being in the same address space.</p> <p>And what good is a harvard platform where the processor cannot access the instruction memory as data in order to change/upgrade the bootloader or for the bootloader to load the next program to run? Why isnt that a von neumann architecture? The processor executing from and operating on the same memory on the same interface in likely a sequential (instruction fetches and memory writes not happening at the same time) manner?</p> <p>The two popular memory based architectures are more close than they are different in current implementations IMO.</p> <p>Where do gpu's fall? Or the business that I work in, network processors (NPUs). Where you have these relatively small special purpose microengines (processors) that execute from a harvard like program ram (addressable but you just dont want to do that for performance reasons), operate on various data rams each having their own separate address space (separate processor instructions for each space), (the memory spaces operating in parallel) and through those rams hand off intermediate data to have the next computation done by the next microengine in a wired alu (eniac) like fashion? What would you call that one? Are npus and gpus just fancy modified harvard architectures?</p>
<p>I am going through the book "Elements of computing systems". This book teaches how to build a whole computer from scratch. While I was just browsing the chapters on computer architecture, I noticed that it all focused on the Von Neumann architecture. I was just curious as to what are the other architectures and when &amp; where they are used.</p> <p>I know about only two, one is Von Neumann and the second is Harvard. Also I know about RISC which is used in uC of AVR.</p>
What are different types of computer architectures?
2010-08-27T18:51:50.520
4188
|wireless|gsm|
<p>Does connection cables exist for your phone? Or, if it is a Nokia, are there pins behind the battery?</p> <p>If yes, your old phone is probably able to receive <strong>AT</strong> or <strong>FBUS</strong> command, allowing you to easily use the internal modem, for example to send/receive sms.</p> <p>Look at <a href="http://www.embedtronics.com/nokia/fbus.html" rel="nofollow noreferrer">this page</a> for information about the <strong>FBUS</strong> protocol (for Nokias). <a href="http://wiki.forum.nokia.com/index.php/Using_AT_commands_to_send_and_read_SMS" rel="nofollow noreferrer">This other page</a> deals with <strong>AT</strong> commands to send an read SMS (This should work with most phones).</p> <p>Search about this (for example on chiphacker), many people have done such things.</p> <p>There also exists standalone <strong>GSM</strong> modules (<a href="http://www.sparkfun.com/commerce/product%5Finfo.php?products%5Fid=9533" rel="nofollow noreferrer">example at SparkFun</a>).</p>
<p>I found this <a href="http://www.serasidis.gr/circuits/SMSremoteV3/SMSrcV3.htm" rel="noreferrer">project that uses a GSM module</a> (scroll down to see Picture 5). It seems the module has to be bought separately. I have old GSM cell phones lying around in the house. Shouldn't these phones contain such a chip? Is it possible to remove the chip and use it on a circuit board as shown in some of the pictures in the project?</p>
Can I remove a GSM module from an old cell phone?
2010-08-28T04:30:59.373
4194
|alu|
<p>We need to check if our <strong>output Array</strong> contains only 0 bits. If number that Array is representing is 0 then it's not Negative nor Positive in a math sense. So you can check last bit of <strong>output Array</strong> if it's equal to 0. Because in 2's compliment all negative numbers will have 1 as a last MSB if MSB==0 then it's not negative.</p> <p>To check if it's not positive either we can NEGATE <strong>output Array</strong> and ADD it to itself that will get us array full of 1's. Now we will add <strong>output Array</strong> to this full of 1's array. If <strong>output Array</strong> did contain any 1 bit it will generate carry that eventually will cause overflow and set MSB of the result to 0. If <strong>output Array</strong> did contain only 0's result will remain array full of 1's. And MSB will remain 1 too.</p> <p>So now we</p> <p>AND (NOT(<strong>output Array</strong>[MSB]), ADD[MSB](<strong>output Array</strong>, ADD(<strong>output Array</strong>,NEGATE(<strong>output Array</strong>)))</p> <p>Do that to check if number represented by <strong>output Array</strong> is nor positive nor negative. Mb tho to use multiway <strong>OR</strong> for all 16 bits is easier and better.</p>
<p>I was implementing the ALU from the specs given in my The Elements of Computing systems book. I am stuck on only one problem. How do I find if a given number is zero or not. One thing I can do is or every bit in the bus, and then apply a not gate on that. But there has to be some other elegant solution.</p>
How to find out if a binary number is zero
2010-08-28T19:00:31.287
4206
|pic|c|mplab|
<p>I just noticed another problem I hadn't noticed before: you are neither checking nor clearing TMR0IF within your interrupt routine. The way the PIC works, any time it's about to execute an instruction, GIE is set, and any peripheral interrupt flag is set along with its corresponding enable (e.g. TMR0IF and TMR0IE) are set, it will clear GIE and call the interrupt routine. Clearing GIE allows the instructions within the interrupt routine to run (otherwise any time the system was about to execute the second instruction of the interrupt routine, it would generate another call to the first instruction). Returning from the interrupt re-sets GIE. If at that moment there is still a peripheral interrupt flag which is set along with its corresponding enable, the system will again clear GIE and generate a call to the interrupt routine.</p> <p>There are two strategies via which an interrupt routine can solve this problem:</p> <ol> <li>If there's more than one interrupt that may be enabled, the interrupt routine should check the flag for one of them and, if the flag is set, clear that flag and handle the condition it represents. After the first flag is found to be clear or its condition has been handled, check the flag for the second interrupt and, if set, clear that flag and handle its condition. Repeat for all of the interrupts you're using. If an unexpected interrupt gets enabled, the main-line code will never execute but interrupts will behave as normal (whenever no expected interrupt condition exists, the interrupt routine will continuously check all interrupt conditions, return, and restart, until an expected interrupting condition arises). <li>If there's only one interrupt that will ever be enabled, one may skip the condition check and simply unconditionally clear the flag when the condition occurs. Note that if some other interrupt somehow becomes enabled, the code may erroneously run the interrupt routine 'as fast as possible', without regard for how often the code should actually run. If such erroneous execution would pose a safety hazard, one must guard against it. In many cases, however, the fact that the main-line code can't execute will be enough of a problem (hopefully yielding an eventual watchdog reset) that it won't really matter what the interrupt routine does. </ol> <p>Try changing the first line of your interrupt code to "if (T0IF &amp;&amp; T0IE)", and add to the conditional clause "T0IE=0". That should cause your interrupt frequency to become closer to being correct. It won't be quite right, though, unless you use something like the code in my other answer.</p>
<p>Using a PIC16F886, I am trying to generate interrupts every 100 milliseconds using TMR0 clocked from the internal oscillator, but I am getting some really strange behaviour.</p> <p>This is a battery powered circuit, so I am using the 125KHz internal oscillator, selected via:</p> <pre><code>OSCCON = 0b00010000; // select 125 KHz Int. Osc. = IRCF&lt;2:0&gt;=001 </code></pre> <p>I then assign the prescaler to TMR0 and set a prescaler value of 1:2:</p> <pre><code>T0CS = 0; // TMR0 Clock Source: Internal instruction cycle clock (FOSC/4) PSA = 0; // Prescaler is assigned to TMR0 PS2 = 0; PS1 = 0; // &gt; TMR0 Rate: 1:2; PS0 = 0; </code></pre> <p>So now, according to my calculations each 'tick' should take <code>((1/125 000) / 4) / 2 = 1.0 × 10^-6</code> seconds, If I preload the timer with 155, it will take 100 'ticks' to overflow, generating an interrupt every 100uS.</p> <p>My interrupt service routine consists of:</p> <pre><code>if(T0IE) { ticks++; if (ticks &gt;= 999){ ticks = 0; PORTB = ~PORTB; } TMR0 = 155; return; } </code></pre> <p>And it does function, but the timing is not exactly right.</p> <p>When I simulate it using the MPLAB SIM, It takes around 85mS and on real hardware it seems take longer than 100mS.</p> <p>The full code listing can be found here: <a href="http://pastebin.ca/1928766" rel="nofollow">http://pastebin.ca/1928766</a></p> <p>It is quite possibly I am miscalculating something, so any pointers/corrections would be much appreciated.</p>
PIC16 Timer0 oddity
2010-08-30T03:51:29.777
4208
|sensor|audio|
<p>Yep, use an omnidirectional electret with a flat frequency response into the ADC of a microcontroller.</p> <p>To measure subjective loudness (which I believe is also what you want to measure for hearing protection), you should probably use <a href="http://en.wikipedia.org/wiki/A-weighting" rel="nofollow noreferrer">A-weighting</a>, or at least filter out very low or very high frequencies. You wouldn't want false positives from ultra low frequencies that encourage them to ignore the warnings, for instance. ("In almost all countries, the use of A-frequency-weighting is mandated to be used for the protection of workers against noise-induced deafness.")</p> <p>Then do an RMS measurement of the samples over a period of time to get the perceived loudness. </p> <p><strong>Digital:</strong></p> <p>Here's a high-level implementation of A-weighting in <a href="http://www.mathworks.com/matlabcentral/fileexchange/69" rel="nofollow noreferrer">MATLAB</a> and <a href="http://gist.github.com/148112" rel="nofollow noreferrer">Python</a> for reference.</p> <p>I suppose micro ADCs don't have any anti-aliasing built-in, so you'd have to add an anti-aliasing filter. Sampling frequency would have to be pretty high. </p> <p><strong>Analog:</strong></p> <p>You could also do the filtering and RMS measurement in hardware, and just sample the output of that at a much slower rate with the micro. Here's a <a href="https://sound-au.com/project17.htm" rel="nofollow noreferrer">hardware A-weighting filter</a> or you could do a simpler band-pass filter for a rough estimate. It's possible to do true RMS measurements in hardware, but I don't know the circuits. You can get a similar "VU meter" result by full-wave rectifying and filtering, which is probably good enough for your task. That's all mixing boards use for their meters.</p> <p><em>"so maybe decibel samples"</em></p> <p>If you're just using a threshold on the RMS measurement then you don't need to convert to dB or anything.</p> <p><em>"need to send samples at least every second"</em></p> <p>I'd do the RMS processing in the micro in the sensor, and then just send a single measurement of loudness each second. You don't need to send the actual audio samples.</p>
<p>I'm looking for some advice on which components to use for this application.</p> <p>The problem: We'd like to measure the amount of "noise" in a warehouse and display this on a LCD/monitor/whatever. When the noise reaches a certain threshold, it will be suggested that employees put on their ear protection headsets. The sensors (microphones) need to be wireless (RF/Wifi would be preferred! A wired RS-232/485 solution would be considered as well) and need to send samples at least every second. Having a dedicated PC to gather and display the samples is also being considered. For now we're only thinking of one sensor but would like to expand this to many in future.</p> <p>I want to know what components you would use to accomplish this. I'm looking for a very easy way to gauge noise so maybe decibel samples would be good.</p> <p>Any hints very welcome!</p> <p>Thanks</p>
Noise detection data logger - wireless
2010-08-30T06:49:20.737
4211
|pic|ethernet|
<p>I've been working with Microchip microcontrollers for a long time and I know that family quite well, but I think you would be better served by the solution proposed by the <a href="http://mbed.org" rel="nofollow">Mbed dev board</a>. </p> <p>This will give you without doubt the fastest route to have Ethernet running on a microcontroller. Take a look at them, the price isn't too bad either. Also, take a look at the forum, there's already a driver for MySQL, although I don't know the reliability of such driver. I suppose it could be a starting point for your particular SQL database (in case it is not MySQL).</p>
<p>I am thinking about starting a project and was just looking for some general input. Where I work our company currently have remote stations that take data in from a radio link and input the data to a sql database. I am responsible for maintaining the stations and their scripts. Currently they are just running on a desktop pc connected to a radio receiver and an internet connection. I have had some limited experience with working with embedded systems in the past, and would like to explore the possibility of migrating the current setup to an embedded system. The most difficult aspect of the project that I can foresee is gaining internet connectivity to a pic chip and having enough memory for the libraries that would be needed to connect to a sql database. Can anyone recommend a resource so I can learn how to connect a pic chip to the internet as well as any recommendation on what kind of pic chip to use? I know this can be quite a daunting task, but I like to think that I am up for the challenge. </p>
Embedded System that is able to connect to the internet
2010-08-30T14:25:24.937
4219
|power|frequency|clock|
<p><a href="http://boards.straightdope.com/sdmb/showthread.php?t=446800" rel="nofollow">This</a> thread indicates the frequency may vary from 59 to 61 cycles during the day, but midnight to midnight they adjust the frequency to be exactly 5184000 cycles per 24 hour period.</p> <p>There are also three (or four, not clear) separate grids in the US that do not maintain a phase relationship between them.</p> <p>So -- short term timing (e.g. a few minutes or a couple of hours), within a fraction of a per cent. Long term, very accurate.</p>
<p>I've heard rumors that the power line frequency is kept stable and accurate by syncing it with atomic clocks. Is this true? What kind of accuracy does it have? Is this true everywhere?</p>
Is it true that the power line frequency is kept accurate by atomic clocks?
2010-08-30T21:17:27.840
4225
|crystal|capacitance|microcontroller|xmega|avr|
<p>Let's say you have a Crystal rated with 8pf Load Capacitance.</p> <p>So how do you know which capacitors to use? Easy. Every crystal datasheet lists something called the Load Capacitance (CL). In the case of the crystal above, it’s 8 pF. C1 and C2 need to match this Load Capacitance, with the following formula being the key:</p> <p>CL = (C1 * C2) / (C1 + C2) + Cstray</p> <p>I got that from <a href="https://blog.adafruit.com/2012/01/24/choosing-the-right-crystal-and-caps-for-your-design/" rel="nofollow noreferrer">https://blog.adafruit.com/2012/01/24/choosing-the-right-crystal-and-caps-for-your-design/</a></p>
<p>If a crystal has a rated load capacitance of 6 pF, is the right thing to do to put a 6 pF capacitor to GND on either leg of the crystal? I'm using it as the clock source (TOSC) for an XMEGA and it's got a max ESR of 50 kOhm (which is within recommendations).</p>
Crystals and load capacitance
2010-08-31T14:40:57.860
4230
|ethernet|phy|transformer|
<p>In figure 3 of <a href="http://www.micrel.com/_PDF/Ethernet/app-notes/an-143.pdf" rel="noreferrer">this appnote</a> the connection to the magnetics is shown for the KSZ8041.</p>
<p>I'm trying to connect an RJ-45 jack with integrated magnetics (<a href="http://www.belfuse.com/Data/Datasheets/L829-1X1T-91.pdf" rel="noreferrer">Belfuse L829-1X1T-91 datasheet</a>) to an Ethernet PHY chip (<a href="http://www.micrel.com/_PDF/Ethernet/datasheets/ksz8041tl-ftl-mll.pdf" rel="noreferrer">Micrel KSZ8041TL datasheet</a>). The TX+/-, RX+/-, and the LED pins are all easy enough to figure out, but I'm not sure what to do with the center taps (TCT and RCT) for the transformers. Should they be connected to 3.3 V power? To the 1.8 V output of the PHY?</p>
Connection of center tap for Ethernet transformer
2010-08-31T19:47:49.317
4244
|soldering|
<p>The melting point of tin is 232°C, so it will indeed melt at normal soldering temperatures, like you suggest. However, soldering isn't about melting two metals together. For instance take copper. Melting temperature is 1084°C, so your soldering iron will never melt the copper. Yet you're able to solder it, because atoms of your solder migrate in the copper's top layer. That happens even when the copper doesn't melt.<br> So solderability isn't determined by melting temperature, but by whether the metallic structure will allow the solder to penetrate it. Aluminium Oxide (what we actually see when we talk about aluminium) is absolutely impregnable for molten solder.</p>
<p>Will regular leaded(or non-leaded) solder stick to actual tin <s>or tin foil</s>? Does the tin have a low enough melting point that it'd melt along with the solder? Has anyone actually tried soldering copper to tin using regular solder?</p> <p>(I tried googling, but everything I found seemed to be about tinning a soldering iron)</p> <p>Edit: Note I was talking about the actual metal Tin. I realize that most "tin foil" is actually aluminum and you've given me some useful information about aluminum but what about actual tin?</p>
Does solder stick to tin? (not aluminum)
2010-09-02T07:15:34.940
4257
|batteries|power-supply|
<p>Search Internet for 'AA to AAA adapters'. They're basically empty shells, the size of a regular penlight. They also exist for C and D type cells and are normally used to fit a smaller sized cell in your equipment than it was designed for. The AA-size ones are about $1.50 for 4pcs. They're made of plastic and you can easily drill a little hole in them to connect a wire to the terminal.</p>
<p>I have a device that takes two AA batteries and I want to replace it with my own external power source and regulation circuitry. Instead of clipping or soldering wires to the device contacts, I would rather plug in a dummy battery shell that has the appropriate contacts on the end to make the whole project cleaner and more prototype friendly.</p> <p>Does such a thing exist?</p>
Dummy battery shells
2010-09-04T16:15:00.787
4271
|arduino|avr|bootloader|
<pre><code>void (*app_start)(void) = 0x0000; </code></pre> <p>This isn't a NULL pointer. This really is the address of the start of application code, which the bootloader jumps to. The linker arranges for your application code to start at address 0. See table 26-6 in the ATMEGA168 datasheet.</p> <p>The bootloader code starts higher up in flash. Exactly where depends on the bootloader fuses.</p>
<p>Can someone please explain how the <a href="http://code.google.com/p/arduino/source/browse/tags/0019/hardware/arduino/bootloaders/atmega/ATmegaBOOT_168.c" rel="nofollow noreferrer">Arduino bootloader</a> works? I'm not looking for a high level answer here, I've read the code and I get the gist of it. I've also read through this <a href="https://electronics.stackexchange.com/questions/347/arduino-bootloader">other post</a> (I had even been one of the responders to it).</p> <p>There's a bunch of protocol interaction that happens between the Arduino IDE and the bootloader code, ultimately resulting in a number of inline assembly instructions that self-program the flash with the program being transmitted over the serial interface. </p> <p>What I'm not clear on is on line 270:</p> <pre><code>void (*app_start)(void) = 0x0000; </code></pre> <p>...which I recognize as the declaration, and initialization to NULL, of a function pointer. There are subsequent calls to app_start in places where the bootloader is intended to delegate to execution of the user-loaded code. </p> <p>Surely, somehow <code>app_start</code> needs to get a non-NULL value at some point for this to all come together. I'm not seeing that in the bootloader code... is it magically linked by the program that gets loaded by the bootloader? I presume that main of the bootloader is the entry point into software after a reset of the chip. </p> <p>Wrapped up in the 70 or so lines of assembly must be the secret decoder ring that tells the main program where app_start really is? Or perhaps it's some implicit knowlege being taken advantage of by the Arduino IDE? All I know is that if someone doesn't change app_start to point somewhere other than 0, the bootloader code would just spin on itself forever... so what's the trick?</p> <p>On a separate note, would it be possible for the bootloader code to rely on interrupts or is that a no-no?</p> <p><strong>Edit</strong></p> <p>I'm interested in trying to port the bootloader to an Tiny AVR (specifically the ATTiny44A) that doesn't have separate memory space for boot loader code. As it becomes apparent to me that the bootloader code relies on certain fuse settings and chip support, I guess what I'm really interested in knowing is what does it take to port the bootloader to a chip that doesn't have those fuses and hardware support (but still has self-programming capability)?</p> <p>I was thinking I could use the implementation of AVR307 to use the USI as a half-duplex UART (uses Timer0 interrupt, and pin-change interrupt). Can anyone offer guidance on how to go about writing/porting the bootloader code for a chip that doesn't have hardware support for bootloaders?</p> <p>I presume I would put my bootloader code at the normal location for address main (e.g. 0x029e or wherever the compiler puts main). I would then make it so that 'address' in the bootloader code added an offset that put me just past the end of main, and have 'app_start' set to that address. Am I thinking about this correctly or am I totally missing something? Thanks!</p> <p><strong>EDIT 2</strong></p> <p>FWIW, I found a documented process for <a href="http://blog.wickeddevice.com/?p=117" rel="nofollow noreferrer">how to load Arduino sketches onto a ATTiny85</a>, which is where I was originally going with this question... pretty neat I think</p>
Arduino Bootloader Details
2010-09-06T14:35:56.233
4282
|arduino|attiny|avr|bootloader|
<p>There is no need to use a IDE like arduino, to use avr's. look at avr-gcc + isp. you can program the avr in c like arduino, but without the overhead and need for a bootloader.</p>
<p>Two parts:</p> <ol> <li><p>Is it possible to write an Arduino Bootloader for a Tiny AVR?</p></li> <li><p>Is it worthwhile to write a Arduino Bootloader for an Tiny AVR? (more subjective, contingent on 1)</p></li> </ol> <p>Regards, Vic</p>
Arduino Bootloader Follow On
2010-09-07T08:29:43.637
4287
|arduino|
<p>Learn I2C, SPI, 1wire and try to interface sensors with such interfaces. Read a lot of datasheets of such sensors and try to understand everything in them. Ask questions when stuck. Learn MODBUS (RTU/ASCII/TCP) or similar protocol that can open your device to the world once you embed it in the device. Learn general electronics and try to interface relays, triacs, what is pull up and pull down, what is sourcing and sinking, how to draw schematics and connect basic drivers to your MCU.</p>
<p>Alright, I've played around enough with Arduino that I feel pretty comfortable with it. Anything done now is more learning the electronics than it is the Arduino side of it.</p> <p>What's the next step for my learning? Arduino is a combined programmer / controller, so presumably I need to break that link and start working with a controller chip separate from the controller, I guess? Can somebody point me in the right direction?</p>
I understand Arduino: now what?
2010-09-07T14:14:19.517
4293
|pic|adc|dac|audio|dsp|
<p>In addition to the often suitable general-purpose-processor ideas, there have been some dedicated DSPs marketed which deliver either BiQuad or FIR filters, either built into an ADC/DAC chip, or as a tiny stand alone part with something like I2S in and out. </p> <p>The idea seems to be that by doing this in special purpose hardware, you can configure it from an embedded CPU, without having to pick one with DSP horsepower or design your embedded software in such a way that near-real-time processing of the data is assured.</p>
<p>I am starting work on a project where I want to do some DSP using an embedded solution ideally with very low latency as it will be in a real time environment. In addition I want high quality, preferably 16bit 48khz, but I can settle for 12bit.</p> <p>What I am wanting to know is if anyone in this community has done this before and has any words of advice. I have read all about it and have a <a href="http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&amp;nodeId=1406&amp;dDocName=en534506">dsPIC starter kit</a> to play with.</p> <p>Specifically I want to know if anyone has experience with PCM and how to efficiently apply filters then send back out.</p> <p>I also want to know if anyone has any experience with Audio ADC's and DAC's and would have any suggestions for when I get to the point of developing my own board.</p>
High Quality Audio ADC and DAC with Embedded
2010-09-07T19:12:46.483
4303
|measurement|
<p>SparkFun has a nice CO sensor for $7.25: <a href="https://www.sparkfun.com/products/9403" rel="nofollow">https://www.sparkfun.com/products/9403</a>. They even have a breakout board for $0.95 that simplifies hooking it up: <a href="https://www.sparkfun.com/products/8891" rel="nofollow">https://www.sparkfun.com/products/8891</a></p>
<p>I'm looking for a document with a description of a method to measure CO and CO2 concentration on a gas. I found some information about how to do it with infra red absorption, but not enough information to run a test. I also saw something using a wire and a wheatstone bridge, but don't know what king of wire was that. Is there another way?</p>
How do I measure CO and CO2 concentration in a gas?
2010-09-08T12:38:13.347
4311
|uart|arduino|atmega|
<p>You can add a dual UART with SPI or I2C interface. NXP makes one that I've used on boards. Around $4 from Digikey, it's cheaper than jumping up to a $12 Atmega2560 for a design, and offers more data buffering. <a href="https://www.nxp.com/products/analog/signal-chain/bridges/om6273-sc16is752-762-spi-ic-to-dual-uart-irda-gpio:OM6273?lang=en&amp;lang_cd=en&amp;" rel="nofollow noreferrer">https://www.nxp.com/products/analog/signal-chain/bridges/om6273-sc16is752-762-spi-ic-to-dual-uart-irda-gpio:OM6273?lang=en&amp;lang_cd=en&amp;</a></p>
<p>I'm looking at the <a href="http://www.atmel.com/images/atmel-8271-8-bit-avr-microcontroller-atmega48a-48pa-88a-88pa-168a-168pa-328-328p_datasheet_complete.pdf" rel="nofollow">ATMega328p data sheet</a>, and <a href="http://arduino.cc/en/Hacking/Atmega168Hardware" rel="nofollow">an Arduino Pin diagram</a>, trying to determine if the chip can support three UART connections. I see that PD0 and PD1 are "USART" In and Out. So does that mean the other 10 or so Digital pins can be used for "UART" communications? </p> <p>I have a need to connect three UART devices through the ATMega chip. The ATMega will forward traffic between two of the devices at a time, depending on which mode it's in. </p>
Three UART connections to an ATMega328?
2010-09-09T14:28:14.580
4319
|adc|bom|
<p>If you use a distributor such as Arrow and Avnet they can help you. At least in the U.S. and if you aren't a hobbyist.</p>
<p>Sometimes I get a notice from a manufacturer that a part has gone obsolete. I now have to find a new part from a different manufacturer to put on the BOM.</p> <p>For a resistor or capacitor, it is pretty easy to look up the value, tolerance, temperature range, etc. of the original part and find a replacement.</p> <p>Some ICs are easier than others. There are lots of OpAmps and RS232 drivers. But there is still the battle of finding the IC in the correct footprint.</p> <p>I'm trying to design in several drop-in-replacement parts for a new design. I'm stuck on finding some compatible Analog to Digital Converters.</p> <p>Does anyone know of a site or method for finding this?</p>
How to find a drop-in-replacement ADC
2010-09-09T17:58:20.310
4328
|energy|storage|battery-chemistry|
<p>Nano silicon anode lithium ion battery has a theoretical upper limit of 12000 watt hours a kilogram. I don't know volumetric density. The issue is silicon swelling which causes cracking. As of 2023 they are working on using sulfur to add some flexibility so the swelling doesn't cause cracking. That's the best I've got.</p>
<p>This is more a physics/chemistry/nanotech question, but what's the theoretical best energy density you could get out of a chemical battery (or fuel cell), if you could arrange atoms in any manner you wanted? I'm thinking of the nanotech batteries described in <a href="http://en.wikipedia.org/wiki/The_Diamond_Age" rel="noreferrer">Diamond Age</a>. How does it compare to current technologies?</p> <p>This is specifically about <em>chemical</em> batteries, which could be built atom-by-atom in the charged state, not nuclear, antimatter, <a href="http://theculture.wikia.com/wiki/Collapsed_antimatter" rel="noreferrer">CAM</a>, or other more exotic technologies.</p>
What's the highest theoretical energy density for a chemical battery?
2010-09-09T21:23:28.980
4330
|measurement|
<p><strong>Little bit of background</strong><br /> Everything in the world creates noise. Sometimes a little, sometimes a lot. In general, the hotter something is, the more noise it creates. This comes down to the fact that the hotter something is, the faster things move at the very lowest level.</p> <p>In a resistor, there is a fairly linear amount of noise added to a system as the temperature goes up. The function of temperature to noise in a resistor is commonly used to identify the amount of noise added.</p> <p><strong>What's this actually mean?</strong><br /> In Antenna systems it is useful to be able to identify how much noise is introduced into a system. This is done with the Noise Temperature. A particular system will have a Noise Temperature associated with it. This is just saying that if your system were to be a perfect noiseless system, you could add a resistor in series at the temperature given and that is how much noise is being added.</p> <p>Many times the temperature is way above what a resistor would ever be at, but it is just a very easy way to model and convey the noise in a system.</p> <p><strong>Going a little bit more in-depth</strong><br /> Thermal noise is generally modeled as white noise (noise that is equal at all frequencies) within what ever frequency range will make it through a system. In order to actually use noise temperature it is helpful to know the bandwidth that is being talked about. This is what the wiki page is calling the noise bandwidth.</p>
<p>Here's a good question for the professional electronic engineers of Chiphacker: What is <a href="http://en.wikipedia.org/wiki/Noise_temperature" rel="nofollow">noise temperature</a>, and how is it used in designing receiving systems as a whole? (I've seen it specified for the Arecibo telescope antenna, for example.) </p> <p>I've seen this specification used mostly in the UHF and higher bands, but I really don't understand how it's used.</p>
What is Noise Temperature?
2010-09-10T06:06:26.260
4332
|msp430|osx|launchpad|
<p>The drivers for the TUSB3410 for Mac OS X are still in beta. You should consider contact TI about this and maybe they can try to fix your problem. Even if they aren't currently interested in pushing the Mac side, the more interest they get from Mac users the more likely they are to do something.</p> <p>I also found a few comments about how there are open source version of the driver, but was unable to find any of them. Maybe you will have better luck looking for them.</p>
<p>Has anyone managed to get a TI Launchpad doing serial comms via the onboard USB chip (TUSB3410) to OSX?</p> <p>I have mspdebug working for uploading code. But to get serial I'm having to plug an FTDI chip into the serial lines on the MSP430. </p> <p>Does anybody have instructions for making the TUSB3410 work properly in OSX?</p> <p>They claim to have drivers, but I can't make them work.</p> <ul> <li><a href="http://processors.wiki.ti.com/index.php/MSP430_LaunchPad_Mac_OS_X" rel="nofollow noreferrer">MSP430 LaunchPad Mac OS X</a></li> </ul>
TI Launchpad USB serial comms in OSX
2010-09-10T10:35:03.703
4348
|power|sensor|
<p>I agree that the stray magnetic field from your power cables seems like it would be enough to at least discriminate between "at least 5 amps on" or "0 amps off". Perhaps you could build up a system based on one of the <a href="http://opencircuits.com/Current_sense#magnetic_field_sense" rel="nofollow">magnetic field sensors listed at Open Circuits</a> and press it against the power cord at some convenient point.</p> <p>As Joby Taffey pointed out, most equipment plugs into an electric socket, and so inserting a meter between the equipment and the electric socket is common:</p> <ul> <li><a href="http://www.newark.com/extech-instruments/480172/test-equipment-ac-line-seperator/dp/27K9937" rel="nofollow">AC Line Seperator for Current Clamps</a> solves the "cutting into the power cord" problem, and assumes you already have some <a href="http://www.newark.com/tenma/72-7222/digital-clamp-amp-meter/dp/01N4891" rel="nofollow">clamp meter</a> or another <a href="http://www.newark.com/extech-instruments/38387/ac-clamp-meter/dp/27K9683" rel="nofollow">clamp meter</a>.</li> <li>The <a href="http://www.thinkgeek.com/brain/whereisit.cgi?t=watt+usage" rel="nofollow">"watt usage" meters at ThinkGeek</a>.</li> </ul> <p>These things are generally calibrated to linearly measure current, so they are total overkill for merely discriminating between "on" and "off". And they won't work as-is for your application, since there is no socket between your well pump and the distribution panel. But perhaps using one of these off-the-shelf devices, hacking it open and pressing the magnetic sensor against the weak magnetic field that leaks out of your romex cable, will be able to discriminate between "on" and "off" and take much less time and effort than building up something from scratch.</p>
<p>Is there a practical way to sense 60Hz AC power in a <em>pair</em> of wires? Measuring the exact power or even current isn't necessary; it would be sufficient to know whether the load is pulling more than, say 5 amps, or not. For example, suppose you have a well pump wired directly into the house distribution panel, and you only want to monitor when it turns on and off.</p> <p>This would be a piece of cake if it were possible to separate the conductors and get a regular AC current probe around one of them, but cutting into the romex is unsatisfactory. Finding a place where the conductors are already separate is an obvious angle of attack, but let's leave taking the face off the distribution panel for last resort.</p> <p>Ideally there are already commercial sensors for this, but it's proving to be an awkward thing to google for. Seems like 8 or 10 amps through two conductors 3/8" or so apart should give off enough stray field to at least tell the difference between on and off.</p>
How to go about sensing AC power in existing wiring
2010-09-10T22:32:15.497
4355
|interface|camera|processor|
<p>Have you looked at the Gumstix Overo COMs? COM = Computer On Module. They have a dedicated camera interface (J5). Beagleboard may have this as well, as it is the same OMAP35xx series processor.</p> <p>If you want to roll your own, there are many, many microprocessors with camera interfaces. Freescales i.MX series of devices (i.MX31, i.MX51, etc.), the OMAP processors I mentioned above, Atmel has the AT91SAM series... What other features do you need? </p>
<p>I was looking for a processor to interface to the DVP port of a 5MP CMOS camera module. </p> <p>I could possibly write the software for doing this but I've heard that many processors have a hardware camera interface port that makes the job much efficient.</p> <p>What would like to do is capture frames from this camera and store it in external ram for some processing later.</p> <p>Any idea how could I get around doing this? I just a small enough processor about 44pins or 64pins or so that has a camera interface port and external memory interface.</p> <p>Edit: I think a small enough processor isn't going to be available, I'd be lucky if someone finds some most of the processor pointed out in the answers have 200+ pins. So feel free to point to processors without the "pins" limitation.</p>
Processor with hardware camera interface port?
2010-09-11T07:27:20.417
4371
|spi|
<p>The 'r' command for bus pirate reads a single byte, so r:16 is attempting to read 16 bytes, not 16 bits. I'd guess you want "r:2 r:2" (or just "r:4")</p> <p>But, I doubt that's the problem. If it had worked, you'd have seen the 4 bytes then some FFs.</p> <p>I think it's more likely that your chip is not ready to accept commands over SPI.</p> <p>I did some work with the CSR BC04 a few years ago. They can be configured to accept commands over the UART, SPI or USB. It's possible that yours isn't accepting commands over SPI. Fixing this may involve reflashing the firmware.</p> <p>You might give the Bus Pirate SPI sniffer a go and see if you can intercept some valid looking signals when your device is running normally. That would give some confidence that it really is using SPI. Another way to do this would be to use a 2 channel oscilloscope, trigger on CS and look for the SPI clock ticking while CS is asserted.</p> <p>To be honest, if you're just trying to get SPI going on the Bus Pirate - choose something easier. <a href="http://blog.hodgepig.org/articles/000033-buspirate/index.html">The first device I used mine on was an RGB LED matrix from Sparkfun</a>.</p>
<p>I'm trying to learn about SPI and I have a old Bluetooth headset with SPI solder points on it. I've already soldered the corresponding {MISO,MOSI,CS,CLK} pins and connected them to the Bus Pirate correctly. The chip on the headset is a CSR-31315 (9A11U-717AT) which I've found <a href="http://datasheetz.com/data/RF%20and%20RFID/RF%20Transceiver%20ICs%20and%20Modules/BC413159A11-IQA-E4CT-datasheetz.html" rel="nofollow">a PDF for</a> (SPI on pg. 74).</p> <p>The PDF says to perform a read operation all that needs to happen is the CS needs to go from high to low, then a 8-bit read command of 0b00000011 needs to be sent, then the 16-bit address to read needs to be sent. After that it will output on MISO a check word which is composed of {command, address [15:8]} (what is the [15:8] for?) and then finally the contents of the address. Then last take CS high again so it doesn't continue on to print the Address+1 on MISO.</p> <p>The command I'm feeding to my Bus Pirate is <code>[ 0b11 0x00 0x00 r:16 r:16 ]</code>, which I believe should take CS from high to low (it idles high), output 0b00000011 the read command, write the 16-bit address of 0x00 0x00, read the 16bit checkword, read the 16-bit address data, and finally take CS high again. I think that should work but it doesn't.</p>
SPI Reading memory over SPI with Bus Pirate
2010-09-12T19:09:15.517
4374
|avr|arithmetic-division|
<pre><code>p = 202/v + 298; // p in us; v varies from 1-&gt;100 </code></pre> <p>The return value of your equation already is <code>p=298</code> since the compiler divides first then add, use integer muldiv resolution that is:</p> <pre><code>p = ((202*100)/v + (298*100))/100 </code></pre> <p>Using this is same multiply <code>a*f</code>, with a=integer f=fraction.</p> <p>That yield <code>r=a*f</code> but <code>f=b/c</code> then <code>r=a*b/c</code> but it doesn't work yet because position of operators, yield the final <code>r=(a*b)/c</code> or muldiv function, a manner to compute fraction numbers using only integer.</p>
<p>I'm trying to find an efficient way of calculating an inverse on an AVR (or approximating it).</p> <p>I'm trying to calculate the pulse period for a stepper motor so that I can vary the speed linearly. The period is proportional to the inverse of the speed (<code>p = K/v</code>), but I can't think of a good way of calculating this on the fly.</p> <p>My formula is</p> <pre><code>p = 202/v + 298; // p in us; v varies from 1-&gt;100 </code></pre> <p>Testing on the Arduino, the division seems to be ignored completely leaving <code>p</code> fixed at <code>298</code> (though perhaps this would be different in avr-gcc). I've also tried summing <code>v</code> in a loop until it exceeds <code>202</code>, and counting the loops, but this is quite slow.</p> <p>I could generate a lookup table and store it in flash, but I was wondering if there was another way.</p> <p><strong>Edit</strong>: Maybe the title should be "efficient divide"...</p> <p><strong>Update</strong>: As pingswept points out, my formula for mapping period to velocity is incorrect. But the main problem is the divide operation.</p> <p><strong>Edit 2</strong>: On further investigation, divide is working on the arduino, the problem was due to both the incorrect formula above and an int overflow elsewhere.</p>
Efficient inverse (1/x) for AVR
2010-09-13T01:12:53.050
4382
|fpga|microcontroller|
<p>Microcontrollers are digital circuits that execute commands from its program memory sequentially one command after another.The digital hardware circuit of a microcontroller is fixed and the interconnects between different gates that comprise the digital circuit are permanent and are etched on the silicon. Where as FPGAs can be thought as a pool of digital gates (in reality though luts are present instead) which have programmable interconnects. Now any digital circuit (even a microcontroller) can be made on the fpga by programming the interconnects. </p>
<p>I've worked on the Arduino family (specifically the Sanguino), built a few simple devices and a simple phototrope. I am thus pretty comfortable with microcontrollers - specifically Atmel's. I'm curious to know how do FPGA's differ from standard microcontrollers. I am from a technical background (C/C++ programming) and thus would love technical answers. Just keep in mind that I am a newbie (relative to my s/w experience) in the electronics domain. :)</p> <p>I did go through <a href="https://electronics.stackexchange.com/questions/1060/what-is-an-fpga">this query</a> and it was good but I'm looking for further deeper details.</p> <p>Thanks! Sushrut.</p>
FPGA's vs Microcontrollers
2010-09-13T06:36:01.327
4387
|lpc|
<p>MicroBuilder.eu have an Eagle format reference design for the LPC1114.</p> <p><a href="http://www.microbuilder.eu/Projects/LPC1114ReferenceDesign.aspx" rel="nofollow">http://www.microbuilder.eu/Projects/LPC1114ReferenceDesign.aspx</a></p> <p><a href="http://www.microbuilder.eu/Projects/LPC1114ReferenceDesign/LPC1114CodeBase.aspx" rel="nofollow">http://www.microbuilder.eu/Projects/LPC1114ReferenceDesign/LPC1114CodeBase.aspx</a></p>
<p>I would like to build a board for an LPC1* processor. Are there published Eagle layouts for these?</p>
Are there any open design files for an NXP LPC1* breakout board?
2010-09-13T13:02:22.360
4389
|avr|pic|programmer|isp|pickit|
<p>This page has the circuit diagrams, C code, and compiled windows executable for using ISP to program a PIC. The (windows) software is different form the AVR software, so maybe it is just a cheap way to program PICs. Certainly cheaper than $1200.</p> <p><a href="http://elm-chan.org/works/avrx/report_e.html">http://elm-chan.org/works/avrx/report_e.html</a> (near the bottom)</p>
<p>I want to try programming a PIC chip and just see, how much different it is compared to an AVR. I've got an <a href="http://www.ladyada.net/make/usbtinyisp/" rel="nofollow noreferrer">AVRtinyISP</a> and would like to know, if it would be possible to use that to program a PIC chip at all? What would limit me from doing that?</p> <p>Both today's AVR and PIC chips have ICSP interfaces for program uploading and use apparently compatible pinouts for programming (PIC used to require a higher voltage supplied to program it, but newer chips don't require that anymore). </p> <p>So my question is: <strong>is it even remotely possible to program a PIC chip with an AVR ISP programmer, such as AVRtinyISP or AVR ISP MkII</strong>? </p> <p>Has anyone ever tried that? </p> <p>If it's not possible or is too hard, then what are the limitations -- it is the protocols used, pinouts not matching exactly, voltages/current ratings, anything else? Is it possible to do that vice versa, i.e. using a PICKit clone to program an AVR chip? What would be the modifications needed to make anything of that possible at all? </p>
Is it possible to use AVR ISP programmer to program a PIC chip?
2010-09-13T13:55:33.790
4394
|microcontroller|
<p>I occasionally do chip design - as mentioned above many chips will intersperse power and grounds within parallel buses so that the drivers will have enough power (lead inductance is an issue - plus you don't want to starve the core when driving external loads).</p> <p>However there are other issues - you might be constrained for on-die routing resources meaning it makes more sense to push those issues externally - I worked on a PCI interface where we tried hard to push pins to the right places (total system cost means getting to a 4 layer board can be important) but were constrained in some critical timing paths that meant we had to push some of the timing budget off-chip by moving the pads closer to the rest of the logic they drove while assuming longer external traces</p> <p>Sometimes you design a die but it goes into multiple packages - maybe the BGA package is optimally pinned out but not the QFP - or maybe the package was chosen late in the design cycle after the pads on the die were already chosen </p> <p>So there's lots of reasons - sometimes it really is that the chip designer didn't think ahead </p> <p>But remember for some buses you don't always have to wire up all pins exactly - if you're wiring up a SRAM/DRAM (or sometimes even flash if it's not being pre-loaded) you can often switch bits within a byte or even (carefully! depends on the chip) address bits</p>
<p>Some micros have all bits of a port nicely lined up, while others' bits seem to have been scattered by the winds to all four points of the compass. Why?</p>
Why put the bits of a port on non-adjacent pins?
2010-09-13T17:52:05.630
4413
|arduino|avr|profibus|
<p>Here is a working link for AVR GCC source with up to <strong><a href="http://www.mikrocontroller.net/attachment/76882/AVRSoftBus.zip" rel="nofollow">187.5Kbps profibus slave in software</a></strong>. This is the <strong><a href="http://www.mikrocontroller.net/topic/106174" rel="nofollow">original forum link</a></strong>, and online google translation breaks before reaching important part, so I didn't provide the link for it.</p>
<p>Is there an open source solution to interface any profibus slave or master chips?</p> <p>These are the latest finds for a Profibus slave AVR solution:</p> <ul> <li>AVR GCC with up to <strong><a href="http://www.mikrocontroller.net/topic/106174" rel="nofollow noreferrer">187.5Kbps profibus slave in software</a></strong></li> <li>AVR GCC with up to <strong><a href="http://www.avrfreaks.net/index.php?module=Freaks%20Academy&amp;func=viewItem&amp;item_id=2587&amp;item_type=project" rel="nofollow noreferrer">12Mbps profibus slave in hardware</a></strong></li> <li>AVR ASM with up to <strong><a href="http://www.htw-dresden.de/fe/labor/mikror/projects/pb_slave/index.htm" rel="nofollow noreferrer">187.5Kbps profibus slave in software</a></strong></li> </ul>
AVR or Arduino Profibus interface project?
2010-09-14T12:28:46.067
4441
|led|audio|analog|
<p>I've tried to do this before and the problem is the shape of the exponential RC curve. Your eyes are very sensitive to changes at low light levels, so going from OFF to low current, it immediately looks bright because that part of the curve is rising quickly. I think that an inverted curve (logarithmic) would give you what you want, but it's harder to do with just analog components.</p> <p>I ended up throwing a microcontroller at the problem since it was simpler to do that than build a log amplifier. Even then, I found that I had to increase the current very very slowly at the low end (was trying to simulate sunrise).</p>
<p>This is probably a very easy question, but I've been trying for several weeks now to create a simple circuit that "fades in" some LEDs using only discrete components like resistors, capacitors, inductors, (photo) diodes, transistors, and a voltage source.</p> <blockquote> <p>Using only discrete parts (no ICs), how do I "fade in" a few LEDs over the course of a second or two?</p> </blockquote> <hr> <p>I've managed to create the <strong>opposite</strong>, the "fade away":</p> <ul> <li>+Volts connected to "RC" and then to "PL" and then to ground in series</li> <li>RC is a resistor and capacitor in parallel</li> <li>PL is roughly some leds in parallel: PL1 and PL2 in parallel</li> <li>PL1 is a LED and resistor in series</li> <li>PL2 is three LEDs and resistor, all in series</li> </ul> <p>When powered up (at +6V with the RC using 1K ohm and 2200uF) all LEDs immediately light (no fade in at all), but over 2 seconds the triple LED (PL2) fades to black.</p> <hr> <p>I can of course make this using an Arduino and the PWM output pins to make intricate fade in and fade out patterns, but the circuit is to demonstrate using a simple transistor to switch a system on, and if I'm using a microcontroller to drive that system, I might as well have the transistor trigger my laptop to play a youtube video.</p>
Analog, discrete component fade-in
2010-09-17T00:37:32.300
4450
|temperature|microcontroller|
<p>My design (Eagle files and Arduino sketch) is on the web: </p> <p><a href="http://dorkbotpdx.org/blog/scott_d/temperature_controller_board_final_design" rel="nofollow">http://dorkbotpdx.org/blog/scott_d/temperature_controller_board_final_design</a></p> <p>The design includes an Arduino compatible and has provision for a MAX6675 thermocouple chip and an IR temperature sensor based on a modified IR thermometer from Harbor Freight Tools. It also has a built in interface for a common 16x2 (or similar) LCD, inputs which could be used for buttons (although I'm currently using an encoder instead) and a digital output for controlling an SSR or other relay. A number of local hobbyists are using this board for temperature control of various projects including reflow hotplates.</p> <p>I note that you require +/- 0.5°F temperature accuracy, which is better than most thermocouples can provide, so you might have to find some other type of temperature sensor for your project. It depends on the temperature range you need to measure.</p> <p>If you want to use my Eagle files to make a PCB, I can recommend the Portland DorkBot group PCB order: <a href="http://dorkbotpdx.org/wiki/pcb_order" rel="nofollow">http://dorkbotpdx.org/wiki/pcb_order</a>. It is inexpensive and designed for hobbyists.</p>
<p>I want to do a project where the temperature of a device is controlled by toggling on/off a heating element (120VAC),presumeably by using a relay. I would like a board that has an input for a temperature sensor of some sort and some form of a display and buttons to allow me to create a user interface. </p> <p>Whether the board itself has the relay or not does not matter (I can use 5V to trigger a 'powerswitch tail' if I need to). The board would definitely need a display of some sort (nothing fancy needed), some buttons, and the ability to measure temperature accurately (+/0 0.5 °F worst case). Does anybody know of anything that fits the bill?</p>
Good board for DIY temperature control/readout
2010-09-18T12:33:10.150
4458
|8085|microprocessor|clock|
<p>Internally, the core of the 8085A requires a two-phase clock. The internal logic that derives the two clock phases also divides the input clock by two. As previously stated, the reason for using a 6.144MHz input clock is for baud-rate purposes, the chip will run just fine at 6MHz. The chip is actually rated at 3MHz requiring a 6MHz crystal, but runs happily with a 6.144MHz giving easier baud rate generation (An Uart could be clocked with either the 6.144MHz from an Oscillator driving the 8085 or at 3.072MHz from the 8085's CLK output providing many usable Baud rates). I still use these archaic chips to perform special functions in some of my robots. I clock the Uarts with their own oscillator and I clock the 8085A's with a 6.4MHz oscillator, which runs the chip at 3.2MHz. The 3.2MHz divides down nicely to provide the 40KHz clock for my ultrasonic transducers. It makes more sense to use more modern I.C. devices in my 'bots, but I have a ton of old 8085's, Z80's, 63C09 and 63C09E's, 68B09 and 68B09E's, etc. that I really enjoy playing with.</p>
<p>Why is it that the produced clock frequency is 6.144 MHz, but internally it (8085 processor) uses only 3.072 MHz. Also what leads to the specific value of 6.144 in a clock. </p> <p>I found an answer at yahoo.... <a href="http://answers.yahoo.com/question/index?qid=20080810090119AAurr2i">http://answers.yahoo.com/question/index?qid=20080810090119AAurr2i</a></p> <p>but I must admit I didn't still get it it well. Could any of you guys throw out a few lines on this, please? </p>
Why in 8085 microprocessor, the clock frequency is divided by two?
2010-09-19T16:53:38.290
4502
|audio|operational-amplifier|buffer|
<p>If you really want zero clicks, then you want to fade to zero instead of shutting off suddenly, because that is still introducing a step change to the signal. Or maybe you could shut off on a zero crossing, but I can't think of an obvious circuit to do so.</p> <p>I think I would feed the signal into a divider made of a resistor and FET to ground, and put an RC on the gate of the FET so it would switch slowly into conduction. This will introduce a severe DC bias in the output, so it could be capacitively coupled into the opamp. If the DC bias is applied and removed slowly, it won't cause a pop. Remind me and I will sketch the circuit up.</p>
<p>I need to buffer an audio signal (feeding into a variable input impedance), and make it mutable with a digital control. The best thing I can think of is an op-amp (maybe <a href="http://www.st.com/stonline/products/literature/ds/6031/ts971.htm">TS971</a>? 3×2 mm SOT23) feeding into an analog switch, like <a href="http://www.onsemi.com/PowerSolutions/product.do?id=NLAS4599">NLAS4599</a> (3×3 mm TSOP-6), but this requires several external components (<a href="http://www.geofex.com/article_folders/cd4053/cd4053.htm">example circuits</a>).</p> <p>Anyone know of anything better? A tiny IC that acts as both a unity-gain buffer and a digitally-controlled mute? Supplies are 4.5 V and ground, signal is biased to half that, and the mute and unmute transitions should be pop-free.</p>
Tiny, cheap audio buffer with mute?
2010-09-23T15:13:22.883
4511
|cellphone|
<p>TTY/TDD uses tones in the audio band (similar but not compatible with the old Hayes modems) to communicate over telephone lines. The original protocol uses Baudot code at 45.5 or 50 baud. In 1994 the ITU approved a newer V.18 standard.</p> <p>So I would presume the headset jack would just pass these tones back and forth to a TTY/TDD modem. It would not be a hidden RS-232 interface -- i.e. the cellphone is not acting as the modem.</p>
<p>Some cell phones are TTY/TDD (telecommunications device for the deaf) compatible, meaning a terminal can be plugged into the headset jack for text communications. Is it just a hidden RS-232 interface?</p>
What protocol does a TDD/TTY use to communicate with a cell phone's headset jack?
2010-09-24T16:47:55.683
4515
|pcb|usb|connector|layout|shielding|
<p>I think ESD protection chip and thicker tracks with more than 100 mil between shield and ground would be a good choice.</p> <p>Also more stitching around the shield provides a Faraday cage to the noise.</p>
<p>How should I route USB Connector shield on PCB? Should it be connected to GND plane right where USB is placed, or should the shield be isolated from GND, or should it be connected to ground through ESD protection chip, high resistance resistor or fuse?</p> <p>PS. Should I put the shield connections on schematic, or just route it on PCB?</p>
How to connect USB Connector shield?
2010-09-24T20:08:35.073
4528
|robotics|wheel|encoder|motor|
<p>One approach might be to use a programmable logic device as a gray-code ripple counter with enough stages that you can simply poll the value at a convenient rate and not lose counts. Note that one advantage of a gray-code ripple counter over some other approaches is that there's no danger of noisy inputs glitching the counter provided that no input changes when the other input isn't stable.</p>
<p>I'm looking to a simple solution to keep the position of a robot. It has two DC motor and one wheel encoder for each. The encoder are incremental type.</p> <p>I need to be able to get the current count of increment from an atmega.</p> <p>I found some chip like the LM628/629 who will do great job, too great in fact, because it cost ~50$. </p> <p>Do you know a dedicated IC that has only the count (in both direction) features for a wheel encoder, Or is it possible to make à simple one with an attiny ?</p>
how to count 2 wheel encoder signal?
2010-09-26T10:19:24.457
4531
|attiny|arduino|serial|ftdi|usb|
<p>So the answer does appear to be: you <strong>can</strong> just hook up the wires, indeed just GND (black) and RXD (yellow), and everything works as long as the software is good. </p> <p>Things that did not matter:</p> <ul> <li><p>Internal oscillator works just fine. It appears relatively stable to my limiting testing. At 9600 baud whatever problems it has are negligible.</p></li> <li><p>Using USB power on the signals works just fine. You can use a separate voltage source (sharing a common ground), but the FTDI cable reads both 3V and 5V signals perfectly. I connected a battery pack, - to GND of both the FTDI and the tiny, + to the tiny's VCC, and this worked just fine. However just using the VCC (red) of the FTDI (USB power 5V) is much simpler and just as effective.</p></li> </ul> <p>Things I did wrong:</p> <ul> <li><p>The Yellow FTDI "RXD" line receives bits from the microcontroller, so it connects to the transmit in on the microcontroller. I could have figured this out myself by connecting the transmit and receive lines (orange and yellow) to LEDs or an Arduino and checking which voltage flickered when I transmitted from the PC.</p></li> <li><p>Neither SoftwareSerial nor NewSoftSerial works out of the box with an ATtiny. While the ATmega328p and the ATtiny85 share a lot of similarities, there are enough differences that just getting the old software to compile for the new chip is not sufficient.</p></li> <li><p>Slower baud rates do not cure things. 300 baud requires more complicated delay routines since the number of cycles between bits is significantly more than an 8bit counter. 9600 baud works just fine, and higher baud rates are doable.</p></li> <li><p>Be careful of writing timing critical code in C, especially in inline functions. The time it takes to execute will depend on how the compiler optimizes it. In particular, when calibrating the delay by just changing it up and down, you will get a different answer than when using a (compile time detectable) constant delay, because the assembly generated can be fairly different. It's not that C is "slow", but rather that it was too fast. At one point I was sending 1s faster than 0s (presumably they are more aerodynamic).</p></li> <li><p>To start a transmission, you bring the line LOW (the start bit) and then you need to make sure the line is at the right voltage at each of the next 8 sample points, and then make sure the voltage is HIGH at the 9th sample. NewSoftSerial mentions doing a half-length delay on the start bit, but this did not work well for me. I used a 75% delay on the start and a 125% delay on the end.</p></li> <li><p>The real concern about voltage might be that some "serial" (especially RS232) is ±12V, not 0V/5V. I spent a lot of time trying to understand how I could adjust the voltage from 5V to 3.3V, but I think that was completely irrelevant.</p></li> </ul> <p>At any rate, transmitting serial is easy, but getting the timing "perfect" appears pretty important. For me, this was just a matter of coding the transmit in assembly so that I could count the cycles.</p>
<p>I'm trying to transmit from an ATtiny85 to a PC using Arduino-esque code over a USB-Serial converter without understanding very much of anything. I was shocked and appalled that it did not work.</p> <p>I confirmed that the tiny is flickering the voltage on one of its pins, but when I connect that pin to transmit or receive on the USB-serial cable and try to listen using a terminal program, I get nothing.</p> <p>I'm not sure how to tell which part is broken.</p> <blockquote> <p>Do I need more than VCC, GND, and TXD to transmit serial?</p> </blockquote> <hr> <p><strong>Details:</strong></p> <p>The code for the tiny is written in the Arduino environment and similar code successfully blinks all 4 "PORTB" pins, at least according to the LEDs. I use the <a href="http://hlt.media.mit.edu/wiki/pmwiki.php?n=Main.ArduinoATtiny4585">code from HLT and Saporetti</a> to let me use the Arduino dialect of C++ to program it. The program still comes in under a K.</p> <pre><code>#include &lt;SoftwareSerial.h&gt; SoftwareSerial s(0,1); //receive on "0", and transmit on "1" aka "PB1" aka pin 6 void setup() { s.begin(4800); } // assuming 1Mhz, 4800 baud void loop() { s.println(millis()); } // transmit something at every opportunity </code></pre> <p>There's a lot of translation involved, but the code is pretty basic. The code that sets the baud rate seems to assume 1MHz, but luckily my attiny has factory default fuses and runs at 1MHz. At any rate, pin 6 is flickering its voltage according to the LED.</p> <p>So I use the little wires to connect the "ftdi" end of the <a href="http://www.adafruit.com/index.php?main_page=product_info&amp;cPath=33&amp;products_id=70">FTDI USB-serial converter</a> to the tiny: black to GND, red to VCC, orange to 6. I open the program "minicom" on the PC, set the baud rate to 4800 and wait, for nothing. When talking to my <a href="http://www.ladyada.net/make/boarduino/">Boarduino</a>, it has no trouble.</p> <p>The FTDI converter cable has the following pinout: black is GND, brown is "CTS", red is VCC (+4.98V), orange is "TXD", yellow is "RXD", green is "RTS".</p> <blockquote> <p>If I want to transmit from the tiny to the PC, should I be flickering the voltage on "TXD" or "RXD"? In other words is the transmit wire to transmit from the slave to the host, or the host to the slave?</p> </blockquote> <p>I actually tried both, neither worked. I've fried less than a dollar's worth of equipment so far, and I'm getting cocky, so I just plug wires into the cable. Maybe I'm not supposed to ignore the "CTS" and "RTS" wires?</p> <blockquote> <p>Do I need to use any other wires? Do RTS and CTS do anything?</p> </blockquote> <p>The hardware is an ATTiny85-PU (DIP-8 package, running at 1MHz, rated to 20MHz) powered by USB at 4.98V. The host PC is a MacBook, and it successfully does all things arduino, including using ArduinoISP to program the ATtiny to blink its little heart out.</p>
Serial newbie: why can't I just hook the wires up?
2010-09-27T04:05:16.467
4542
|transistors|audio|resistors|analog|components|
<p>One approach not yet mentioned which is applicable in some low-frequency scenarios, though it must be used with caution, is to recognize that a resistor which is switched on and off via PWM signal will, at frequencies which are much lower than the PWM frequency, behave roughly like a larger resistor whose resistance is that of the original divided by the PWM duty cycle. So a 1K resistor at 5% duty cycle will behave roughly like a 20K resistor.</p> <p>The biggest caveat with this approach is that it will often inject noise into the system at the PWM frequency. This may not be a problem if the components dealing with the signal can filter out such noise cleanly, or if they can pass it through without distortion to other components which can. Before using such a design, one must ensure that one of the above requirements is met. The fact that a component has a maximum useful frequency does not imply that it will cleanly filter things above that frequency. Many amplifiers, for example, will distort if the input signal would cause the output slew rate to exceed their abilities. If an amplifier is fed a mixture of a 1KHz signal at 0DB and a 1MHz signal at -20DB (10% the voltage of the original) the output slew rate for the 1MHz component would be 100 times that of the 1KHz component. It's entirely possible that the slew rate of the 1KHz component would be well within the amplifier's abilities, but the 1MHz component would not; that could in turn cause the 1KHz portion of the output to come out severely distorted.</p>
<p>I have an analog audio project I'm playing around with designs for and it will need about 150 solid-state variable resistors. I plan to control these from a micro controller so a digitally controlled pot would work but all the ones I've found are way too expensive ($1.00-$1.50).</p> <p>My original plan was to use something like a MOSFET with a small capacitor and another transistor to hold a voltage on the gate. I would then update the voltages of each in turn via a DAC and some GPIO. However I haven't found any transistors suitable for my application (i.e. something that behaves enough like an ideal resistor).</p> <p>Any ideas?</p> <hr> <p>FWIW: the project is a variant on this (discontinued) EQ design: <a href="http://www.ti.com/lit/an/snoa711/snoa711.pdf" rel="nofollow">Designing with the LMC835 Digital-Controlled Graphic Equalizer</a>.</p>
Inexpensive solid-state variable resistor
2010-09-27T22:57:21.827
4552
|infrared|555|phototransistor|
<p>I would suggest using a microcontroller which is programmed to send out semi-random pulses of IR, and uses an ADC to measure the amount of IR received during the times the emitter is on and the times it is not. Such an approach will allow each detector to determine whether it has a clear shot to its associated emitter, even if there are other emitters nearby. One could if desired rig the detectors and emitters in such a way that each detector could be picked up by two or more emitters and vice versa; if the processor connected to a receiver knew the timing of all the emitters it could see, it could determine which emitters' signals the detector was picking up.</p>
<p>I would like to trigger a [7]555 timer when a phototransistor stops receiving light from an IR led, more precisely when the (expected to be smallish) signal from the light-sensitive voltage divider, consisting of a phototransistor and a resistor, changes quickly. How should I wire the timer? I expect if I decouple the light sensor from the timer with a capacitor I might be able to get a sufficient voltage swing to trigger the timer from a small but quick change in the signal?</p> <p>I would like to implement a version of the <a href="http://alan-parekh.com/projects/stair-lights/" rel="nofollow">LED staircase</a>. The project idea is to build a number of as-cheap-as-possible photodetector-triggered lamps on one side of a 3-foot gap opposite IR LED throwies on the other. When someone passes by they break the beam and trigger an entertaining trail of lights that slowly turn off, one by one, a couple of seconds later.</p> <p>I was overthinking the problem. After some experimentation it appears all I need is a photodarlington (a phototransistor by itself is not sensitive enough) in series with a resistor. This forms a voltage divider with a usable signal. If a potentially long low pulse is a problem then merely decouple the photodarlington from the logic with a capacitor differentiator.</p>
How can I generate a logic pulse from a broken IR beam?
2010-09-29T01:55:35.453
4555
|prototyping|sourcing|
<p>I think it's a combination of both. When starting out, you have a core idea that differentiates your product from others on the market. You'll start out breadboarding the idea to see if it works, how well, etc. During this phase you should buy ready-made components - I'm thinking mainly of something like a breadboard power adapter. There's no sense in making EVERYTHING from scratch to test one idea; get the idea down in code/circuit, make sure it works and is feasible. </p> <p>Now, after this point if you want to make a standalone product you'll have some work to do. The breadboard power supply may not be useful because it only does 5V, and you want to use 3.3V to lower power consumption, etc. So you pick a regulator IC, design the circuit, test that, etc. Once everything is pretty well set in stone I would make a PCB and solder up the prototype myself and create a testing scenario to make sure everything works. You'll find problems, fix them, respin the boards, etc.</p> <p>In general, I wouldn't put a module sold from Sparkfun or some other place in my finished product. You could and I don't think there's any major legal hurdles - my hesitance is mainly cost and usefulness-related. If this is going to be sold in any major numbers you don't want to have to buy headers to plug the modules in, pay the markup on the boards, or have to figure out workarounds for the drawbacks of the modules. For instance, I used an Arduino Mega in a serial bus tester. However, not all of the pins on the uC are brought out to headers, so I had to have a tech solder a magwire to the right pin so we could use it. If I had been making more than two of these then I would have just soldered the uC onto the PCB for the device instead of connecting the Arduino to the PCB via headers.</p> <p>In general I don't think that much of the functionality of the modules you see in places is that hard to reproduce. Some of them are just straight implementations of reference designs for the chips they integrate. These are easy enough to reproduce on your own and very legal as far as I know.</p>
<p>Assume that you have a couple of ideas that you think are good enough to prototype into demonstrable devices. What option would you take and why?</p> <p>Option 1 - Build everything from scratch including designing and soldering the circuit, embedded software and finishing / packaging touches. Basically in this option, you do everything and don't source ready-made circuits from elsewhere. For e.g., you can easily get ready-to-use PCB's for power supplies, motor drivers and so on. Instead you build your own. </p> <p>Option 2 - Figure out the common or readily available blocks in your schematics and source them from third parties. You work on only the parts that you think add value / novelty to your prototype (or one's that aren't readily available). These may include the electronics and/or the software.</p> <p>There are obvious costing implications but I am asking to ignore those since they are easy to arrive at and analyze against. I am also not touching on obvious IP implications on getting stuff from 3rd parties - again assuming that these are taken care of legally. Also, please sensitize your answers to commercialization of these prototypes - that is, assume that these will be available as custom or off-the-shelf products in the future.</p> <p>Rgds,</p> <p>Sushrut.</p>
Prototype building route
2010-09-29T05:18:34.047
4560
|bjt|transistors|
<h2>A functional explanation</h2> <p>The base-emitter junction behaves, like a diode, as a &quot;dynamic resistor&quot; that decreases its resistance when the voltage across it increases and v.v., increases its resistance when the voltage decreases.</p> <p>So, the input circuit consists of two resistors (constant RB and dynamic RBE that is seen from the input source as differential resistance <em>rbe</em>) in series driven by the input voltage source... and the &quot;amount of base current in a BJT&quot; is determined by the dominant resistor having a higher resistance. There are two typical cases:</p> <p><strong>Voltage-driven BJT.</strong> If RB &lt;&lt; <em>rbe</em>, the &quot;amount of base current in a BJT&quot; is determined only by <em>rbe</em> according to the input IV characteristic... and it can be graphically solved by the so-called &quot;load line&quot; technique.</p> <p><strong>Current-driven BJT.</strong> If RB &gt;&gt; <em>rbe</em>, the &quot;amount of base current in a BJT&quot; is determined only by RB... and it can be easily calculated by Ohm's law (look at Glorfindel's answer).</p>
<p>I'm having trouble understanding how much current flows through the base of a BJT. With a MOSFET the answer is easy: 0. How do I calculate the amount of base current in a BJT and am I doing it wrong if my circuit cares?</p>
How should I understand the amount of base current in BJT transistors?
2010-09-29T13:22:57.983
4575
|oscillator|
<p>Going more basic, a positive feedback OP-AMP circuit can be used to build a square wave oscillator. </p>
<p>Does anyone know how to build a push/pull oscillator or a similar square wave oscillator?</p>
Push Pull Oscillator
2010-09-29T19:15:24.167
4576
|pcb-fabrication|pcb-assembly|
<p>I would ask for a quote from a shop. Yes, it's obvious that it's going to be more expensive than doing it yourself, but at 100+ it may be worthwhile. How much is your own time worth to you? You already said you don't enjoy it too much. </p> <p>If you're soldering manually it will probably show, and that's BAD! Your customers won't appreciate it and most likely you'll lose them after a first sale. Plus they're not going to recommend you to their 1000 Facebook contacts, and you'll be up to an impossible-to-win marketing battle. Non-professional looking products are only accepted if the price is Real Low. So low that it may not be interesting to you. (The Chinese <em>have</em> professional-looking products real cheap, so you're up against them as well.) </p> <p>Just to say that it is probably a good investment it to spend some money on quality.</p>
<p>I'm a student living in the UK.</p> <p>I have this great idea for a product that fills a niche market and it interests me. It's a powerful on screen display module with datalogging capabilities, and it's open source hardware and software. See <a href="http://code.google.com/p/super-osd/" rel="nofollow">http://code.google.com/p/super-osd/</a>.</p> <p>I want to start selling these modules. I have PCB designs and I'm ready to order the components, but what route should I take for manufacturing the modules? I see three main possibilities:</p> <ul> <li>Etch my own PCBs and solder components on - pretty much a no go as I'm dealing with double sided surface mount boards.</li> <li>Order PCBs cheap from China and solder all 40 odd (0603, TQFP44 etc.) components on myself. (Probably the cheapest option but lots of manual labour.)</li> <li>Get a quote for PCB+assembly.</li> </ul> <p>Any ideas?</p>
Launching a new product as a student
2010-09-29T19:26:05.710
4579
|power-supply|capacitor|buffer|
<p>Like <em>ajs410</em> and <em>Thomas</em> say, using diode drops to go from 5V to 3.3V is a Bad Idea™. That's because, despite what you've been told in school, a diode voltage is anything but constant. The 3 diode drops may give you roughly anything between 2.3V and 3.2V, which may or may not be too low for your \$\mu\$C or SD-card.<br> I would start by replacing D4 with a <strong>Schottky</strong> type like a <a href="http://www.onsemi.com/pub_link/Collateral/BAT54T1-D.PDF">BAT54</a>, which has a low leakage current of &lt;1\$\mu\$A typical. This will give us a few hundred mV extra for the buffer capacitor.</p> <p>Next there's the 3.3V power supply. Use a low ground current <strong>LDO</strong>, like the Microchip <a href="http://ww1.microchip.com/downloads/en/DeviceDoc/22049f.pdf">MCP1703</a>, which has a ground current of just 2\$\mu\$A. (The Seiko <a href="http://datasheet.sii-ic.com/en/voltage_regulator/S812C_E.pdf">S-812C40</a> is a favorite of mine and has even better specs, but seems to have poor availability for low quantities.) </p> <p>Then you want to detect the loss of your 5V power supply. For this I usually use a <a href="http://www.onsemi.com/pub_link/Collateral/MAX809S-D.PDF">MAX809</a>. This will create a low output signal when its input voltage drops below a certain threshold. For a 5V supply threshold voltages of 4.63V, 4.55V and 4.38V are available. The output of the MAX809 goes to your \$\mu\$C's <strong>interrupt pin</strong>, so that you're immediately warned when the 5V drops, and you can write the buffer to the SD-card without delay. </p> <p>Now there's only 1 point left: the size of the <strong>buffer capacitor</strong>. You need to know how much current you're drawing from the 3.3V supply when writing to the SD-card. Let's assume this is 20mA. The capacitor voltage will decrease linearly when a constant current is drawn: </p> <blockquote> <p>\$ \Delta V = \dfrac{I \times t}{C} \$ </p> </blockquote> <p>or </p> <blockquote> <p>\$ C = \dfrac{I \times t}{\Delta V} \$ </p> </blockquote> <p>Let's further assume that you need 100ms to write the buffer to the SD-card. Then the only remaining variable is \$ \Delta V\$. We started with 5V minus 1 Schottky diode drop, giving 4.5V. The minimum voltage drop-out for the MCP1703 is 725mV, so we can go down to 4V, and \$ \Delta V\$ = 0.5V. Then</p> <blockquote> <p>\$ C = \dfrac{20mA \times 100ms}{0.5 V} = 4000 \mu F \$</p> </blockquote> <p>Now the values I used are rough guesstimates, and you'll have to make the calculation with the correct numbers, but the guesstimate indicates that you may not even need the 0.5F supercap after all, though it gives you a serious safety margin. You would for instance have 10s instead of 100ms to flush the buffer to the SD-card. </p> <p><em>(the dropout for the Seiko S812C is only 120mV, so this will double your allowed voltage decrease and hence your available time.)</em></p>
<p>I designing a circuit will store log data to an SD card. The information will be coming form a parent circuit that this one plugs into. The parent circuit will supply 5V to my daughter card. The daughter card uses an MCU that operates at 3.3V so I am just using a couple of diodes to step down the voltage from 5V.</p> <p>MY CHALLENGE IS: In the event of a power failure, I want the MCU on my daughter card to be able to sense the main power loss and then immediately flush the data from it's RAM to the SD card and then go idle before it shuts down. When writing to an SD card you can cause corruption if you lose power in the middle of a write procedure. </p> <p>I am thinking about using a big capacitor to just buffer the power for a bit. I know there are some MCU Supervisor IC's out there that would do a really nice job but they are intended for cases where you need to maintain power for days. I just need a second or two at the most. But I do have to be careful about not letting the MCU "flicker" on and off as the capacitor power decreases below the IC's threshold. Does anyone have a schematic or can offer any suggestions of how I should go about this?</p> <p>Here is what I have so far... (the .5F cap is my power back-up capacitor) <img src="https://i.stack.imgur.com/9mHGs.jpg" alt="alt text"></p>
Help with power-loss protection using capacitor
2010-09-29T19:30:38.680
4583
|operational-amplifier|schematics|
<p>Wow....there's so many choices out there, it can be hard to pick one!</p> <p>A good place to start is with the <a href="https://sound-au.com/" rel="nofollow noreferrer">Elliott Sound Products</a> website, there's a heap of different amplifier designs for all manner of applications, and there's also different levels of difficulty too.</p> <p>A great way to get started is to get a <a href="http://en.wikipedia.org/wiki/Breadboard" rel="nofollow noreferrer">breadboard</a>, buy all the stuff you need to make a simple looking amp, (there's a few single chip circuits on that link also) and just have a good experiment with it :)</p> <p>You can do stuff with a 9V battery quite safely, just get some audio jacks soldered to some wires and you can hook up your guitar and stuff.</p> <p>Distortion and feedback are a natural progression from amp design, you'll get into that quite quickly I'd imagine, it's not a big leap in complexity - it's normally just changing a few component values.</p> <p>this site is also great, lots of great stuff for guitarists -> <a href="http://www.beavisaudio.com/projects/" rel="nofollow noreferrer">Beavis Audio</a></p>
<p>I'd like to build a <em>cheap and easy</em> op-amp to use with my electric guitar.</p> <p>The op-amp should input from the guitar's <em>jack</em> and output to a standard "earphone's cable" jack ( not sure about the jargon here ). So that I can plug it into my Hi-Fi's aux channel, or my PC, or just listen on my earphones. A <em><a href="http://en.wikipedia.org/wiki/Nine-volt_battery" rel="nofollow">9v battery</a></em> would be the preffered power source.</p> <p>Where can I find schematics for a projet like this? </p> <p>Also, If I wanted to extend the op-amp to handle basic effects, ( Distortion, Feedback, etc. ) How would I achieve that?</p>
Building a intermediate op-amp
2010-09-29T19:59:08.663
4596
|atmega|
<p>Joby hit it on the head as far as storage goes. </p> <p>I would caution people experimenting with magnets and electronics (like reed switches) to be very wary of the filings that collect on powerful magnets. You'll get nearly invisible shorts when an iron filing that collected on the magnet falls onto your chip, embeds itself in some leftover flux, and takes down your system. Industry is worried about tin whiskers 10um in diameter and less than 1mm long - iron filings are just as dangerous.</p>
<p>I'm building a small circuit with an arduino bootloaded ATMega328 chip.</p> <p>The project will be housed in a small box, and is intended to be stuck to the side of a fridge using a magnet. </p> <p>Everything in my brain tells me that magnets and chips do not mix well. What is the likelihood that the sketch loaded onto the chip will become corrupted, or that something else will happen as a direct result of the magnetic forces, causing the chip to cease operation/ operate incorrectly?</p>
How do magnets affect the ATMega328?
2010-09-29T20:59:41.340
4604
|system|.net-micro-framework|netduino|
<p>Here's a recently announced system. <strong>It may not be available for purchase yet</strong>.</p> <p><a href="http://research.microsoft.com/en-us/projects/gadgeteer/default.aspx" rel="nofollow noreferrer">The .NET Gadgeteer</a></p> <p><a href="http://research.microsoft.com/en-us/projects/gadgeteer/gadgeer_modules.png" rel="nofollow noreferrer">http://research.microsoft.com/en-us/projects/gadgeteer/gadgeer_modules.png</a></p> <p><a href="http://research.microsoft.com/en-us/projects/gadgeteer/gadgeteer_example.jpg" rel="nofollow noreferrer">http://research.microsoft.com/en-us/projects/gadgeteer/gadgeteer_example.jpg</a></p>
<p>Once I heard of <a href="http://netduino.com/" rel="nofollow">Netduino</a> I began to wonder which other systems would provide the same features:</p> <ul> <li>Processor and Memory Micro .NET Framework ready</li> <li>USB interface</li> <li>Cheap</li> <li>Portable</li> </ul>
What are the .NET Micro Framework ready systems available?
2010-09-29T23:57:42.580
4606
|arduino|
<p>It's perfect. I did this exact thing in my house. I used an MID400 optocoupler to turn the 24VAC present across the terminals of the thermostat (at the furnace end) when the thermostat is NOT calling for heat into a digital high at the Arduino. I'm using an XBee network, but Ethernet (or even a tethered computer) would work just fine, too. It'll work for higher voltages, too.</p>
<p>Our house has 4 heat/cool zones, controlling two separate furnace units. I'd like to build a system to log on/off times for each of the zones and the burners/compressors. This makes a total of 10 inputs. Is arduino a good platform for this type of application? I have plenty of software experience, but limited hardware design knowledge (but I am comfortable with a soldering iron if I know the required design). I would probably ship the data (input#, new state) to a nearby server using TCP or UDP to be logged.</p>
Is Arduino a good platform for monitoring 24VAC thermostat circuits?
2010-09-30T02:04:56.610
4607
|embedded|
<p>Check out the Digikey website <a href="http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2556109" rel="nofollow">http://search.digikey.com/scripts/DkSearch/dksus.dll?Cat=2556109</a></p> <p>They have an online configurator where you can spec out your micro piece by piece... there are several that meet your spec. If you load the above page, be sure to scroll to the right, as there are tons and tons of options including package, memory peripherals etc...</p>
<p>I'm looking for a embedded controller for a project. I don't really know what's out there so I don't know where to start looking.</p> <p>My requirements are:</p> <ul> <li>Support for significant amounts of I/O <ul> <li>~150 GPIO (directly or via expanders)</li> <li>Several SPI (or I2C) interfaces</li> </ul></li> <li>Reasonably powerful, able to simultaneously do <ul> <li>~3MIPS</li> <li>~1MB/s I/O (via SPI/I2C) </li> <li>&lt;1MB/s of eathernet traffic</li> <li>And enough room left over for the parts I'm forgetting</li> </ul></li> <li>Can be used from a standard environment (c, gcc, etc. Not a custom language and IDE)</li> <li>Simple to use (one, maybe two chips, etc.)</li> </ul> <p>My wants are:</p> <ul> <li>A "standard" architecture that has many implementations (to minimize the effort if I need to switch chips, for some reason I'm leaning towards ARM)</li> <li>Available on low cost dev boards.</li> <li>Available as chips (mounting a board on a custom PCB seems silly to me)</li> </ul>
Help selecting an embedded controller
2010-09-30T02:16:06.930
4611
|power|
<p>The concept of 'Watt-hours' as Watt x Hours will be confusing to someone who cannot conceptualize Watt - being 'energy used per amount of time'.</p> <p>I sometimes try to explain this using more familiar concepts: If we use the term 'Keem' instead of 'km/hour', one could use 'Keem-Hour' to describe distance travelled—going 60 Keem for half an hour means you've travelled 30km i.e., 60 x 0.5 = 30.</p> <p>Just like a rental company that's interested in the distance your travelled in their car, the energy company is interested in the energy used—they will charge you per Watt-hour. If a Watt-hour costs 1c, it will cost you 60c if you leave a 60 Watt lamp on for one hour.</p>
<p>Pardon me, I'm a total newb to electronics. My question is, when a device is measured in watts, such as a 60-watt light bulb, is this ALWAYS supposed to be assumed to be watt-hours, i.e. 60 watts per hour?</p>
Are watts usually measured in watt-hours?
2010-09-30T03:57:47.580
4618
|arduino|microcontroller|avrdude|isp|
<p>Many programmable devices have historically required that they be programmed using relatively-precisely timed sequences of signals. In many cases, if one only wanted to program one particular type of device, the required hardware would have been quite simple, but since different devices had different requirements, building a more general-purpose programmer was somewhat more difficult.</p> <p>Today, one could probably program more than 50% of programmable devices using nothing more than a USB I/O cable and PC software, but "hardware" programmers still have a considerable speed advantage. For the PC to react to a signal received by a USB device and send a response generally takes a minimum of 1-2 milliseconds. If a programming sequence requires repeatedly asking a device when it's ready for the next chunk of data and then sending it, using a simple I/O cable would add an extra millisecond or two to the time required to handle each chunk. Depending upon the nature of the device in question, that could increase the overall time required for programming by an order of magnitude compared with a programmer which could be told, while waiting for a device to be ready, what it should do once it is.</p> <p>Personally, I like the approach of having flash-equipped devices ship from the factory with a boot-loader in memory that can be used with a minimum of programming hardware. If the device supports flash programming under software control, such an approach may simplify production without adding anything to the cost of the silicon beyond the very small marginal time required to have the factory test fixture program in the boot-loader after it has done everything else.</p>
<p>I use a <a href="http://www.ladyada.net/make/boarduino/">Boarduino</a> and a 30-row bread board to program my ATtiny. I load a not too complicated sketch called <a href="http://arduino.cc/en/Tutorial/ArduinoISP">ArduinoISP</a> (included by default now in the Arduino IDE), and suddenly I have a working programmer. Atmel sells a <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=2726">nice programmer</a> for between $30 and $40, and there are lots of kits for making cheaper ones.</p> <p>I was very happy once I got my working programmer and made the tiny blink some leds. However, now my poor boarduino is stuck on programmer duty.</p> <p>As far as I can tell this programmer holds down the reset button, and then transmits and receives on the MOSI and MISO pins. <s>I think the SCK is unused or at least unneeded.</s> <sup>(SCK is needed according to the ATtiny datasheet, my programmer doesn't work without it, and I can't find the place I thought I read it was not needed.)</sup></p> <p>Why do I need a hardware programmer to just transmit serial? I mean, let's suppose I am willing to hold down the reset button with my finger instead of using an IC. All that's left is serial send and receive, so all I need are three wires GND, RXD, and TXD. Heck, if I have the "DTR" line or whatever, you can even hold down the reset button with the serial cable.</p> <blockquote> <p>Why are there all these hardware solutions that <em>also</em> require fancy software (like AVRdude, or AVR studio, or whatever)?</p> </blockquote> <p>I mean I could understand a little USB cable that presented the microcontroller as a mass storage device and let you drag binary files over for programming (like <a href="http://www.microbuilder.eu/Projects/LPC1343ReferenceDesign.aspx">this ARM dev board</a>). Hardware only, using standard software drivers.</p> <p>I could also understand a software only solution (modulo hooking wires from the USB to the chip, using something like the FTDI chip to simplify what goes down the wires). All of the fancy programming protocol would be handled by software on the computer, and the hardware would just be some wires.</p> <p>Why do we have both (complicated) software and hardware involved? I mean, as far as I can tell, programming microcontrollers is pretty easy, but when I was just getting into this I was really worried about how I was going to ever buy a chip from mouser or digikey without paying some guru to program a bootloader for me.</p> <p>I'm sure there is a good reason (it's not like I've written the software or started manufacturing the drag-n-drop USB programmer), but as a newcomer, I have no idea what it is.</p>
Why do we need hardware programmers?
2010-09-30T04:54:57.253
4619
|stepper-motor|output|
<p>The simplest option I've come across seems to be the <a href="https://www.sparkfun.com/products/11343" rel="nofollow">IOIO-OTG</a>. It's a PIC-controller based external OTG USB device, designed for android, but usable with a PC, via Eclipse and the Android Development Toolkit. It has <a href="https://github.com/ytai/ioio/wiki/Getting-To-Know-The-IOIO-OTG-Board" rel="nofollow">46 3.3v GPIO pins</a>, as well as bunch of other useful stuff. It doesn't have the 64 pins necessary for your project, but you could just use a few serial to parallel shift registers, as mentioned by jluciani (or use stepper motor controllers instead, and use less pins).</p> <p>There is also this <a href="http://electronics-diy.com/store.php?sel=kits&amp;sub=USB_IO_Board" rel="nofollow">PIC-based USB IO board</a>, which does similar things, but has less pins.</p>
<p>I need a number of digital outputs to connect my computer to the real world, however it seems that this job is not nearly as easy as I had hoped.</p> <p>I've looked into a number of different methods, ranging from dedicated digital I/O cards, micro controllers with USB interfaces, serial ports, parallel ports, ect. However all of the solutions seem to be either too expensive, too much work, or the technology is too dated.</p> <p>I hope to have 64+ digital outputs running at approximately 1khz each, individually controllable. So far the best idea I can come up with is sticking the outputs of a serial port to an 8-bit serial to parallel shift register and sending chars down the serial connection whenever I wish to change and output (run from a USB to serial port adaptor). I haven't tested this yet so i don't know if it will work.</p> <p>Is there any other quick and dirty method of getting a fairly large number of inexpensive digital outputs from the computer of which I can easy control with very basic C++ commands?</p>
Easiest and cheapest way to get digital outputs from a computer to the real world
2010-09-30T05:09:10.720
4629
|power-supply|ups|
<p>I'm not an expert on this, but I think there's a device here you haven't mentioned: a <strong>power conditioner</strong>. These devices take power from the wall and pass it through filters to make a (fairly clean) output power signal. In some cases they also have automatic voltage regulation, and can boost/cut the power from the wall. In certain cases, they are also tailored to the applications they are used in. For example, APC makes a seperate lines of power conditioners and UPSes for home theater and computing, as they have different power usage profiles (home theaters tend to have high peak usage).</p> <p>I don't have any hard numbers on this, but if the power signal is out of spec or the PSU you are providing with that power signal is poorly designed, damage may occur to the device. Specifically what, I don't know, and others that know more will have to chime in.</p> <p>Some UPSes perform a power conditioning function, but most don't.</p>
<p>In datacenters it's common to use <a href="http://en.wikipedia.org/wiki/Uninterruptible_power_supply" rel="nofollow">Uninterruptible power supply (UPS)</a> to protect the computers. They are used for several reasons, but one is that electronics possibly can suffer from the power grid if the power isn't "filtered".</p> <p>Is it only the power supply unit of the computer that can suffer or can the computer parts also suffer? And how can they suffer? Does an <a href="http://en.wikipedia.org/wiki/Uninterruptible_power_supply" rel="nofollow">Uninterruptible power supply</a> work differently to an <a href="http://en.wikipedia.org/wiki/Power_supply_unit_%28computer%29" rel="nofollow">Power supply unit (PSU)</a> or is the PSU already protecting the computer parts from the power grid?</p>
How can computer parts suffer if the computer isn't protected by an UPS?
2010-09-30T09:58:56.777
4631
|pic|c|spi|pickit|
<p>It is likely that your problem is that after sending the first "A" you are not reading SPI1BUF back to clear whatever the SPI "read" back. Recall that SPI works like a shift register; for every bit you push out you get a bit in. If you do not read the contents of SPI1BUF then likely you get an overun, and per section 17.2.6 of the data sheet, the device stops working until you clear SPIROV</p>
<p>I am looking to get a SPI serial port running on a PIC32 (PIC32MX360F). can anyone point me to some good resources on how to do this so that a newbie can figure it out? I am using the PIC32 starter kit and have a PIC32 breakout board from Digi-Key.</p> <p>This is the code that I have been using... I found it in the PIC32 family manual.</p> <pre><code>#include &lt;p32xxxx.h&gt; int main(void){ int rData; IEC0CLR=0x03800000; // disable all interrupts SPI1CON = 0; // Stops and resets the SPI1. rData=SPI1BUF; // clears the receive buffer IFS0CLR=0x03800000; // clear any existing event IPC5CLR=0x1f000000; // clear the priority IPC5SET=0x0d000000; // Set IPL=3, Subpriority 1 IEC0SET=0x03800000; // Enable RX, TX and Error interrupts SPI1BRG=207; // use FPB/4 clock frequency SPI1STATCLR=0x40; // clear the Overflow SPI1CON=0x8220; // SPI ON, 8 bits transfer, SMP=1, Master mode // from now on, the device is ready to transmit and receive data SPI1BUF='A'; // transmit an A character while(1){ SPI1BUF= 'A'; // transmit an A character while(i &lt; 10000){i++;} i = 0; } } </code></pre> <p>How do I set the baudrate? I am guessing it got something to do with SPI1BRG</p> <p>EDIT:</p> <p>Thanks to tcrosley I feel that I am getting closer to being able to communicate with my pic32. I changed SPI1BRG to 207. By my calculations this will set the baudrate to around 9600.</p> <p>Fsck = Fpb/(2(SPIxBRG +1)) = 4MHZ/(2*(207+1))= 9615</p> <p>I am trying to view the output on the picchip with HyperTerminal. The settings I am using are: </p> <pre><code>Baud: 9600 Data bits: 8 Parity: None Stop bits: 1 Flow Control: None </code></pre> <p>The pins I am using are:</p> <pre><code>93 - connected to db9 3 95 - connected to db9 2 </code></pre> <p>and db9 5 is connected to the boards ground...</p> <p>I am now getting an output, which is nice, but unfortunately it is garbage. my output on HyperTerminal comes out as a bunch of hearts :S now I just feel like my pic32 is mocking me</p>
How to get a PIC32 SPI port working for transmitting data?
2010-09-30T11:37:15.727
4639
|power-supply|wireless|
<p>There is the WISP <a href="http://wisp.wikispaces.com/" rel="nofollow">http://wisp.wikispaces.com/</a> They use a large dipole and a cascaded rectifier to generate voltage. </p>
<p>I'm looking to power several small, Wi-Fi enabled sensors, in a domestic home or office environment. As such I'm interested in keeping them powered as long as possible between charges.</p> <p>Obviously an expensive Li-xx battery would be simple solution, but I've also been looking for more 'inspired' alternatives, such as <a href="http://www.micropelt.com/applications/energy_harvesting.php" rel="nofollow noreferrer">Micropelt thermogenerators</a>.</p> <p>What <strong>other alternatives</strong> are there that would provide a <em>decent amount</em> of power, in a small size? </p> <p>Alternative wireless networking ideas are welcome, but I'm keen to use WiFi - most homes have a WiFi network and enabled computer - I'd like to keep the extra equipment needed to an absolute minimum.</p> <p>[There is a <a href="https://electronics.stackexchange.com/questions/4323/alternative-energy-storage">related question</a>, about energy <em>storage</em>. My question is about generation and my needs are fairly specific (size, high power etc.]</p>
What are some alternative power sources for wireless sensors?
2010-09-30T13:38:53.987
4640
|motor|capacitor|remote-control|
<p>The other two people who have answered have the first part right: the small-value ceramic capacitor acts as a high frequency filter. The brushes create insane amounts of broad-spectrum high frequency noise and this can interfere with the electronics (especially the radio receiver). The capacitor acts as a short-circuit at high frequencies (Xc = 1/(2*pi*fC)) and it is soldered as close as possible to the commutator (i.e. right at the motor leads) to minimize the "antenna" these frequencies see. If the capacitor was not there the noise would "see" several inches of motor lead which would act as a great little antenna for broadcasting this noise into anything nearby, especially the sensitive radio receiver.</p> <p>It has nothing to do with smoothing over anything -- the capacitor is far too small to be effective as a temporary storage device. It's being used as a frequency-selective low-impedance shunt, a low-pass filter, if you will.</p>
<p>Every RC car I've cannibalized has had a small ceramic capacitor soldered on to the contacts of the motors. What is the purpose of having this? What happens to the performance of the motor with out this?</p>
Capacitors and motors
2010-09-30T13:42:09.260
4651
|equipment|multimeter|multimeter|
<p>I have a Fluke 88v...</p> <p>... bought as an 'as new' externally but with a dead main board off flea bay for next to nothing. I then sent it off to be repaired locally to new at Flukes Service Center at their flat repair rate of $185 AUD. No more to pay; new mo-board, yellow holster and display glass + calibration!</p> <p>Now I have a mint 88v with the latest rev. 11 edition EMI/RF safe mo-board installed. So you can get a near new Fluke at a reasonable price if you're smart about it.</p> <p>In Australia the standalone 88v retails for a rediculous $920 AUD! </p> <p>Mine for $185! !</p> <p>Picture below shows my Fluke DMM recording voltage ranges off my solar panel array powering my remote amateur radio shack...</p> <p><a href="https://i.stack.imgur.com/2AGr0.jpg" rel="nofollow noreferrer">PICTURE HERE: My Fluke 88V checking solar voltages</a></p>
<p>Well, the question is the title: Is it worth really buying a Fluke for hobbyist use?</p> <p>I have a cheap meter at the moment. Is it worth spending a 3 figure sum on a nice, shiny, new Fluke? I honestly don't think so, but I'm curious what other's opinions are.</p>
Is it worth really buying a Fluke for hobbyist use?
2010-09-30T15:01:34.597
4652
|usb|stepper-motor|
<p>I'd buy an Arduino and the Adafruit stepper shield.</p> <p><a href="http://www.adafruit.com/index.php?main_page=product_info&amp;products_id=81" rel="nofollow">http://www.adafruit.com/index.php?main_page=product_info&amp;products_id=81</a></p> <p>They have some great documentation:</p> <p><a href="http://www.ladyada.net/make/mshield/" rel="nofollow">http://www.ladyada.net/make/mshield/</a></p>
<p>I am a total newbie for electronics and hardware programming, but I would really like to start practicing it. As a first achievement, I would like to find a simple step motor and drive it through a simple USB connection. The easiest (less HW/less SW) is the way to achieve this, the better.</p> <p>What kind of hardware and software do I need ? How can I achieve this first step? Please consider as you are explaining it to a child. I really know nothing about this activity.</p>
Driving a stepper motor via USB and OSX
2010-09-30T15:55:24.177
4673
|555|
<p>As I understand it, the output simply will not go high until the trigger goes high. If the timer times out before the trigger goes high, you will no longer have a uniform pulse-width.</p> <p>This datasheet has a good description of the behavior: <a href="http://www.datasheetarchive.com/pdf-datasheets/Datasheets-25/DSA-494116.html">http://www.datasheetarchive.com/pdf-datasheets/Datasheets-25/DSA-494116.html</a></p>
<p>A number > 0 of 555 timer tutorials warn against holding the trigger of a 555 timer in monostable configuration low for longer than the duration of the output pulse. Why not?</p>
What's wrong with giving a really long low pulse to a 555 timer?
2010-10-01T02:31:33.503
4677
|power|motor|
<p>So you want to rotate a motor at nearly three times its rated speed. Depending on how well the motor is built, it will fail immediately or later. </p> <p>Then you build a 200W recitifier. This is the standard Diode Bridge, condensator setup. </p> <p>And a 200W Pulse width sine generator. The tools for that are listed on Atmels AVR site. They have example code to do just that. You should be able to glean the code from some of the examples on </p> <p><a href="http://www.atmel.com/dyn/products/app_notes.asp?family_id=607#Application_Example_and_Algorithms" rel="nofollow">http://www.atmel.com/dyn/products/app_notes.asp?family_id=607#Application_Example_and_Algorithms</a></p> <p>Wouldnt it be cheaper to get a faster motor in the first place?</p>
<p>I need to speed control small ( 0.25 HP ) 3 phase 2800 rpm motor to achieve speed in the range of 6000-7000 rpm. I know basic stuffs. ( have created soft starter etc ... which is good enough for achieving slower speed than rated speed...) but How would I increase speed ? another problem is, I have 1 phase input. </p> <p>I can work out the micro controller ( mostly AVR and ARM ) stuff but have no idea about power electronics </p> <p>I have read to use pwm to create sine wave form which in turn can be smooth out by motor coil itself. I can generate the frequency and wave forms in microcontroller. </p> <p>1) How do I create DC from 1 phase AC that can be good enough for 0.25 HP 3 phase motor. ( for at least 10 hour continuous running. ) 2) What do I need to convert my pwm waveform to actual ac using dc source. I know theory, but I am concerned about chip selection and detail circuitry. </p>
3 phase ac induction motor speed control
2010-10-01T04:43:49.987
4678
|soldering|surface-mount|components|tools|
<p>If building in any quantity, we use a pick and place machine. Or have your CM (Contract Manufacturer) use one. There are even CM's that do short runs.</p>
<p>Possibly many questions have been asked on soldering smd parts, but I haven't found specific answers, Like:</p> <ol> <li><p>Do you use a watchmakers lens or some other type of magnifying glass while soldering these miniature components? What would be most optimum to see a larger picture?</p></li> <li><p>How do you solder components where pads lie beneath the package, I don't own a reflow oven and have tried to ignore these packages but can't do that anymore. Are there any techniques to manually solder BGA, iLCC, CSP amongst others.</p></li> <li><p>What tools do you use, apart from tweezers, soldering iron, solder wire, and a bright/ illuminated workplace. Any suitable "third hand" that you have found that makes a monster of a difference?</p></li> <li><p>Is there a specific tip thickness to use for the soldering iron, what about the solder wire guage?</p></li> <li><p>For prototyping if would not always be feasible to make a pcb, do you solder these components on a veroboard or do you buy a breakout board?</p></li> </ol> <p>You could add more to these based on your experience and wisdom...</p> <p>Your turn.</p>
What tools, equipment, and techniques do you use to solder fine-pitch SMT parts?
2010-10-01T04:52:46.573