Combine HIDBoot + Powerswitch functionality's

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
honda4life
Posts: 4
Joined: Sat Jun 20, 2009 11:05 am

Combine HIDBoot + Powerswitch functionality's

Post by honda4life » Thu Oct 01, 2009 10:57 pm

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?

christian
Objective Development
Objective Development
Posts: 1443
Joined: Thu Nov 09, 2006 11:46 am

Re: Combine HIDBoot + Powerswitch functionality's

Post by christian » Sun Oct 04, 2009 12:16 pm

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.

Post Reply