"USB_SOF_HOOK" where examples or shared projects using this?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
mega_mozg_13
Posts: 12
Joined: Tue Dec 11, 2012 4:33 pm

"USB_SOF_HOOK" where examples or shared projects using this?

Post by mega_mozg_13 » Tue Mar 26, 2013 9:46 am

Hi."USB_SOF_HOOK" - please give example or links to shared projects using this?
/* #ifdef __ASSEMBLER__
* macro myAssemblerMacro
* in YL, TCNT0
* sts timer0Snapshot, YL
* endm
* #endif
* #define USB_SOF_HOOK myAssemblerMacro
* This macro (if defined) is executed in the assembler module when a
* Start Of Frame condition is detected. It is recommended to define it to
* the name of an assembler macro which is defined here as well so that more
* than one assembler instruction can be used. The macro may use the register
* YL and modify SREG. If it lasts longer than a couple of cycles, USB messages
* immediately after an SOF pulse may be lost and must be retried by the host.
* What can you do with this hook? Since the SOF signal occurs exactly every
* 1 ms (unless the host is in sleep mode), you can use it to tune OSCCAL in
* designs running on the internal RC oscillator.
* Please note that Start Of Frame detection works only if D- is wired to the
* interrupt, not D+. THIS IS DIFFERENT THAN MOST EXAMPLES!

bbarny
Posts: 4
Joined: Thu Jun 30, 2011 5:30 pm

Re: "USB_SOF_HOOK" where examples or shared projects using t

Post by bbarny » Tue Jun 04, 2013 7:42 am

http://vusb.wikidot.com/project:lc-meter-usb
See the macro myUSB_SOF_HOOK in the usbconfig.h file in the "LC_meter_USB_Atmel" folder.

mega_mozg_13
Posts: 12
Joined: Tue Dec 11, 2012 4:33 pm

Re: "USB_SOF_HOOK" where examples or shared projects using t

Post by mega_mozg_13 » Tue Jun 04, 2013 8:22 am

bbarny Thanks!

Post Reply