Show Posts
Pages: 1 2 3 [4] 5 6 ... 40
46  Using Arduino / Sensors / Re: MPU6050 SparkFun Breakout to Arduino Uno - No Communication on: June 15, 2012, 11:08:31 pm
Once I accidentally configured USER_CONFIG register to disable I2C, while using I2C, and then the MPU never responded, kind of like what you appear to show.

You need pull-up resistors, probably should disable the internal 5V resistors and use your own 4K7 resistors to 3.3V
47  Using Arduino / General Electronics / Re: Multiplying transistor on: June 14, 2012, 09:39:23 pm
gonna need a diagram to understand it better

is it like a darlington pair but with IGFET?
48  Using Arduino / Networking, Protocols, and Devices / Re: Problem Setting up I2C Handshake on: June 14, 2012, 10:42:04 am
The receive event must return before the I2C bus is free, so initiating another transmission inside the receive event is impossible, it might have frozen waiting for the bus to be free
49  Using Arduino / Project Guidance / Re: Arduino ADK - Disable battery charging from ADK? on: June 13, 2012, 10:16:25 am
this is incredibly related to my topic here http://arduino.cc/forum/index.php/topic,109786.0.html

I think it is impossible to stop the battery charging, due to the fact that there is only one configuration to choose from, and that configuration specifies a 500mA requirement, and you can't establish a connection without selecting a configuration
50  Using Arduino / Project Guidance / Re: Android ext. circuit, does not connect unless provided w/ 5V, need workaround on: June 13, 2012, 10:05:31 am
As I understand it, the device should default to low current (100mA) and only change to high current (500mA) mode if it receives a set configuration message. So I would guess that either your host shield is specifying high current mode spontaneously in its initial configuration, or your Android is ignoring the current settings given by the shield.

actually upon further testing, the phone only supports 500mA charging in the single configuration available, see my edit to the first post. I can't establish a data connection without specifying a configuration so I am pretty much forced to use 500mA

I highly doubt it default to low current first, if it does, then there's no way it can charge at 500mA from a wall charger that has no intelligence. These guys are not Apple, they do not use resistors to indicate charging capability

Go to Circuitsathome.com and look at how he hooked up a DC-DC converter to supply the 5V

Thanks for this tip, I was going to deadbug solder my own DC/DC step up converter but circuitsathome has the PCB for only $3, making it much neater

But using a converter would waste something like 10% of 500mA if I estimate a 90% efficiency, that's the optimistic estimate and it's still a lot
51  Using Arduino / Project Guidance / Android ext. circuit, does not connect unless provided w/ 5V, need workaround on: June 12, 2012, 07:53:59 pm
My circuit involves an AVR microcontroller and a MAX3421E USB host interface IC. This IC is exactly the same one as what is used on the "USB Host Shield" and "Android Accessories Development Kit" for Arduino. The circuit is powered at 3.3V, not 5V, keep that in mind. The 3.3V supply comes from a LDO regulator that is actually connected to my Android smartphone's battery (I placed copper tape on the back of my battery, soldered to the terminals, the PCB has springed contacts that connect with the copper tape. The PCB is held to the battery securely because I 3D printed a phone case designed specifically for my PCB and phone. These steps are already done so it is too late to change the project approach regarding this).

Alright, so I've gotten code to work, I know the circuit works, the AVR is programmed, serial debug is working. I have a logic analyzer and checked that the MAX3421E is talking on the SPI bus and is initialized properly.

So I connect it to my smartphone. Keep in mind that since my circuit runs at 3.3V, with no possible source of 5V at this time. So even though GND, D+, and D- are connected to my smartphone, the 5V line is not connected.

The INT output of the MAX3421E does not show activity, meaning from the MAX3421E point of view, nothing has happened. I verified this by checking the D+ and D- USB signals. One of them should show a logic high indicating a connection (only one of D+ or D- depending on the USB speed classification), but none of them do.

Now I'm suspecting that I need to inject 5V into the 5V line to make the smartphone even bother to respond. When I connect it to a 5V external source, Android shows USB as connected, the battery as charging, and there is activity on the MAX3421E's INT signal and SPI bus. This confirms my suspicions. I did try injecting 3.3V instead but the phone does not respond to that.

