usb mouse

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
lios
Posts: 7
Joined: Thu Jun 14, 2007 11:58 pm

usb mouse

Post by lios » Fri Jun 15, 2007 12:14 am

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

spiff
Rank 1
Rank 1
Posts: 24
Joined: Tue Apr 17, 2007 1:00 am
Location: Virum, Denmark
Contact:

Re: usb mouse

Post by spiff » Fri Jun 15, 2007 10:59 am

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.

lios
Posts: 7
Joined: Thu Jun 14, 2007 11:58 pm

12mhz

Post by lios » Fri Jun 15, 2007 1:39 pm

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?

spiff
Rank 1
Rank 1
Posts: 24
Joined: Tue Apr 17, 2007 1:00 am
Location: Virum, Denmark
Contact:

Re: 12mhz

Post by spiff » Fri Jun 15, 2007 2:04 pm

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?

lios
Posts: 7
Joined: Thu Jun 14, 2007 11:58 pm

:P

Post by lios » Fri Jun 15, 2007 5:02 pm

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??

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

Post by christian » Fri Jun 15, 2007 7:56 pm

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.

Post Reply