Show Posts
Pages: [1] 2 3 ... 370
1  Using Arduino / Microcontrollers / Re: Programming a standalone ATMega328P with Arduino C` on: Today at 11:05:40 am
When you mean Arduino C do you mean:
Code:
  digitalWrite(led, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);               // wait for a second
  digitalWrite(led, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);               // wait for a second

Yes.

2  Using Arduino / General Electronics / Re: IRF520 MOSFET on a breakout board: Is 5V from the arduino enough for "Full on"? on: Today at 08:54:14 am
Are the logic level mossies that much more expensive?

A $0.20 BJT will probably do most jobs that people are using $2.00 MOSFETs for.

3  Using Arduino / General Electronics / Re: IRF520 MOSFET on a breakout board: Is 5V from the arduino enough for "Full on"? on: Today at 06:58:34 am
EDIT:
Looking more into it, I've realized that even though the IRF520 is not ideal, it will still let me draw up to 3 Amps.
That should be more than enough for most of the small disasters I'm building.

If you look closer at figure 3 you'll see they had to apply 50V to get that current through it and they only did it for 20us.

The reason they only did it for 20us is that 50V @ 3A is 150 Watts of heat.  ie. It will catch fire if you do it.
4  Using Arduino / General Electronics / Re: IRF520 MOSFET on a breakout board: Is 5V from the arduino enough for "Full on"? on: Today at 06:26:46 am
No.

The clue is in the name "IRF", you need something that starts with "IRL" - the 'L' stands "for logic-level".
5  Using Arduino / Microcontrollers / Re: Using an ATtiny85 as SPI Slave on: Today at 04:18:00 am
Maybe you are right - I2C is better.

"Better" is the wrong word. It depends on the situation.

To me it seems preferable for an ATtiny85 slave - it uses less pins and has flow control to avoid timing problems.

But being a more "complete" protocol, I've seen it "harder to implement". There are some libraries out there...

I won't disagree.

(As for libraries, I don't think I've seen one which does a correct implementation of I2C...)
6  Using Arduino / General Electronics / Re: 5V External Supply on: August 31, 2014, 02:32:39 pm
Get a 5V booster and run it off 2 or 3 AA batteries: http://www.ebay.com/sch/i.html?_nkw=5v+dc+boost+pfm

7  Using Arduino / General Electronics / Re: Making the jump from USB Power to External on: August 31, 2014, 02:31:00 pm
A LM7805 voltage regulator will do it  for about $0.30.

Or...if you want to do it efficiently use a switching regulator

Or...just get a 5V power supply.
8  Using Arduino / General Electronics / Re: Arduino gets restart when operating 12V Solid State Relay on: August 31, 2014, 10:54:57 am
Take the advice you were given.  Use any pin other than 0 or 1, then come back and tell us what happens.

Then we will explain why it was resetting.   smiley-grin

Why would pin 1 reset anything?

It's perfectly usable so long as it doesn't put any load on the pin while you're trying to upload sketches (use it for push buttons, rotary encoders, etc. where there's normally no connection)


9  Using Arduino / General Electronics / Re: Arduino gets restart when operating 12V Solid State Relay on: August 31, 2014, 10:52:28 am
But glad I hadn't missed a trick and that flyback diodes were actually required on SSRs. I have been paying attention these last couple of years....

Nope.

SSRs have no inductance so no diode needed.
10  Using Arduino / General Electronics / Re: how are they called? on: August 31, 2014, 10:48:44 am
Right angle header strip

Female pin header
11  Using Arduino / Microcontrollers / Re: Programming a standalone ATMega328P with Arduino C` on: August 31, 2014, 09:06:07 am
I have a doubt. I want to know whether programming a standalone Arduino Bootloader loaded ATMega328P with Arduino C language instead of the standard C language would work.

Yes.

I also want to know how to use that programmer. Should I just fit in my ATMega328P into the Microcontroller slot you see in the picture on Ebay (The site is in the above link).

No, it goes on the end of the grey cable.
12  Using Arduino / General Electronics / Re: PIR sensors People Vs animals? on: August 31, 2014, 04:06:34 am
The cat was on the desk?


Where else would it be?
13  Using Arduino / Microcontrollers / Re: Using an ATtiny85 as SPI Slave on: August 30, 2014, 10:46:19 am
Is I2C actually that different?

Yes. I2C is a much more complete protocol than SPI.

eg. An I2C slave can hold the SCL line low when it detects a start condition. This puts the master "on hold" until SCL is released. The Tiny85 has a hardware latch for this so the software response time is never an issue, it can take as long as it needs (within reason) to respond to the start condition, set up the USI to receive the data, then release the master to send the data bits.

I think the start-condition detector can even wake up the chip from sleep mode. You can be sleeping and still respond to I2C transmissions.

(See bits 4+5 of the USICR register for details).


I2C has other problems, and is generally run slower than SPI,

"generally".

You don't have to go at 100kHz if you know you're talking to a Tiny85 @ 8MHz. The Tiny85 hardware will work much faster than that.

A limitation of i2c is the number of addresses

Needing a separate slave select pin for every SPI device seems like a bigger limitation to me.

14  Using Arduino / Microcontrollers / Re: Using an ATtiny85 as SPI Slave on: August 30, 2014, 04:25:58 am
REMARK 1: In ATTiny85, Pin change interrupts are fired quite slowly. If you don't wait for it to be triggered, since USI is not initialized properly, you get weird shifts in sent and received data - since the USI buffers get mangled. This is the "command delay time"

REMARK 2: Once you sent the command, ATTiny makes some if-switch etc. checks and prepares the data necessary and puts it into the USIDR. IF you don't wait here, you start reading USIDR before ATTiny starts putting something into, which makes your response shifted -- causing you to read wrong data. This is "command acknowledge time"

REMARK 3: Consequtive readings, despite being relatively less, are still making some checks, so we must wait them. I've seen 4 microseconds is good enough, but 5 microseconds is even better. This is "command pulse time"

I think those delays are due to the Tiny processing interrupts and firing times. I've tried my best to avoid them, but I couldn't do it -- everytime i removed them, the data I received started to get weird. I guess when I'm using this chip, I'll use it this way.

At one point, at Tiny85 side, I was using "digitalRead" etc in ISR and the  "command delay time" required to be 15 microSeconds minimum or I couldn't communicate at all! It's why I've refrained from using "digitalRead-pinMode" etc. functions. They are quite slow compared to the Memory Mapped I/O.

So, please examine and give feedback. I've tried to write a general Master/Slave library like code, but didn't test the "Master" functionality at all, so be advised.

I think you're barking up the wrong tree.

The I2C protocol is designed to avoid all of those problems, and it uses less pins than SPI (which is important on a Tiny85).

15  Using Arduino / LEDs and Multiplexing / Re: Looking for a good tutorial on using LM3914 with LED bar and an Arduino on: August 30, 2014, 04:16:27 am
I am trying to understand how the LM3914 works and how to wire it. I understand some of it, but not enough to use it right.

Which bits do you understand? What have you done so far?
Pages: [1] 2 3 ... 370