Show Posts
Pages: 1 ... 51 52 [53] 54 55 ... 115
781  Using Arduino / Programming Questions / Re: Help with bytes, ints, longs on: January 26, 2013, 11:47:14 am
Yup, AVRs use Little Endian, which means the following array:

{0,0,1,68}

when converted to a long becomes:

68*256^3 + 1*256^2 + 0*256^1 + 0*256^0 = 1140916224

Little endian means that the least significant byte is placed at the lowest memory address (leftmost in the array initialiser)
782  Using Arduino / Microcontrollers / Re: List of arduino compatible microcontrollers on: January 26, 2013, 09:16:42 am
Further supported mega chips:
Mega1280
Mega1284/644/324
Mega8
Mega88/168


Along with the Tiny chips you have listed, the following should work:
Tiny87/167 [I'm about to add support to my tiny core for these as I will be using them in a project]
Tiny861/461
Tiny88/48
Tiny24
Tiny25
783  Using Arduino / Microcontrollers / Re: ATTiny85 Programming Woes on: January 22, 2013, 06:18:46 pm
No harm done. We've all been there and done that at some point or other. If you never make mistakes, you can never learn, that's my motto smiley.
784  Using Arduino / Microcontrollers / Re: ATTiny85 Programming Woes on: January 21, 2013, 03:40:34 pm
If you have a multimeter or continuity tester, I would use it to make sure that the pins on the attiny are properly contacting with the adaptor you are using.
785  Using Arduino / General Electronics / Re: Difference between Arduino 5V power and output of 7805 5V power on: January 20, 2013, 11:19:45 am
Be very careful using a potentiometer to control the LED, if you turn it too far you can end up having much less resistance in series with the LED as you think = BANG.

Also know that the 10k pot may not be linear. If for example it is a log pot, then half way is not necessarily 5k, in fact it is usually only around 1k.
786  Using Arduino / General Electronics / Re: Difference between Arduino 5V power and output of 7805 5V power on: January 20, 2013, 10:58:09 am
I see no reason why that circuit shouldn't work.

I can only suggest going back and double checking your connections. I have attached a schematic to help.

Note that the + terminal of the supply goes to the Input pin of the 7805, and the - terminal goes to the GND pin.
787  Using Arduino / General Electronics / Re: Difference between Arduino 5V power and output of 7805 5V power on: January 20, 2013, 08:08:52 am
You are going to have to post a diagram of how you wired everything up.

Also, when calculating the resistor for an LED, Vr=Vs-Vf where Vf=forward voltage of an LED, Vr = voltage across resistor, Vs=supply voltage.
A standard Red LED has If=20mA (forward current), Vf = 2.1v(forward voltage).


So how much voltage is across the resistor? (Hint: think of it like a staircase, the supply lets you walk up 5 steps, then the LED forces you down 2.1 steps, so how high are you?)
The resistor needs to have 2.9 volts across it to get you back down to the bottom of the staircase.

Its a series circuit, so all current that flows through the LED must flow through the resistor, meaning that there must be 20mA flowing through the resistor if you want 20mA to flow through the LED.

So using V=IR, you get 2.9 = 20mA * R => R = 2.9/0.02 = 145R. You will notice that there are some standard values for resistors, so the minimum standard value you would want is 150R.
You will find that an LED can run quite happily at a lower current, so you can use a larger resistor if you want, the LED just won't be as bright, but its working life will be extended.

For example, at 270R, you would have I = V/R = 2.9/270 = 10.7mA flowing through the LED.
788  Using Arduino / LEDs and Multiplexing / Re: RGB SMT LED Cube, resistors, drivers, and shift registers. on: January 18, 2013, 06:36:24 pm
I understand that I want a fet with low RDS, typically measured in millionths of an ohm
I think that is mOhm, or milliohms, i.e. thousandths of an ohm.


These are what I chose for my 12x12x12 cube. I ended up with 72 of them, and each one supplies 2 rows of 12 RGB LEDs, totalling 24*3=72 diodes per transistor = 1.44A peak current.

http://uk.farnell.com/nxp/nx2301p/mosfet-p-ch-20v-2a-sot23/dp/1894738?Ntt=1894738
I chose them for (a) price, (b) size, and (c) they are rated at 2A drain current at a Vgs of -4.5V making them suitable for 5v logic levels.

Ideally one with a slightly lower on resistance (these are 0.1Ohm at -4.5V) would be better, but these were a good price and I only lose 0.144v which would have been lost over the PWM constant current sources I have wired to the Cathodes. In my case theThe power lost is 1.44^2 * 0.1 = 200mW, which is well withing the power dissipation the transistor can support.
789  Using Arduino / General Electronics / Re: Arduino MEGA on another PCB on: January 18, 2013, 07:22:47 am
Ok, yeah, thats one of the annoying things about eagle.

There is a way around it though. If you select the mega footprint with the move tool, then while it is following the mouse, there is a button on the toolbar at the top which looks like a grid of 4 squares, the two on the left are shaded and there is a line down the middle. If you click that it will mirror the footprint and you can then place it down within the board outline.
790  Using Arduino / General Electronics / Re: Arduino MEGA on another PCB on: January 17, 2013, 06:57:57 am
The outline has the pin headers on it aswell, correct?

If so, place it on the board, and then use the MIRROR command to flip it onto the bottom layer. This will simulate the mega board being upside down. As the pin headers are through hole, you can simply mount the header on the top of the board.
791  Using Arduino / General Electronics / Re: Arduino MEGA on another PCB on: January 17, 2013, 04:29:30 am
Google 'Sparkfun Eagle Library', its on github and the outline and pin positions of a mega are in that library.

Edit: https://github.com/sparkfun/SparkFun-Eagle-Libraries
792  Using Arduino / Programming Questions / Re: SOftware RESET for arduino Demilanove on: January 17, 2013, 04:25:49 am
That was just an example. You would call the systemReset() function at any point in the program you want. Wrap it in an if statement, for example:

Code:
#define someIO 2
void setup()
{
  // This code will only run once, after each powerup or reset of board
  pinMode(10,OUTPUT);
  digitalWrite(10,LOW);
  digitalWrite(someIO,HIGH); //enable pullup-resistor
  pinMode(someIO,OUTPUT); //THEN set to output, by doing so, pin is already high when switching to output meaning reset is not tripped.

  Serial.begin(115200);
}

void systemReset(void){
  digitalWrite(someIO,LOW);
  while(1);
}

void loop()
{
  static unsigned long nextMillis = millis() + 1000;
  // This code loops consecutively
  if (millis() > nextMillis){
    digitalWrite(10,!digitalRead(10));
    nextMillis += 1000;
  }
  if (Serial.available() && (Serial.read() == 'K')){
     systemReset(); //reset only when you send the uppercase letter 'K' (for kill?) through the serial port
  }
}
793  Using Arduino / Programming Questions / Re: SOftware RESET for arduino Demilanove on: January 16, 2013, 11:49:23 am
Hmm, its roughly half of the MAX reset period (1us). If you use a diode rather than a wire then the delay becomes 300x the reset period required (800us) - Cathode to digital pin, Anode to reset pin.
794  Using Arduino / Programming Questions / Re: SOftware RESET for arduino Demilanove on: January 16, 2013, 11:30:07 am
It works because there is more in the circuit that just an I/O pin connected from an output to the reset pin.

Consider that there is also the "Auto-Reset" 100nF capacitor connected between the pin and GND (or +5v depending on how the DTR pin of the USB-Serial chip is set).

When the I/O pin goes low, it discharges (or charges if DTR=5v) that capcitor rapidly down to around 0v with respect to the GND at the reset pin end. When the chip then puts the I/O pins into a High-Z state, the 10k pullup has to charge (or discharge) that capacitor back up to +5v at the reset pin end which takes some time - sufficient time to reset the chip. If it wasn't sufficient time, the autoreset function itself wouldn't work.
795  Using Arduino / Programming Questions / Re: SOftware RESET for arduino Demilanove on: January 16, 2013, 11:09:08 am
regarding point (2). I have used this method in several projects and it works fine from what I have seen.

Try this out:
Code:
#define someIO 2
void setup()
{
  // This code will only run once, after each powerup or reset of board
  pinMode(10,OUTPUT);
  digitalWrite(10,LOW);
  digitalWrite(someIO,HIGH); //enable pullup-resistor
  pinMode(someIO,OUTPUT); //THEN set to output, by doing so, pin is already high when switching to output meaning reset is not tripped.
}

void systemReset(void){
  digitalWrite(someIO,LOW);
  while(1);
}

void loop()
{
  // This code loops consecutively
  delay(1000);
  digitalWrite(10,HIGH);
  delay(1000);
  systemReset();
}

you will see an LED connected to pin10 blink on for a second then go off for a second (and the bootloader LED flashes in between). (This assumes pin 2 is connected to the reset pin).
Pages: 1 ... 51 52 [53] 54 55 ... 115