detect if usb is pluged...

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
dzairo
Rank 1
Rank 1
Posts: 35
Joined: Wed Sep 22, 2010 3:31 pm

detect if usb is pluged...

Post by dzairo » Wed Dec 08, 2010 9:13 pm

Again , again....
Sorry for my english but must give this question again.

how to detect if MCU is connected to USB or not. Why??? if I want run application but I want know if
mcu is connected in to usb or not, if is then use function for usb communication and disable any special function (used interupt ) , or usb is not and then use other special function.
If use ATmega168 it's easy but in ATmega8 are not some PIN interupt change function.
how we can on some time (on one sec or more (less)) detect if are some data change or other pointer.

it's very important for me and for all other user.

PS: I use USB HID bootloader but don't use any pin to define if want start bootloader or user application. I plan use so if bootloader start then check reset source, if is watch dog or external pin reset then I know so want start bootloader, if reset source is other then jump in to user application. if user want run bootloader then use external reset pin or sen command to user application for freeze cycle and wait for watch dog reset. then bootloader start and wait for data for new firmware.
but if detect so usb is not connected then don't wait , jump into user application.
why this solution???
I want use differ watch dog function :
1. for reset mcu (some unknown problem, the processor has problems and freezes)
2. freeze for start bootloader.

any suggestion????

any value in ram what change and define so usb communicate with pc

king regards

Post Reply