USBJOY(PS2) atmega8

General discussions about V-USB, our firmware-only implementation of a low speed USB device on Atmel's AVR microcontrollers
mogu
Posts: 12
Joined: Sun Jan 27, 2008 9:42 am

USBJOY(PS2) atmega8

Post by mogu » Sun Jan 27, 2008 9:56 am

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

mogu
Posts: 12
Joined: Sun Jan 27, 2008 9:42 am

Post by mogu » Fri Feb 01, 2008 2:47 pm

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

Guest

Post by Guest » Mon Feb 04, 2008 1:40 pm

= 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

mogu
Posts: 12
Joined: Sun Jan 27, 2008 9:42 am

Post by mogu » Mon Feb 04, 2008 3:34 pm

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.

Guest

Post by Guest » Mon Feb 04, 2008 6:53 pm

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

Guest

Post by Guest » Mon Feb 04, 2008 6:57 pm

In addition to previous. All over, fuse SPIEN should be - <v> checked (bit=0)

mogu
Posts: 12
Joined: Sun Jan 27, 2008 9:42 am

Post by mogu » Mon Feb 04, 2008 8:17 pm

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!

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

Post by christian » Mon Feb 04, 2008 11:04 pm

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.

mogu
Posts: 12
Joined: Sun Jan 27, 2008 9:42 am

Post by mogu » Tue Feb 05, 2008 2:18 am

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!

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

Post by christian » Tue Feb 05, 2008 9:48 am

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.

mogu
Posts: 12
Joined: Sun Jan 27, 2008 9:42 am

Post by mogu » Tue Feb 05, 2008 12:58 pm

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!

Guest

Post by Guest » Tue Feb 05, 2008 1:15 pm

It is not necessary to wait for the next week :D.

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

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

Post by christian » Tue Feb 05, 2008 1:34 pm

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.

mogu
Posts: 12
Joined: Sun Jan 27, 2008 9:42 am

Post by mogu » Tue Feb 05, 2008 4:05 pm

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!

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

Post by christian » Tue Feb 05, 2008 4:21 pm

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.

Post Reply