Page 1 of 1

EasyLogger --> joystick?

Posted: Thu Nov 15, 2007 11:24 am
by andrewbenson
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

Posted: Thu Nov 15, 2007 1:27 pm
by sprhawk
what do you want to make?

I'm being making an HID joystick too:D

MSN:sprhawk "at" sohu.com

Posted: Sun Nov 18, 2007 11:01 am
by christian
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.

Posted: Wed Nov 21, 2007 7:13 pm
by andrewbenson
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.

Posted: Wed Nov 21, 2007 7:41 pm
by christian
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.

Posted: Thu Feb 28, 2008 11:55 pm
by christian
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...