Question on PowerSwitch

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
iphi
Rank 2
Rank 2
Posts: 68
Joined: Mon Jun 25, 2007 11:37 am

Question on PowerSwitch

Post by iphi » Fri Jul 13, 2007 3:31 pm

I try to modify PowerSwitch firmware to my own application.
I try to leave out all unnecessary code to save flash.

Question:
What are the ActionTimers good for? Somehow taking them out the device isn't recognized on the USB bus any longer.

Does the USB driver need the timer interrupt?

Thanks

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

Post by christian » Fri Jul 13, 2007 6:33 pm

The action timers are for timed on/off pulses on the outputs. The USB driver does not need any timer interrupts.

If the device is not recognized after your change, you must have broken something in the main module. Maybe it crashes and the driver is therefore unable to respond to requests...

iphi
Rank 2
Rank 2
Posts: 68
Joined: Mon Jun 25, 2007 11:37 am

Post by iphi » Fri Jul 13, 2007 8:48 pm

I have restarted all over and still have the same problem. Here is what I did:

1. Compiled the original firmware from PowerSwitch.2007-06-25.zip
and flashed it. Works fine

2. Added a single line to main.c:

#define TEST_DRIVER_SIZE /* <<< added this line */
#ifndef TEST_DRIVER_SIZE /* define this to check out size of pure driver */
...

Recompiled and flashed. => the USB device isn't recognized on the bus any longer. I thought the alternate main() on the very bottom of main.c should suffice for the device being recognized on the USB bus!??

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

Post by christian » Fri Jul 13, 2007 8:52 pm

I think this minimal main() should suffice, but we have not tested this recently. It is primarily to check the size of the compiled binary.

I don't have a PowerSwitch hardware available for testing now, so I can't really confirm whether or not it should work with TEST_DRIVER_SIZE defined.

iphi
Rank 2
Rank 2
Posts: 68
Joined: Mon Jun 25, 2007 11:37 am

Post by iphi » Fri Jul 13, 2007 10:08 pm

Die Minimalvariante geht doch!
Man muss nur nach dem Flashen mal den USB Stecker ziehen und wieder einstecken.

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

Post by christian » Mon Jul 16, 2007 10:20 am

Yes, I should have mentioned that. In order to save space, I've removed the initial USB disconnect.

Post Reply