Show Posts
Pages: 1 ... 231 232 [233] 234 235 ... 779
3481  Using Arduino / Programming Questions / Re: Arduino 022 - Errors with current avr library. on: November 17, 2013, 07:55:58 am
The most important change from 0022 to 1.0.x is for the
includes, you need to change

Code:
#include "WProgram.h"

to

Code:
#if defined(ARDUINO) && ARDUINO >= 100
  #include "Arduino.h"
#else
  #include "WProgram.h"
#endif

There are a few other changes but this needs to be done first.
3482  Using Arduino / Programming Questions / Re: VirtualWire wrapper around send function on: November 16, 2013, 09:10:41 am
You can't (easily) do pointer arithmetic on references so they are safer to work with.  Most
bugs in C programs are due to erroneous pointer arithmetic and lack of array bounds
checks I think.
3483  Using Arduino / Displays / Re: Alternative to the UTFT and UTouch libraries? on: November 16, 2013, 09:07:16 am
How much of the space is due to the font?
3484  Using Arduino / Displays / Re: 4.3" TFT LCD Touch Screen and Arduino Mega on: November 16, 2013, 09:05:10 am
There is more than one SD library to experiment with, but first check all the signals are
intact and at 3.3V level.  These TFT/SD modules never seem to have level-shifting on the
SDcard.
3485  Using Arduino / Displays / Re: Need some help with TFT display. on: November 16, 2013, 09:03:13 am
I'd advise against buying any TFT that doesn't come with full information on the
interface, life is too short.  Knowing its a SSD1289 chip isn't enough as that can
be configured for at least 6 types of interface, 8,9,16 or 18 bit parallel and 3 or 4
wire serial.  You also need to know for sure if the logic signals are 5V or 3.3V...

For ease of interfacing I'd strongly recommend the serial type for Arduino - parallel
can be driven faster but for a small screen its not such a problem and 8 bit parallel
needs 13 wires to drive (8 bit data, nCS, nRESET, D/C, nWR, nRD).  Using the hardware
SPI on an Arduino at full speed to drive a serial TFT is pretty fast.
3486  Using Arduino / Motors, Mechanics, and Power / Re: Driving multiple mosfets from one output on: November 16, 2013, 08:15:28 am
When you parallel MOSFETs you need enough gate resistance on each to
stop differential oscillation.  For two MOSFETs use a 330 ohm resistor on each
gate (limiting total current on the pin).  The larger the gate capacitance the
more important such current limiting resistors become - those MOSFETs have
about 6nF effective gate capacitance (28nC charge for 5V drive) which is more
than a logic signal is normally expected to drive directly.

If you want fast PWM you'll probably need a MOSFET driver chip to keep
switching losses managable.
3487  Using Arduino / General Electronics / Re: How to do voltage referencing? on: November 16, 2013, 08:06:40 am
The only way to have a switchable AREF of 5 or 3.3V is to actually switch the AREF
pin between 5V and 3.3V.