I connect a DC/DC step-up converter circuit from the 3.3V supply to output 5V. It works and does successfully trick the smartphone into connecting via USB. But the step-up converter gets hot. It's rated for 200 mA, my 3.3V voltage regulator is rated for 300 mA. I did a measurement and the phone was pulling around 600 mA. This is unacceptable.

Through research, I read that I should not place DC/DC converters in parallel. So I have no way of simply increasing the current rating by placing anything in parallel.

I cannot use a bigger battery due to the 3D printed case.

I cannot constantly have an external source of 5V, the final device must be portable.

I know USB devices has to "negotiate" a charge current, in the USB descriptors, it tells the host whether or not it is self or bus powered, and how much current is required. Is there any way to tell the device to not take so much current?

From my knowledge of circuit theory I think there are no practical devices that can maintain 5V and yet still impose a limit on current without dropping voltage, such a device would break Ohm's law. But if I am wrong, please let me know.

Or... is this something that is controlled by the Android OS or a component of the Android OS?

I am using "microbridge" from http://code.google.com/p/microbridge/ which pretends to be a ADB server's TCP connection. I am running Android 2.3.3 I cannot use ADK since it is not supported. Yes I know ICS supports ADK but NO I cannot upgrade to ICS so that's not an option. I did try various ways of hacking ADK into 2.3.3 but had no success.

Another option is to simply get a new DC/DC converter with higher capacity and connect it to the phone's battery, in theory it should work but this is really inefficient. I want to leave this as the last option because it does involve more hardware hacking as opposed to a clean software solution.

EDIT, progress

bNumConfigurations is only 1, which means I can't really tell the phone to use another current setting through software, and bMaxPower is reported to be 500mA
52  Using Arduino / Networking, Protocols, and Devices / Re: Can Leonardo be used as a USB host? on: June 08, 2012, 09:52:19 am
Try the AT90USB1287 , which is an AVR that does have USB host
53  Using Arduino / Project Guidance / Re: SD card bootloading possible ? on: June 07, 2012, 04:01:10 pm
Hey guys I noticed all of these solutions that takes the long route around the problem, but I just edited my post above about AVR_Boot in case you guys didn't really look deeply at it

Quote
/*-------------------------------------------------------------------------/
/  Stand-alone MMC boot loader  R0.01
/--------------------------------------------------------------------------/
/
/  Copyright (C) 2010, ChaN, all right reserved.
/
/ * This software is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
/   personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
/ * Redistributions of source code must retain the above copyright notice.
/
/--------------------------------------------------------------------------/
/ Dec 6, 2010  R0.01  First release
/--------------------------------------------------------------------------/
/ This is a stand-alone MMC/SD boot loader for megaAVRs. It requires a 4KB
/ boot section for code, four GPIO pins for MMC/SD as shown in sch.jpg and
/ nothing else. To port the boot loader into your project, follow the
/ instruction sdescribed below.
/
/ 1. Setup the hardware. Attach a memory card socket to the any GPIO port
/    where you like. Select boot size at least 4KB for the boot loader with
/    BOOTSZ fuses and enable boot loader with BOOTRST fuse.
/
/ 2. Setup the software. Change the four port definitions in the asmfunc.S.
/    Change MCU_TARGET, BOOT_ADR and MCU_FREQ in the Makefile. The BOOT_ADR
/    is a BYTE address of boot section in the flash. Build the boot loader
/    and write it to the device with a programmer.
/
/ 3. Build the application program and output it in binary form instead of
/    hex format. Rename the file "app.bin" and put it into the memory card.
/
/ 4. Insert the card and turn the target power on. When the boot loader found
/    the application file, the file is written into the flash memory prior to
/    start the application program. On-board LED lights (if exist) during
/    the flash programming operation.
/
/-------------------------------------------------------------------------*/

http://elm-chan.org/fsw/ff/00index_p.html

isn't this almost perfect?

