|
UserNotFound posted:Actually, what you should look into is to is use a 555 timer to blink the lights very quickly. 99% of LED lights do this to save power. You could also use pulse width modulation to vary the intensity if you wanted. I don't know how useful it would be for a bike headlight, but hey, it's there if you want it! vv
|
# ¿ Apr 2, 2008 14:31 |
|
|
# ¿ Apr 25, 2024 18:19 |
|
TwystNeko posted:Okay, I've just gone through this thread, and I've got a couple of possibly stupid questions. In-circuit serial programming allows you to program your target circuit without taking the microcontroller itself out of the circuit. You'll need an ICSP compatible programmer (such as a PICKit2), a PIC (duh), and some resistors. Take a look at this picture: This picture in particular refers to the PICKit2 programmer, but the basics apply to all the Microchip ICSP programmers. You connect the two ICSP pins directlyto the proper device pins, and you connect the VPP pin from the programmer to the ~MCLR pin. You also connect the programmer to your circuit's Vdd/vss. The extra circuitry is necessary for two reasons: to hold ~MCLR high during normal use (it's an active low reset) and to isolate the programmer from your Vdd/vss. During programming, the programmer drives ~MCLR to +12V so the diode prevents the programmer from adversely affecting your power supply. As you can see from the picture, you can also use a 470 ohm resistor instead of a schottky diode. For all my PIC projects I've used a resistor in this capacity and it's worked fine. You could try it with the normal diode--schottky diodes are essentially normal diodes with faster switching times as far as I know--but it might not work. Also, I suppose things might explode or something. As for your second question, I don't have much experience with using batteries to power microcontrollers so I'll let someone else answer that one. My guess is that you'd be fine depending on how much current you're drawing to power those LEDs.
|
# ¿ Apr 4, 2008 06:46 |
|
Delivery McGee posted:Also, how do you tell which end of the resistor to start from when reading the code? None of the ones I've ripped out of various broken devices seem to have any way of telling -- all the stripes are the same distance apart and from the ends. Resistor codes always end with a tolerance band which specifies the precision of the resistor's indicated value. It could be gold (+-5%), silver (+-10%), red (+-2%), or brown (+-1%). In practice I've only ever seen resistors with gold or silver tolerances, in which case you always read it starting on the side that opposite the gold/silver tolerance band. Now, if your tolerance was red or brown you'd still start on the opposite side of that, but if your resistor value began with the same color as well, then I have no clue how you'd tell just by looking at the bands.
|
# ¿ Apr 6, 2008 16:54 |
|
Blackhawk posted:I need some help with interfacing 5V sensors to 3.3V circuits. I'm trying to interface a 5V analogue output (0-5V) pressure transducer to a 3.3V datalogger and I want to do it with as little error as possible. The simplest way would probably be using 2 resistors as a voltage divider to drop the 0-5V signal to 0-3.3V however I'm worried about the error inherent with this method and there's probably much better ways to do it. So the pressure transducer has a single analog output? If that's the case, you're going to need a analog-to-digital converter (ADC or A/D) of some sort. The ADC will have a reference voltage you can set, so the 5V-3.3V interface shouldn't be a problem. There's lots of ways to build ADCs, but if you're that concerned about accuracy/precision, you should probably just get a single-chip type thing (try https://www.analog.com). Your maximum precision will be limited by how wide the input bus on your data logger is--you can't do any better than +-1/2 * LSB (least-significant bit). Basically, the ADC maps an analog value to a finite number of digital values, which results in the values being quantized. You can calculate the precision by determining how big of a change is necessary in the analog value to affect the digital value. To calculate that is actually pretty simple--we take the range of analog values, (5V - 0V) = 5V, and divide it by the total range of digital values, 2^width. The quantization error is then +-1/2 of the resulting value for reasons I'm forgetting. +-1/2 * (VrefH - VrefL) / (2 ^ width) For instance, supposed you use an 8-bit bus, then your maximum theoretical precision would be: +-1/2 * 5V / (256) = +- 9.766 mV Pretty reasonable. Note that the more bits you use, the better your precision. You will also need to consider your sampling rate when deciding on an ADC--how fast do you want to record values from the transducer? Also, what are you using as your data logger? Is it something that was pre-built or could you describe the internals? edit: beaten, but my post has MATH Fifty-Nine fucked around with this message at 16:54 on Apr 19, 2008 |
# ¿ Apr 19, 2008 16:38 |
|
Cross_ posted:Since you mentioned FPGAs, I almost picked up one of these boards last year: I've got one of these, as well as an Altera DE2-70. For a beginner, I can't recommend the Spartan kit enough. The user manual is very well-written--it's practically a tutorial for how to use the peripherals on the board. You'll have to get a working knowledge of Verilog/VHDL first, but once you do you can do alot with this board. To add fuel to the Verilog/VHDL fire, I've been programming heavily in VHDL for the past two years or so, and I absolutely hate it. I can get things done and it works fine, but it's just so goddamn verbose. On the other hand, I like Verilog, but there's one thing I still haven't figured out. From what I understand, it's based on C, no? Why on earth did they choose to use begin/end instead of curly braces? Could they think of no other way to implement the concatenate and repeat operators or something?
|
# ¿ Feb 27, 2009 17:50 |
|
|
# ¿ Apr 25, 2024 18:19 |
|
I would have assumed the synthesizer would figure this out automatically, but perhaps you could run the output of the ibufds through a global clock buffer (bufg)? I'm looking at some code I worked with recently that used an LVDS clock for RocketIO, and it looks like it does ibufds->bufg->pll_adv to generate the clock. Here's the code, for reference: http://code.google.com/p/infinibandfpga/source/browse/trunk/Physical/RocketIO_Wrapper.vhd. REFCLK_P and REFCLK_N are the differential clocks.
|
# ¿ May 3, 2009 18:10 |