atmega128
No succes yet....
Have tried on the Atmega16, and I could use any port or pin numbers and it works perfectly. However, when upgrading to the atmega128 Windows keeps buzzing me with the "Unrecognized Device" balloon.
I have tried numerous ports but witout succes. Are there any other suggestions I could try?
Have tried on the Atmega16, and I could use any port or pin numbers and it works perfectly. However, when upgrading to the atmega128 Windows keeps buzzing me with the "Unrecognized Device" balloon.
I have tried numerous ports but witout succes. Are there any other suggestions I could try?
I'm sure I'm using the right fuse bits, because when I disconnect the 12 MHz, I can't program my atMega128 anymore.
At the moment I’ve only connected the USB connector, so they are not used for something else.
My compiler and assembler doesn’t generate any warning or error. I’m using the command prompt (Win XP) and I change directory to the place where my main.c exists. Then, I type “make” and I see a list of files which are being compiled. But I don’t see any warnings or errors. See the screenshot below to see my compiler output.
I only get an error about the checksize option, but this is not important to the compilation process. I’m using AVR Studio to program my ATMega128.
At the moment I’ve only connected the USB connector, so they are not used for something else.
My compiler and assembler doesn’t generate any warning or error. I’m using the command prompt (Win XP) and I change directory to the place where my main.c exists. Then, I type “make” and I see a list of files which are being compiled. But I don’t see any warnings or errors. See the screenshot below to see my compiler output.
I only get an error about the checksize option, but this is not important to the compilation process. I’m using AVR Studio to program my ATMega128.
plukke
Yes, I've changed the target to Atmega128. That's the only thing I've changed. I'va connected ecerything following the circuit that came with the zipfile PowerSwitch.2007-03-29.zip.
Here is a link to my makefile: makefile
( I've changed the extension to .txt so it could be downloaded. )
The only change is the device variable
Here is a link to my makefile: makefile
( I've changed the extension to .txt so it could be downloaded. )
The only change is the device variable
Interesting... Do you have any debug tools available such as a digital storage scope, a logic analyzer or at least a simple analog scope?
With a DSO, you should see a query/response dialog on D+, query and response being distinguished by slightly different voltage levels. Simple errors can usually be seen on the scope.
From the software side you might be able to see something with a USB snooper, but that assumes that there is at least SOME communication.
And another idea: The Mega128 has an XDIV register where you can divide the crystal frequency. Are you sure that this feature is disabled?
With a DSO, you should see a query/response dialog on D+, query and response being distinguished by slightly different voltage levels. Simple errors can usually be seen on the scope.
From the software side you might be able to see something with a USB snooper, but that assumes that there is at least SOME communication.
And another idea: The Mega128 has an XDIV register where you can divide the crystal frequency. Are you sure that this feature is disabled?
I've placed this statement:
XDIV = (0<<XDIVEN);
at the first line of my main-function. Following the datasheet this means that the clock divider is disabled, so the atmega128 runs at 12 mHz.
At this moment I don't have a scope or logic analyzer avaible. Tuesday, when I'm at school I can use one. I will post the results here, then.
@ Grendel, the Mega103 compatibility mode is disabled (bit unprogrammed). I've tried both options.
So, I don't have any succes yet.
XDIV = (0<<XDIVEN);
at the first line of my main-function. Following the datasheet this means that the clock divider is disabled, so the atmega128 runs at 12 mHz.
At this moment I don't have a scope or logic analyzer avaible. Tuesday, when I'm at school I can use one. I will post the results here, then.
@ Grendel, the Mega103 compatibility mode is disabled (bit unprogrammed). I've tried both options.
So, I don't have any succes yet.
Odd that changing the M103C fuse doesn't change the behavior.. Could you post the values of the three fuse bytes ? I would suggest these values:
Extended fuse byte -- 0xFF
High fuse byte -- 0xD9
Low fuse byte -- 0x9F
Also, what version of WinAVR are you using ? 20060421 or 20070122 ? (the latter is claimed to be "somewhat experimental"..)
Extended fuse byte -- 0xFF
High fuse byte -- 0xD9
Low fuse byte -- 0x9F
Also, what version of WinAVR are you using ? 20060421 or 20070122 ? (the latter is claimed to be "somewhat experimental"..)
At last, it works
I changed the fusebits to the values suggested, made no effect whatsoever. Then I pulled out the scope.
After plugging the chip to the scope, I noticed the USB signal was quite nasty, loads of round edges, no nice sharp edges. Plugging it into the ATMEGA16 revealed a nice signal with sharp edges. So now I knew it wasnt the chip itself, it was the hardware around it.
After replacing the pullup resistors and adding two 3V6 zener diodes I managed to get the signal right. After all it wasn't the chip itself, it proved to be other factors.
Thanks bigtime for the help and support
I changed the fusebits to the values suggested, made no effect whatsoever. Then I pulled out the scope.
After plugging the chip to the scope, I noticed the USB signal was quite nasty, loads of round edges, no nice sharp edges. Plugging it into the ATMEGA16 revealed a nice signal with sharp edges. So now I knew it wasnt the chip itself, it was the hardware around it.
After replacing the pullup resistors and adding two 3V6 zener diodes I managed to get the signal right. After all it wasn't the chip itself, it proved to be other factors.
Thanks bigtime for the help and support
Re: atmega128
Can someone send this file for sendspce or something that Guest gived (makefile.txt) pls?
Re: atmega128
I am newby at AVR and because i couldn't find an ATTINY45 i used an ATMEGA128 to test and practice with the code provided at CAPSLOCK project http://macetech.com/blog/?q=node/46. I used port D 2 for usb D- and port D 0 for usb D+ clocked into usbconfig.h with a 16MHz ceramic resonator the fuses WDTON 1,OCNED 1,JTAGEN 0,CKOPT 0, EESAVE 1, BOOTSZ1-2 0, BOOTRST 1, BODLEVEL 0, BOTEN 0, SUT1 1, SUT0 0, and all CKEL 1, initially the communication was not possible and was getting the message unknown device. after i solder into the interface circuit the 3V6 zeners all gone perfect. one more note for the timer TCCR1 use a 16bit value because for atmega128 this timer is 16bit.
I loved the project and the code excellent !!!
I loved the project and the code excellent !!!