EasyLogger --> joystick?

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
Post Reply
andrewbenson
Posts: 4
Joined: Thu Nov 15, 2007 11:18 am

EasyLogger --> joystick?

Post by andrewbenson » Thu Nov 15, 2007 11:24 am

Hello,
I'm interested in creating a simple HID joystick device using ATTiny26. I would like to use the internal clock as demonstrated in the EasyLogger project, but I'm having a difficult time trying to parse through the code to find where I will need to make the appropriate changes. Is there another project that you would recommend working from?

Anyone care to help???

Thanks,
Andrew

sprhawk
Posts: 11
Joined: Sun Oct 28, 2007 5:52 am

Post by sprhawk » Thu Nov 15, 2007 1:27 pm

what do you want to make?

I'm being making an HID joystick too:D

MSN:sprhawk "at" sohu.com

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

Post by christian » Sun Nov 18, 2007 11:01 am

Getting a Joystick into 2 kB of flash can be a challenge. But if you still want to try it: The only thing that's different when you run from the internal oscillator is that you need to calibrate it to 8.25 MHz and set the fuses for internal RC oscillator and clock doubling.

andrewbenson
Posts: 4
Joined: Thu Nov 15, 2007 11:18 am

Post by andrewbenson » Wed Nov 21, 2007 7:13 pm

I was under the impression that with the new EasyLogger firmware, you were supposed to use the PLL clock fuse. So, is it better to set it for Int. RC (8Mhz) ? Do I still use F_CPU 16500000?
I'm having a difficult time finding information on how to calculate the calibration byte for OSCCAL. If anyone has a link to some information, or a simple equation, that would be great.

I pulled the HID descriptor from the AVR-HID firmware, and I have the code compiling now to 99.1% of the 2K flash, and I can verify the device is sending information using Snoopy Pro on Windows XP. I'm unfortunately unable to get the joystick to show up in any applications as an HID device, and it doesn't get recognized by HID_n_Seek on Mac. It's maddening, but I feel I am close.

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

Post by christian » Wed Nov 21, 2007 7:41 pm

Since you use the PLL for clock generation, the CPU actually runs on 16.5 MHZ and you should set F_CPU to 16500000.

We currently don't have a good standard method to obtain OSCCAL. I would recommend that you find it by trial and error by measuring the actual clock frequency.

Getting the HID descriptor right is often a challenge. I would recommend that you only work on one issue at a given time, e.g. move the code to an ATMega8 with a 12 MHz crystal clock to rule out code size problems and clock precision problems.

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

Post by christian » Thu Feb 28, 2008 11:55 pm

Just for your information: We have released EasyLogger 2008-02-28 today. This version adds self-calibration of the RC oscillator.

In principle, this calibration algorithm can be used to calibrate the RC oscillator directly to 12 MHz. However, the precision is not high enough for the 12 MHz module (because it does not have a software PLL) and 12 MHz is outside the specified range of OSCCAL values. It's still an interesting field for experiments...

Post Reply