Page 1 of 1

Combine HIDBoot + Powerswitch functionality's

Posted: Thu Oct 01, 2009 10:57 pm
by honda4life
Hello everyone,

I have some beginners questions.
I've implemented the HIDBoot into my atmega16 (love it), but I want to try to send some data to my computer over USB.

Does HID means when i'm sending data from my AVR to my PC that the AVR acts like a keyboard like this?
Place the cursor into notepad and AVR types: "255 CrLf 255"

I want to send a command to start ADC measurements and send the values to a program i've written into c++ that runs on my computer (this is what powerswitch basically does)
Is this combination possible or do I need AVRUSBBoot (not HID)?

If I compile powerswitch and I load the program, than in the AVR the driver is loaded twice, once as bootsector (HID) and once as program (not HID), that's a waste of memory, so it it possible to only load the driver once in this case?

It's difficult to explain, but basically what is programming the AVR over USB and sending data to the pc over usb to a program that runs in the background, how can i do this?

Re: Combine HIDBoot + Powerswitch functionality's

Posted: Sun Oct 04, 2009 12:16 pm
by christian
HID allows a wide spectrum of devices. If you implement a keyboard, it is as you say: You point the cursor at a window and the device writes the data. Most applications implement a generic HID device. This allows (almost) arbitrary communication in fixed size blocks between the host and the device. See the hid-data example.

Even if you use HID in your application, you can't share the driver code between the boot loader and the application. The driver is tailored via compile time constants to the application. The code savings you could obtain would be below 1 kB. That's not really worth it, especially with ever growing memory sizes.