Page 1 of 1

usb mouse

Posted: Fri Jun 15, 2007 12:14 am
by lios
Hi guys I wand to build a project that an avr emulates the movement of a mouse cursor with 6 buttons up – down – left – right – left click - right click

Any idea or any example... I work the code vision c compiler but I never work USB project.., I try to build the HID keyboard that I found in webpage (http://www.obdev.at/products/avrusb/hidkeys.html) but I get always the message USB device not recognized :( the circuit is correct and I load the hex file in micro from the code vision programmer and STK500 (I don’t know if wand fuses,) the problem is I use 10mhz crystal because I cant find 12mhz

sorry for my bad english I will appreciate if someone helps me

Re: usb mouse

Posted: Fri Jun 15, 2007 10:59 am
by spiff
lios wrote:the problem is I use 10mhz crystal because I cant find 12mhz


This will never work. The Obdev avrusb stack uses strictly timed assembly routines and will only work with 12MHz.

12mhz

Posted: Fri Jun 15, 2007 1:39 pm
by lios
i connect today a 12mhz crystal and my pc recognized as unnown device.. in device manager. I try to work as keybord but dont work? why?

Re: 12mhz

Posted: Fri Jun 15, 2007 2:04 pm
by spiff
lios wrote:i connect today a 12mhz crystal and my pc recognized as unnown device.. in device manager. I try to work as keybord but dont work? why?


Could be because of fuse settings. The standard fuse settings of ATmega8 are configured to use the internal 8MHz RC oscillator, and not the external crystal. Have you changed the fuse settings?

:P

Posted: Fri Jun 15, 2007 5:02 pm
by lios
spiff first of all thanks for your'e help. i have set the fuse as: cksel0-3=checked and ckopt checked

i beleve its ok??

Posted: Fri Jun 15, 2007 7:56 pm
by christian
The HIDKeys project has a Makefile target "fuse". This target sets the fuse values to:

Code: Select all

# Fuse high byte:
# 0xc9 = 1 1 0 0   1 0 0 1 <-- BOOTRST (boot reset vector at 0x0000)
#        ^ ^ ^ ^   ^ ^ ^------ BOOTSZ0
#        | | | |   | +-------- BOOTSZ1
#        | | | |   + --------- EESAVE (don't preserve EEPROM over chip erase)
#        | | | +-------------- CKOPT (full output swing)
#        | | +---------------- SPIEN (allow serial programming)
#        | +------------------ WDTON (WDT not always on)
#        +-------------------- RSTDISBL (reset pin is enabled)
# Fuse low byte:
# 0x9f = 1 0 0 1   1 1 1 1
#        ^ ^ \ /   \--+--/
#        | |  |       +------- CKSEL 3..0 (external >8M crystal)
#        | |  +--------------- SUT 1..0 (crystal osc, BOD enabled)
#        | +------------------ BODEN (BrownOut Detector enabled)
#        +-------------------- BODLEVEL (2.7V)


And have you added low power 3.6 V zener diodes? Some hosts don't tolerate 5 V levels on D+ and D-.

BTW: Please have a look at InfraHID linked from http://www.obdev.at/products/avrusb/projects.html

This project implements a combined mouse/keyboard controlled by an IR remote control.