you can edit it so that it doesn't reflash every time, you can add a signature to your binary and check against the last signature stored in EEPROM, or simply have a jumper that tells the bootloader to reflash
54  Using Arduino / Project Guidance / Re: SD card bootloading possible ? on: June 06, 2012, 06:39:13 pm
Next newbie question: Is it possible (or done automatically ?) to reuse bootloader's FATlib by the main code?

Generally it is, but I don't know about FATlib in particular.
55  Using Arduino / Project Guidance / Re: SD card bootloading possible ? on: June 06, 2012, 09:50:53 am
http://elm-chan.org/fsw/ff/00index_p.html

example project includes AVR_Boot

Quote
/*-------------------------------------------------------------------------/
/  Stand-alone MMC boot loader  R0.01
/--------------------------------------------------------------------------/
/
/  Copyright (C) 2010, ChaN, all right reserved.
/
/ * This software is a free software and there is NO WARRANTY.
/ * No restriction on use. You can use, modify and redistribute it for
/   personal, non-profit or commercial products UNDER YOUR RESPONSIBILITY.
/ * Redistributions of source code must retain the above copyright notice.
/
/--------------------------------------------------------------------------/
/ Dec 6, 2010  R0.01  First release
/--------------------------------------------------------------------------/
/ This is a stand-alone MMC/SD boot loader for megaAVRs. It requires a 4KB
/ boot section for code, four GPIO pins for MMC/SD as shown in sch.jpg and
/ nothing else. To port the boot loader into your project, follow the
/ instruction sdescribed below.
/
/ 1. Setup the hardware. Attach a memory card socket to the any GPIO port
/    where you like. Select boot size at least 4KB for the boot loader with
/    BOOTSZ fuses and enable boot loader with BOOTRST fuse.
/
/ 2. Setup the software. Change the four port definitions in the asmfunc.S.
/    Change MCU_TARGET, BOOT_ADR and MCU_FREQ in the Makefile. The BOOT_ADR
/    is a BYTE address of boot section in the flash. Build the boot loader
/    and write it to the device with a programmer.
/
/ 3. Build the application program and output it in binary form instead of
/    hex format. Rename the file "app.bin" and put it into the memory card.
/
/ 4. Insert the card and turn the target power on. When the boot loader found
/    the application file, the file is written into the flash memory prior to
/    start the application program. On-board LED lights (if exist) during
/    the flash programming operation.
/
/-------------------------------------------------------------------------*/
56  Using Arduino / Project Guidance / Re: Controlling a RC controller on: June 04, 2012, 06:46:56 am
you can directly control it through infrared if you reverse engineer the protocol and encoding

of course you can also do as you said, inject a signal into the joysticks, the easiest way is to just use the analog out pins, add a resistor-capacitor LPF on it, and connect it to the tap pin of the joystick potentiometers

other ways include using a DAC, or a digital potentiometer
57  Using Arduino / Project Guidance / Re: Controlling a RC controller on: June 04, 2012, 12:22:21 am
what kind of controller?

how big is the helicopter?

if it is infrared, you can certainly just replicate the protocol directly

if it's big enough to use real servos, then you can get a 2.4 GHz transmitter and receiver kit, and feed PPM pulses into the transmitter

anything else will require you to do more research
58  Using Arduino / Project Guidance / Re: Arduino processing language versus AVR C language on: June 02, 2012, 08:27:50 pm
Quote
Arduino breaks a lot of C++ rules ...

What rules? Bear in mind they both use the avr-gcc compiler.

Arduino's IDE implemented automatic function prototype generation, it sort of eliminated the need for header files in certain situations, it's harder to say what is public and what is private using Arduino, for functions that are not a part of a class
59  Using Arduino / Project Guidance / Re: Arduino processing language versus AVR C language on: June 02, 2012, 08:26:09 pm
Another thing to note, if I remember right the 328 doesn't support JTAG debugging...

it does have debugWire, I have a AVR Dragon that supports it but I never sucked enough at programming to need it
60  Using Arduino / Programming Questions / Re: Avr Studio IDE on: June 02, 2012, 08:25:05 pm
Yep I thought you just wrote it, does that override the existing main()? If so you would probably want to add a call to setup() if you wanted to keep the Arduino hardware configuration.

______
Rob

you mean init()?
Pages: 1 2 3 [4] 5 6 ... 40