Page 1 of 1
AVR USB Queries, Please Help!!!
Posted: Thu Aug 23, 2007 12:48 pm
by micraft
I'm doing a project that required data to be send from a GPS receiver to an AVR microcontroller and this data needs to used for live tracking.
This device needs to be interfaced to the PC using USB.
I have been deciphering AVR USB for quite some time.
I have tested PowerSwitch, and then tried EasyLogger but no success with EasyLogger. I used the AT90s2313 instead of the AtTiny45 and removed all the code for the ADC and timer. But the device does not produce any change to the system. It DOES NOT even show "USB Device Not Recognized". But after removing the AT90s2313 from the circuit the OS shows "USB Device Not Recognized". What could be the reason for that?
I intended on my project to be a device that would act as an HID Device, so that I can stay away from the Driver Development.
Is there any other solution that I can USB implement my device wihtout the need of any driver development?
Posted: Fri Aug 24, 2007 8:10 pm
by christian
You can't run EasyLogger on any other device than the ATTiny45 (and similar) because it uses special features of this chip, in particular the high speed I/O clock PLL. This allows the Tiny45 to run at 16.5 MHz from the internal RC oscillator.
The AT90S2313 does not even have an internal RC oscillator...
If you want a HID example which simulates a keyboard, please start with HIDKeys. If you want an example for mis-using HID to read data from the device without the need of a kernel level driver, please see the Automator project.
If you really want to start from EasyLogger on an AT90S2313, you must use an external crystal oscillator at 12 MHz and change the clock rate defines in usbconfig.h.
Posted: Mon Sep 24, 2007 1:10 pm
by rexr
I tried keeping an external oscillator and also changed the clock rate in config.h.But still its not working.
Can you tell me exactly how to replace tiny45 by at90s2313?
Posted: Tue Sep 25, 2007 10:12 am
by christian
Did you change the device type in the Makefile, or are you still compiling ATTiny45 code for the 2313?
You must change the code since the 2313 does not have ADC registers (no ADC included).
Posted: Tue Sep 25, 2007 12:46 pm
by rexr
Yes i complied it in 2313 and also i removed the ADC code and i got the hex but still its not working.Actually what i did is, i implemented PowerSwitch successfully now i tried to implement the EasyLogger in the same circuit removing unwanted circuit section.i also changed the port and pin number in usbconfig.h accordingly and also gave int0 just like in powerswitch.
i was really trying is to transfer some data from the UART of the chip to PC via USB.
Can you please explain me how to migrate from tiny45 to at90s2313 step by step?
Posted: Tue Sep 25, 2007 12:55 pm
by christian
Sorr, I can't explain this because I never did it and I don't have test hardware here to try your code. I can only give the obvious hints (usbconfig.h, USB specific code in main(), processor-specific code in the main module).
Posted: Tue Sep 25, 2007 1:20 pm
by rexr
Thats ok.anyway thanks a lot. sorry one more doubt.do i need to change the codes in the asm and s files to make it compatible for at90s2313 or can i use those files in powerswitch with easylogger?
Posted: Tue Sep 25, 2007 1:26 pm
by christian
You don't need to change ANY file in the usbdrv directory. All user configurable parts are in usbconfig.h. Both, PowerSwitch and EasyLogger have the same files in usbdrv (unless they have different versions, but then it should be possible to upgrade the older to the newer driver).