Search found 102 matches

by blargg
Thu Apr 10, 2014 2:27 am
Forum: V-USB
Topic: HIDKeys: issue key on both press and release
Replies: 5
Views: 4420

Re: HIDKeys: issue key on both press and release

Hi, I just downloaded HIDkeys, got it working on a USBasp stick (with fewer keys), and came up with this modification to generate distinct key events when you release the button. So you get 1-17 when pressed, 18-34 when released (in the keyReport array). So when I pressed a certain button, it types ...
by blargg
Tue Mar 18, 2014 1:56 am
Forum: V-USB
Topic: __flash as an alternative to PROGMEM
Replies: 1
Views: 3188

Re: __flash as an alternative to PROGMEM

The main issue is that you make your code incompatible with older versions of GCC. Personally I've found the cost of using the older macro to be trivial in terms of clarity and finding bugs. It's not like this new approach magically makes functions work with pointers to flash, as a pointer to flash ...
by blargg
Thu Mar 13, 2014 3:07 am
Forum: V-USB
Topic: License Clarification and Digispark
Replies: 1
Views: 1931

Re: License Clarification and Digispark

The licensing page is probably the place to go. Look at the source code to see whatever you're using V-USB. If usbdrv/ is in there, you almost certainly need to follow the licensing terms above. Note that the GPL doesn't prevent you from selling a product commercially as long as you make the full so...
by blargg
Wed Mar 05, 2014 4:51 am
Forum: V-USB
Topic: Programming a target
Replies: 3
Views: 2455

Re: Programming a target

I've used the LC Technology USBASP V2.0 for almost everything and it's worked very well. I'm on Ubuntu 12.04 and use avrdude as the host software. I have a handful of these as they are great for putting projects on as well, since they have all the hardware needed for V-USB. Get two and use one to pr...
by blargg
Mon Feb 24, 2014 9:32 pm
Forum: V-USB
Topic: vusb device us very sensitive to static charge
Replies: 6
Views: 3817

Re: vusb device us very sensitive to static charge

Have you got a pin floating in your device? That could make it very sensitive to touching things.
by blargg
Mon Feb 03, 2014 9:38 pm
Forum: V-USB
Topic: V-USB CDC-ACM stuck with usbInterruptIsReady() = 0
Replies: 3
Views: 3402

Re: V-USB CDC-ACM stuck with usbInterruptIsReady() = 0

I used that version successfully on an atmega8 at 12MHz (reprogrammed a USBasp). I notice that I switched to the most current usbdrv, not sure if that was necessary. I'm on Ubuntu 12.04 and I used something like this to test, with the device's TX and RX connected together for a loopback test: # Conf...
by blargg
Wed Jan 22, 2014 2:53 am
Forum: V-USB
Topic: Minimal USB implementation
Replies: 13
Views: 6692

Re: Minimal USB implementation

At least with avr-gcc 4.5.3, I think I was able to silence the optimizer warnings by initializing a variable with itself, e.g.char c = c;. Too bad there are so many snags to inlining assembly, as otherwise it could be possible to get more optimal code by using just C rather than mixing it with assem...
by blargg
Wed Jan 22, 2014 2:47 am
Forum: V-USB
Topic: USBaspLoader condition / BVZ55-C3V6
Replies: 5
Views: 3394

Re: USBaspLoader condition / BVZ55-C3V6

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 i...
by blargg
Mon Jan 20, 2014 2:53 am
Forum: V-USB
Topic: HIDKeys: usage of PD1
Replies: 3
Views: 2538

Re: HIDKeys: usage of PD1

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.
by blargg
Mon Jan 20, 2014 2:50 am
Forum: V-USB
Topic: USBaspLoader condition / BVZ55-C3V6
Replies: 5
Views: 3394

Re: USBaspLoader condition / BVZ55-C3V6

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. /...
by blargg
Mon Jan 20, 2014 2:44 am
Forum: V-USB
Topic: Minimal USB implementation
Replies: 13
Views: 6692

Re: Minimal USB implementation

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.
by blargg
Sun Jan 19, 2014 8:24 am
Forum: V-USB
Topic: Does usbPoll() get executed before entry to the ISR?
Replies: 10
Views: 5683

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

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 lin...
by blargg
Sun Jan 19, 2014 8:03 am
Forum: V-USB
Topic: Changing USB maximum current ouput
Replies: 5
Views: 4546

Re: Changing USB maximum current ouput

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. Y-cables are prohibited by the USB spec : Use of a 'Y' cable (a cable with two A-plugs) is prohibited on any USB peripheral. If a USB peripheral requir...
by blargg
Sun Jan 19, 2014 7:55 am
Forum: V-USB
Topic: Minimal USB implementation
Replies: 13
Views: 6692

Re: Minimal USB implementation

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.
by blargg
Tue Jan 14, 2014 6:57 am
Forum: V-USB
Topic: static uchar usbIsReset; /* = 0; USB bus is in reset phase
Replies: 5
Views: 3620

Re: static uchar usbIsReset; /* = 0; USB bus is in reset p

I couldn't find that variable in several of the 2008 versions. From the comment, it looks more like it's just trying to emphasize that static objects in C are initialized to 0 if no initializer is present. In other versions there's a local static for calling a user-defined reset handler only once, a...