Page 1 of 2
USBJOY(PS2) atmega8
Posted: Sun Jan 27, 2008 9:56 am
by mogu
Hi
I just built the usbjoy for ps2 controller.
I program atmega8 using the main_psx.hex.
All went well but when plug it into usb "unknown usb device" and the LED keep blinking.
The config and security bits i left it default which is "SPIEN 1, BOOTSZ1 1, BOOTSZ0 1, SUT0 1, CKSEL3 1, CKSEL2 1"
Anyone know what when wrong?
Thanks
Posted: Fri Feb 01, 2008 2:47 pm
by mogu
I still can't get it to work...
Already blow 1 atmega8 due to wrong setting of fuse...
Anyone know how can i contact the author or those who have successfully build a working one?
Tried PSX and PS2 controller but not working.
Thanks
Posted: Mon Feb 04, 2008 1:40 pm
by Guest
= Your microcircuit ATmega8 is suitable, as blinks LED. A problem most likely that are incorrectly established fuses. By default ATmega8 works from the internal generator, even if you have connected the external quartz resonator 12 MHz.
The fuses in all projects PSX, PS2, SEGA, DENDY should be established CKOPT=0, BODEN=0, SPIEN=0. Others фьюзы should be "1". It is written in files Main_psx.c, Main_sega.c, Main_dendy.c. Hence, the mode of the clock generator ATmega8 from the external high-frequency quartz resonator is established.
If LED blinks, ATmega8 was programmed normally. The problems with initialization USB can be because of operational system. It is recommended WinXP (try on the other computer)
Best regards, Sergey
Posted: Mon Feb 04, 2008 3:34 pm
by mogu
Thanks for the answer.
Just an update, after i post the 2nd post i manage to get the ps1 controller to work(except analog stick and R3,L3 button not working) using BOOTSZ1,BOOTSZ0,SUT0 ticked(i'm using ponyprog2000)but not PS2.
After I saw ur post i ticked all fuses except BODEN and CKOPT.
Means WDTON,EESAVE,BOOTSZ1,BOOTSZ0,BOOTRST,BODLEVEL,
SUT1,SUT0,CKSEL3,CKSEL2,CKSEL1,CKSEL0 all ticked.
End up blowed both my new ATmega8(total 3 gone @@ now its more expensive then buying a ps2 to usb converter, oh well, it's hobby,so...)
For your info, i have no programming background so i don't understand what's in the source code.
I hope you can tell me exactly what fuse to tick and whats not.
Thanks again.
Posted: Mon Feb 04, 2008 6:53 pm
by Guest
Fuses should be established as follows:
CKOPT, BODEN - <v> checked items means programmed (bit=0),
other fuses - <> unchecked items means unprogrammed (bit=1).
These inscriptions are written in PonyProg2000 in the menu Configuration and Security Bits. If you have programmed fuses on the contrary it is necessary to use parallel programmer for ATmega8.
Best regards, Sergey
Posted: Mon Feb 04, 2008 6:57 pm
by Guest
In addition to previous. All over, fuse SPIEN should be - <v> checked (bit=0)
Posted: Mon Feb 04, 2008 8:17 pm
by mogu
Thanks Sergey!
Just order another few atmega8, but have to wait till next week.
Guess I have to learn to ask clearly before I do things blindly.
By the way, can 3 of my wrongly configured fuses atmega8 be saved?
"If you have programmed fuses on the contrary it is necessary to use parallel programmer for ATmega8." By that, is it means if i use parallel programmer, i can reprogram those wrongly configured chip?Which programmer is recommended?
Thanks again!
Posted: Mon Feb 04, 2008 11:04 pm
by christian
I know only one programmer which implements Parallel Programming and that is the STK500. There's also a reverse engineered circuit for an STK500 available on the net, if you don't want to buy one.
What may be easier to obtain is a "parallel enabler" or whatever the name of that circuit is. It's a small parallel programmer which does nothing else than resetting the fuse values so that you can program via ISP.
If you only have bad values for the oscillator fuses, you may have luck with an external CPU clock. You need Parallel Programming only if you have either disabled RESET or ISP.
Posted: Tue Feb 05, 2008 2:18 am
by mogu
Hi christian,
Thanks for the info. I didn't disable RSTDISBL and SPIEN as it was non check-able. I only checked WDTON,EESAVE,BOOTSZ1,BOOTSZ0,BOOTRST,BODLEVEL,
SUT1,SUT0,CKSEL3,CKSEL2,CKSEL1,CKSEL0 and once programmed the atmega8 stop to repond to the ponyprog.
I use SI Prog API serial to program the avr. So what i need is the fuse reset-ter?
I'm planning to build a better programmer like USBasp, AVR-Doper or AVRminiProg. Can those reset the avr?
Thanks!
Posted: Tue Feb 05, 2008 9:48 am
by christian
If you have set all CKSEL bits to 1, you have programmed the ATMega8 for external clock. Just apply any clock (e.g. generated with a 555) to the XTAL1 pin (pin 9 on the DIL package). Make sure that the clock is several times the ISP clock. 500 kHz to 1 MHz should be OK.
Posted: Tue Feb 05, 2008 12:58 pm
by mogu
Can you show me the circuit of 555 to the pin 9 of atmega8?
I have 555 timer at hand.
Pls help me, thanks alot!
Posted: Tue Feb 05, 2008 1:15 pm
by Guest
It is not necessary to wait for the next week
.
Try to program ATmega8, having connected to the pin 9 generators on a microcircuit 74LS04 or 74HC04 with the quartz resonator 4... 8 MHz (R1=R2=1...4.7 kOm, R3=4.7 kOm, C1=1000 pF)
http://u.foto.radikal.ru/0703/ae/f0d2469a5d56.gif
If not it will programmed, use Japanese parallel programmers
http://elm-chan.org/works/avrx/report_e.html
On the future make the simple programmer USBasp. He allows automatically to generate a programming signal for the pin 9 ATmega8 similarly to the generator on a microcircuit 74LS04
Best regards, Sergey
Posted: Tue Feb 05, 2008 1:34 pm
by christian
For an NE555 oscillator, see the application example in the data sheet, e.g.
http://www.ortodoxism.ro/datasheets/stm ... s/2182.pdf figure 13.
Choose R1 = 100 Ohm, R2 = 470 Ohm and C = 1 nF and you should be close to 1 MHz.
Posted: Tue Feb 05, 2008 4:05 pm
by mogu
Thanks for the circuit, but i can't find 1nF from my spare.
What i have only 100pF, 10nF,100nF,1uF,15pF,33pF.
Will have to go search in my office.
Thanks again for the help!
Posted: Tue Feb 05, 2008 4:21 pm
by christian
Then take 100pF and multiply the resistor values by 10. The frequency will be a bit lower due to stray capacities, but that's not so relevant.