Show Posts
Pages: 1 [2] 3 4 ... 15
16  Using Arduino / Microcontrollers / Problem uploading code with Optiboot on: December 22, 2013, 07:11:40 am
My current project uses an atmega328 and will need to have updated firmware uploaded though the serial port. I figured optiboot should work fine for this, so I modified the optiboot source for an atmega328 at 8 MHz and 2400 baud (just for testing). I made an rs232 to TTL serial converter with transistors and verified that I got clean edges, burned the bootloader with an AVR dragon, and used avrdude with "-c arduino -p m328 -P COM1 -b 2400 -F -v -U ........" to upload the code.
The first thing that went wrong is that the chip was recognized as an atmega328P (device signature 0x1e950f), whereas I'm using an atmega328; I probably missed something while modifying optiboot, but the chips are virtually identical so added '-F" to avrdude. After that everything went fine, but as soon as avrdude started verifying the code I got a verification error, " first mismatch at byte 0x0002 0x35 != 0x34", I tried another hex file and got a mismatch at 0x0000. Both of these upload fine with any other programmer.
I've tried baud rates from 625 up to 115200 (below 2400 doesn't work at all) and I get the same exact error, so I don't think this is caused by the internal oscillator being off. I even manually set UBBR0 (the baud rate register) in optiboot to get as close to 2400 baud as I could. I've even tried uploading to an atmega328P and I get the same problems. Do you guys have any idea what could be causing these verification errors?
17  Using Arduino / General Electronics / Re: help regulating voltage on: September 19, 2013, 11:35:58 am
Do you really only have .1 uf on tbe input of the 317? You're going to need a lot more if it's coming directly from a bridge rectifier.
18  Using Arduino / General Electronics / Re: Automotive relays diodes shorting? on: July 20, 2013, 11:09:17 am
a 12 volt coil overheats on 12 volts? Somethings gone dicky here. I see your not sure about it being a 12 volt relay. I'd recommend using 9v instead. Anything above the pull-in voltage should work.
19  Using Arduino / General Electronics / Re: Are MOSFETs really this good? on: July 20, 2013, 10:48:10 am
I've never understood the logic in using N-channel FETs on the high side of the h-bridge. If I'm using a 12v supply and I want to get 12v Vgs on the high side FETs for low resistance, wouldn't I need 24v relative to ground since the source would be at 12v when the motor is on?
20  Using Arduino / General Electronics / Re: Are MOSFETs really this good? on: July 20, 2013, 04:31:47 am
Yea, I'm on the fence between making my own driver and using a real stepper driver, but I'm ordering components off Digikey and they don't seem to have any cheap stepper motor drivers. I was also a bit concerned about the fact that those MOSFETs were only rated for 12v Vgs, so I think I'll look for some other ones. And I guess I won't be using external diodes. That's also a good idea about using the MOSFET as the flyback diode, maybe I'll try that. Thanks for all the info.
21  Using Arduino / General Electronics / Are MOSFETs really this good? on: July 20, 2013, 12:11:49 am
I've been looking for MOSFETs to build a couple h-bridges for stepper motors (rated at 0.3A), and I'm really surprised at how tiny of a MOSFET I need to drive this motor. For the p-channel MOSFETs I'm looking at these http://www.irf.com/product-info/datasheets/data/irlml2246pbf.pdf
After doing some calculations it looks like I'll get about 80m-ohms drain to source with -12v gate to source at 70 degrees C. So I should be able to push the recommended max of 2.1A through it all day without heatsinking.

Is this all correct or am I missing something? I just can't believe that this tiny thing can handle 2.1A all day long. I know for a fact that I'm leaving out switching losses, but I honestly have no idea how to calculate that. I also don't imagine it'll have a big effect when I have such a big overhead.

EDIT: A question about flyback diodes. I know it's generally recommended to include separate ones and I usually do, but what's the theory behind this? It seems to me like the internal diode in the MOSFET should be able to handle the back EMF. Maybe someone more knowledgeable than me will be able to make something of the winding inductance in relation to back EMF voltage, so here's the motor product page: https://www.sparkfun.com/products/9238
22  Using Arduino / General Electronics / Re: LED as Sensor ?in reverse or forward bias?? on: June 20, 2013, 05:21:37 pm
Very neat paper, thanks for sharing. I just might integrate a simple LED communication interface on a project I'm working on.
23  Using Arduino / Project Guidance / Re: Using an external adapter to supply voltage to a rotary encoder. on: June 14, 2013, 09:41:19 pm
Don't tempt me. I'll never get to bed if I click on that link.
24  Using Arduino / Project Guidance / Re: Using an external adapter to supply voltage to a rotary encoder. on: June 10, 2013, 04:55:22 pm
You oughta see my androids auto correct
25  Using Arduino / Project Guidance / Re: Using an external adapter to supply voltage to a rotary encoder. on: June 10, 2013, 04:47:24 pm
I think you meant negligible not negotiable, Mike. And no, there's no chance that the resistors will burn up, you'll only have a few micro amps flowing through them.
26  Using Arduino / General Electronics / Re: Detect rotation speed (and direction?) on: May 27, 2013, 03:01:50 am
I'm sure it's all possible with a 3 axis accelerometer (even if the plane of rotation changes), but it would probably be incredibly difficult to conjure up a piece of software to manipulate all the accelerometer outputs into something useful.
If, however, you decide to ditch the 3rd dimension then it would probably be easier. Angle relative the the ground could be found using trigonometry (imagine a 90°   
27  Using Arduino / General Electronics / Re: Detect rotation speed (and direction?) on: May 27, 2013, 02:13:12 am
I imagine that would take quite a bit of ingenuity to accomplish. I'm not familiar with the exact hardware you're using, nor can I be sure that the led strip will only travel in a 2 dimensional plane relative to the hand, so forgive me if the following ideas are useless. Generally one would have a magnet attached to the stationary object (the leather loop), and a hall effect sensor on the spinning object or vice versa. However, this might not work reliably if the two are too far apart when they pass by. Another solution might be to attach a gyroscope/accelerometer chip onto the spinning part. I assume you already have a microcontroller somewhere in the mix, so interfacing shouldn't be difficult.

Actually now that I think of it, the hall effect sensor won't give rotational info. Scratch that idea.
28  Using Arduino / General Electronics / Re: Detect rotation speed (and direction?) on: May 27, 2013, 01:33:52 am
If you're swinging the stick surely you would know which way you're swinging it? What exactly are you trying to accomplish? I have a feeling it's something other than swinging a stick.
29  General Category / General Discussion / Re: English Electronics Help on: May 18, 2013, 08:38:39 pm
Very interesting, it would be cool to see to see some basic logic gates made out of hydraulic "transistors".
30  Using Arduino / Programming Questions / Coding conventions on: May 05, 2013, 12:31:45 am
Which of these two loops is "better"?

Code:
  while (!var)
  {
    //code
    if (something)
    {
      var = 1;
    }
  }

or

Code:
 
  while (1)
  {
    //code
    if (something)
    {
      break;
    }
  }

They both do the same thing obviously, and I can use either one for part of my code so I was just wondering if one is prefered over the other. I would guess the first one is better since break seems to have the same reputation as goto. I've had a lot a similar situations while coding in the past; Is there a place where all these coding conventions are written out?
Pages: 1 [2] 3 4 ... 15