Quantcast
Channel: Objective Development Forums
Viewing all 4524 articles
Browse latest View live

Re: Does usbPoll() get executed before entry to the ISR?

$
0
0
Maybe the image below helps. It shows the USB traffic during device enumeration. "Int active" is high while the interrupt routine is executed, tx during set.

If you want to understand the usb protocol, i would recommend you get a logic analyzer with USB protocol support. The saleae support USB1.1 in it's newset beta.

Regarding external hardware: You could try to implement the bitstuffing and xor decoding in a small CPLD or even discrete logic. The you could use a UART or SPI to read the USB traffic which would unload the CPU a lot.

I am not sure why you are looking at an old version of the driver? The strange reset code is only there to make sure that the reset hook is not called multiple times during a reset, even if usbpoll() is called more than once.

Image

edit: man this forum really does not like images.

Re: Minimal USB implementation

$
0
0
Why don't you include the CRC routine in usbdrvasm.S. Christian Starkjohann did this in his first implementations. That way the compiler will have nothing to do with it and code will be minimal.

Re: Minimal USB implementation

$
0
0
That is where it is right now. The idea was that inlining saves code space.

Re: Changing USB maximum current ouput

$
0
0
I've been researching answers to this same question, and I might be able to help out a little. (Caveat: I am a complete novice at this, so, please double-check anything I tell you!)

From what I've read and observed, there many different ways to increase the power available to your project above 100mA.

First, the 100mA limit is the maximum a non-self-powered device can draw from a USB port (v1.1 or v2) without reconfiguring itself.
I'm still fuzzy on how the reconfiguring part works, but I believe the device must have 2 configuration descriptors, one for default operation (100mA) and then a second that defines the higher power limit. The device will then disconnect from the bus and when it reconnects it uses the second config. (Like I said, I don't know the gritty details of how this works).

Lots of hardware vendors work around the 100mA limit by simply providing a Y-cable with two USB plugs, which allows the device to draw up to 200mA.

The thing I *just* learned is that there is also a "USB Battery Charging Spec" that defines up to 1.5A on a port for an unconfigured device. This gibes with the current draw I've measured using an inductive charger; it can pull ~800mA, and is not detected as a USB device. I believe all that is necessary for this config is to connect a specific resistance between the power and data lines, and if the port supports "dedicated charging" mode, it will supply up to 1.5A.

I've been meaning to measure the resistance between the power and data lines for my inductive charger, but I haven't had time yet. My idea is that if the Y-cable can be used to support 2x100mA connections, why can't one of the cables be configured as a "dedicated charger", and then provide 1.5A instead of 100mA? I'm sure that probably violates some spec, but what I've seen so far in USB descriptors doesn't make me think that hardware vendors spend a lot of time worrying about violating the USB spec.

Anyways, something to think about. You can probably solve your problem by just picking up a Y-cable.
Here's some reading, if you'd like to look into it more:
http://en.wikipedia.org/wiki/USB#Power

Re: Does usbPoll() get executed before entry to the ISR?

$
0
0
There shouldn't be any bouncing, as that's an artifact of mechanical switches. You may be thinking of ringing, but that's much more mild than switch bounce, and shouldn't get near logic thresholds so shouldn't affect the digital data. As I understand it, usbPoll() detects reset by one of the USB lines being in a non-idle state for an extended period of time. This condition is present for quite a while, so usbPoll() might notice it more than once before it ends. Thus, to avoid calling the user's reset hook more than once, it keeps track of whether it's already called it. The reason for usbPoll() having a loop that checks multiple times is that it needs to distinguish the line being active continuously, and it happening to catch it active during normal data transmission. In the latter, it toggles constantly between the active and idle states (which is the solid white parts you see in the image; if zoomed in you'd see lots of signal edges close together).

Re: Changing USB maximum current ouput

$
0
0
Yeah, apparently hardware vendors don't care that it violates the spec. I have 3 bus-powered 2.5" external hard-drives, and 2 DVD drives (by name-brand manufacturers), and they all came with Y-cables.

Re: HIDKeys: usage of PD1

Re: Little Snitch behaviour

$
0
0
Thanks for your reply,
I suppose stopping and re-starting network filter has the same effect as deleting a rule.
This definitely looks like a bug. And this is making the use of LS really ennoying.
It's a pity we don't receive any answer so far to correct this and make it work properly.
So I begin to wonder: is there any alternative to Little Snitch on the market ?

USBaspLoader condition / BVZ55-C3V6