This could be done with an analog switch chip under program control, or a couple of
logic-level(*) p-channel FETs (drain to AREF, sources to 3.3V and 5V.

An analog SPDT switch is safer as you don't risk shorting the 5V and 3.3V rails together.

(*) one would need to turn on with Vgs=-3.3V

You could simply live with a reference voltage of 5V and lose some precision for
the 3.3V signal.
3488  Using Arduino / Programming Questions / Re: Adafruit JPEG Snapshot sample coding on: November 16, 2013, 08:01:15 am
So how are we to know which print statements you removed?  Try posting both the
working and non-working sketches in full so the difference can be seen...
3489  Using Arduino / Programming Questions / Re: New B in desperate need of guidence on: November 16, 2013, 07:58:52 am
The way to get a good life out of the EEPROM is to only write if the
value has changed, and a certain amount of time has elapsed since the
last write.

Even so you have 100,000 writes before unreliability may be an issue...

You need to read the EEPROM once in setup() and detect if the value hasn't
yet been written (it will read as 0xFF if never written to).  If it has been
written to, initialize the active LED number from it.

You need a blinkWithoutDelay style test every 10 seconds or so that compares
the current value in EEPROM with the current LED number - only if different
should you re-write the EEPROM.   This has the problem that if you power-down
within 10 seconds of the last button press changes are lost, but you get more
button presses before the EEPROM wears out.

Alternatively you can write the EEPROM every time the button is pressed, but
you'll get a shorter life.  The nominal life is 100,000 writes but you might get a lot
longer than that.

Other more sophisticated approaches use some form of wear-levelling to spread
the writes between several locations in the EEPROM, but the reading at start-up
is more involved.
3490  Using Arduino / Programming Questions / Re: while loops cause crash when inside if statement in IntervalTimer interrupt on: November 15, 2013, 09:35:58 pm
This test is wrong:
Code:
  start2=start1+ps1_pulsesize;
  while (micros()<start2) {}   // wait 50ms
you always need to test the difference of two time values to avoid wrap-around issues:
Code:
  while (micros() - start1 < ps1_pulsesize) {}   // wait 50ms
The subtraction is essential to the test working.  Since time values are usually
unsigned long, you cannot test for negative differences either, since the difference
will inherit unsigned-ness.
3491  Using Arduino / General Electronics / Re: Can anyone explain how current discharging into the air works? on: November 15, 2013, 09:30:41 pm
The breakdown field strength for dry air is, IIRC 3MV/m.  In practice sharp points allow
even a few hundred volts to create field-strengths exceeding that, and certainly by 1kV
you have to avoid sharp points or you just get strong corona discharge around them.

Corona discharge is the principal mechanism for low current flow into air, the high
electric field strength causes local breakdown in the air and the ions move towards the
point or away depending on sign.   Its commonly seen when removing nylon clothing in
the dark when static build-up discharges.

Higher powers available lead to actual sparks which have a well defined channel of
ionized air that carries a far higher current density (heating the air enough to make it
a blue-white hot plasma (10 to 20kK or thereabouts I think).  By comparison corona
discharge is a much colder phenomenon, giving off very faint light (recombination of ion pairs?).

The behaviour of DC and high-frequency AC discharges is rather different, but its
still ionised air molecules and free electrons as charge carriers. 
3492  Using Arduino / General Electronics / Re: How to determine what brand of mosfet and its rating? on: November 15, 2013, 09:18:05 pm
Someone might recognise the layout of the markings - there's some detail still visible but not
much.   The only other recourse is etch off the epoxy with conc. nitric acid and read
any partnumbers on the metalization of the chip itself (not a serious suggestion).

Its possible to measure on resistance if you have a constant current supply and a multimeter,
but breakdown voltages not so simple.  A capacitance meter could measure the gate-source
and gate-drain capacitances perhaps?

If you are looking to replace this device you are probably better off looking at the circuit
it came from to determine max voltage, gate drive voltage, and estimate the max thermal
dissipation.
3493  Using Arduino / General Electronics / Re: Analog multiplexer on: November 15, 2013, 09:06:21 pm

I have been looking into the TI CD74HC4067 analog multiplexer, and I am wondering about a few things:
1) Correct me if I am wrong. The chip does not need any external components (no external resistor/capacitor/etc required)
All logic chips require decoupling, this is no exception.
Quote
2) Looks like the switching delay is 15ns. Does it  mean I basically do digitalWrite() four times to set my desired channel and then I can instantly request data from my external ADC without using delay()?
The switching delay is 50ns.  The propagation delay is 15ns (propagation of an analog signal through the transmission gates once switching has settled down).  50ns is faster than digitalWrite() takes to run by a factor of dozens - delays should not be needed
Quote
3) For an analog MUX, if I am to feed 3.2748V into the input, do I get exactly 3.2748V at the output? If not, where do I look up the dropout voltage in the datasheet? I couldn't find it for some reason.
The 'input' and 'output' are connected by the on-resistance of the transmission gates, which
is not zero.  So if any current flows there will be IR voltage drop.  They are not "input" and
"output", there is no implied direction of signal or current flow, its just like a switch with
a highish resistance (so long as the signal stays between the supply rails).  Google "CMOS transmission gate"

[BTW your diagram link is broken (a redirect?).  Your 1m long analog signal path had better be
screened cable]
3494  Using Arduino / Motors, Mechanics, and Power / Re: Motor project on: November 15, 2013, 09:31:32 am
If you've never used a servo before they come with a 3-pin connector, ground, power, signal
(usually black/red/white).  You only need to connect gound and signal unless you are
intending to power the Arduino via the BEC in the ESC (usually an ESC has a 1A or 2A BEC).

If you don't know what these acronyms mean, use Google/wikipedia, there's good info around.
3495  Using Arduino / Motors, Mechanics, and Power / Re: Pololu VNH5019 + Uno - only one motor working on: November 15, 2013, 09:27:43 am
You are in the position of having a known working and know failing circuit to compare.

So you should proceed by seeing whether any of the control pins for the two channels
disagree - that would be a clue as to where the problem is.

If all the control inputs to the driver board match between channels that suggests a problem
with the board (you've already swapped motors so the issue isn't there).  So out with the
multimeter and check each pin (perhaps write a test sketch that drives both channels the same)

Its always worth a close visual inspection for shorts or "dry" solder joints or other
manufacturing defects too - again there are two channels to compare so things are
made easy.
Pages: 1 ... 231 232 [233] 234 235 ... 779