$
0
0
Hello!
My name is Michael and I'm working on a small project called the SNESoIP. It's basically an ethernet adapter for the Super Nintendo (SNES).
After a few considerations, I decided to produce a small batch of this device. With a few extras of course to make the end-users life a little bit easier.

I was thinking about the USBaspLoader. Now my questions:

- Could it work to use the USBs VCC to trigger the programming mode condition? I'm not using USB for power supply anyways. Here are my schematics: http://misc.mupfelofen.de/snesoip-rev2.pdf

and

- Because it would cause a few problems to make the whole circuit running at 3.3V, I've to use the (dirty) zener solution. But after all I've read I'm feeling a little bit insecure in choosing the right one. Could the BVZ55-C3V6 (5% tollerance) work? I also have a few 3.9V (TZMC-Series) in stock. All variants are SOD80 (Mini-melf).

Any help is highly appreciated!

Greetings
Michael

PS: Please be indulgent; english is not my native language. :)

Re: Minimal USB implementation

$
0
0
blargg wrote:Actually not so much call overhead, but richer information to the optimizer about exactly what registers are modified. It could probably also be written to let the compiler assign all the registers it uses.


I wish :) I have not found a way to define variables in the assemblercode without having the compiler initialize them.

Re: Does usbPoll() get executed before entry to the ISR?

$
0
0
Yes, there is no bouncing in the oscillographs. I got distracted. I was speaking about the time when the device is plugged into the hub jack:
deltat3: (TATTDB) This is a debounce interval with a minimum duration of 100ms that is provided by the USB
System Software. It ensures that the electrical and mechanical connection is stable before software
attempts to reset the attached device. The interval starts when the USB System Software is notified
of a connection detection. The interval restarts if there is a disconnect. The debounce interval
ensures that power is stable at the device for at least 100ms before any requests will be sent to the
device.

From the text explaining the figure in post #1, in the USB 1.1 specification.

Re: Minimal USB implementation

$
0
0
Can you just set them as out variables? That would force the compiler to give them registers and let it know that you're modifying them.

Re: USBaspLoader condition / BVZ55-C3V6

$
0
0
You could have the USB Vcc connected (via a resistor perhaps) to an input pin that you poll or whatever in your normal program. If you detect that USB is connected, reset and run the bootloader. You could set the bootloader entry condition as a watchdog reset and then trigger that in your program.

// bootloaderconfig.h
static inline void bootLoaderInit( void )
{
    if ( !(MCUCSR & (1 << WDRF) )
        leaveBootloader();
    MCUCSR = 0;
}


Though, I wonder whether you can just watch the USB data lines and somehow detect host connection. You'd have weak pull-ups enabled for both and watch for one going low, though I'm not sure whether that will actually occur. It'd avoid any extra pins for detecting USB.

Re: HIDKeys: usage of PD1

$
0
0
Looking at the tiny schematic on HIDKeys' page, it says PD1 is TX. usbdrv includes optional debugging output over TX. If you don't need it, then I see no reason why it can't be used for an extra key.

Re: Install package

$
0
0
For the plain system you can just download the latest release on GitHub.
The folder "webyep-system" is what you need.

Re: HIDKeys: usage of PD1

$
0
0
Many thanks for your reply.

Cheers,

Ross

Re: Launch an iTerm profile

$
0
0
The above script doesn't work, moreover with Mac OS 10.8 and above you should enable every script in the Accessibility preference pane, that's a pain in the ass.

I managed to write this one:
tell application "iTerm"
   set myterm to (make new terminal)
   tell myterm
      launch session "Your_Profile_Name"
   end tell
end tell


Tested and working with iTerm2
http://www.iterm2.com/

Source code available?

$
0
0
Hello-

I am wondering if the source code for Completion Dictionary is available anywhere, either on your site, github.com, or elsewhere?

I'd be happy to help resolve some of the compatibility issues with newer versions of Xcode, submit enhancements etc...

Hope to hear back soon,
Alex Gray
Alex@mrGray.com
http://github.com/mralexgray

Re: USBaspLoader condition / BVZ55-C3V6

$
0
0
I think for reliable detection of the presence of a USB host you'd have to do this:

0) For enumeration
1) Wait for reset (long SE0). If reset times out, quit bootloader
2) After that, wait for n keepalive pulses (short SE0). If reset times out, quit bootloader

All of this will take at least 500ms if successull and longer of no host is present.

In my opinion it is better to rely on other methods to enter a bootloader.

Re: Minimal USB implementation

$
0
0
Whenever I tried that, the compiler would also initialize the variables, which took up more space than it saved.
Viewing all 4524 articles
Browse latest View live