New CPU Project

Discuss mods, hacks, tweaks, etc.

Moderators: altitude, adafruit_support_bill, adafruit, phono, hamburgers

Please be positive and constructive with your questions and comments.
User avatar
antto
 
Posts: 1636
Joined: Thu Apr 15, 2010 3:21 pm

Re: New CPU Project

Post by antto »

Altitude: could you post the avrdude commands for the USBASP?

User avatar
altitude
 
Posts: 995
Joined: Wed May 11, 2005 5:17 pm

Re: New CPU Project

Post by altitude »

for what?

User avatar
rv0
 
Posts: 395
Joined: Tue Jul 14, 2009 4:50 pm

Re: New CPU Project

Post by rv0 »

Altitude wrote:for what?
cos i got 3 bootloader-less cpu's waiting for action ;)
edit: and i dont wanna break 'em like antto did ;)
BTW: dont post! you got 909 posts, keep it;)

Image

User avatar
rv0
 
Posts: 395
Joined: Tue Jul 14, 2009 4:50 pm

Re: New CPU Project

Post by rv0 »

Altitude: any ideas?

avrdude -c usbasp -p m2561 -e -U flash:w:x0xb00t2.hex

avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: AVR device initialized and ready to accept instructions

Reading | ################################################## | 100% 0.01s

avrdude: Device signature = 0x1e9802
avrdude: erasing chip
avrdude: warning: cannot set sck period. please check for usbasp firmware update.
avrdude: reading input file "x0xb00t2.hex"
avrdude: input file x0xb00t2.hex auto detected as Intel Hex
avrdude: writing flash (261626 bytes):

Writing | ################################################## | 100% 201.24s



avrdude: 261626 bytes of flash written
avrdude: verifying flash memory against x0xb00t2.hex:
avrdude: load data flash data from input file x0xb00t2.hex:
avrdude: input file x0xb00t2.hex auto detected as Intel Hex
avrdude: input file x0xb00t2.hex contains 261626 bytes
avrdude: reading on-chip flash data:

Reading | ################################################## | 100% 129.45s



avrdude: verifying ...
avrdude: verification error, first mismatch at byte 0x1e000
0xff != 0x0d
avrdude: verification error; content mismatch

avrdude: safemode: Fuses OK

avrdude done. Thank you.

User avatar
altitude
 
Posts: 995
Joined: Wed May 11, 2005 5:17 pm

Re: New CPU Project

Post by altitude »

hmm, IIRC this is the same issue that antto had. Did you try boodloading after that via the USB after that and did you set the fuses before flashing?

Did you get the driver from here? http://www.fischl.de/usbasp/

You may want to try Bascom instead of avrdude also (http://www.mcselec.com/), I could never get the bootloader on there with avrdude (even with the avrisp mk2) and ended up using Avrstudio to do it

User avatar
rv0
 
Posts: 395
Joined: Tue Jul 14, 2009 4:50 pm

Re: New CPU Project

Post by rv0 »

Altitude wrote:hmm, IIRC this is the same issue that antto had. Did you try boodloading after that via the USB after that and did you set the fuses before flashing?

Did you get the driver from here? http://www.fischl.de/usbasp/

You may want to try Bascom instead of avrdude also (http://www.mcselec.com/), I could never get the bootloader on there with avrdude (even with the avrisp mk2) and ended up using Avrstudio to do it
Yeah seems like the same issue antto had. Tomorrow I will check if the adapter board is wired up correctly. I blindly copied what antto did. (which may explain that I get the same error ;) )

Did check the fuses using AVRFuses gui ( http://www.vonnieda.org/software/avrfuses ) didn't see an indication.
tried erasing the whole chip first too.

Don't need a driver on OSX. I tried avrdude from commandline and from the avrfuses gui. Using both a Homebrew installed avrdude and the version which comes with crosspack ( http://www.obdev.at/products/crosspack/index.html ), which (afterwards I noticed) are both 5.11.1.

I will check Bascom too if everything else fails. Thanks!

User avatar
antto
 
Posts: 1636
Joined: Thu Apr 15, 2010 3:21 pm

Re: New CPU Project

Post by antto »

yeah, here's the "adapter" i made myself
WARNING: don't laugh at my mighty skills please :?
Image
Image
those 2 jumpers and additional connections can be ignored

User avatar
rv0
 
Posts: 395
Joined: Tue Jul 14, 2009 4:50 pm

Re: New CPU Project

Post by rv0 »

Altitude wrote:hmm, IIRC this is the same issue that antto had. Did you try boodloading after that via the USB after that and did you set the fuses before flashing?

Did you get the driver from here? http://www.fischl.de/usbasp/

You may want to try Bascom instead of avrdude also (http://www.mcselec.com/), I could never get the bootloader on there with avrdude (even with the avrisp mk2) and ended up using Avrstudio to do it
So I made sure the fuses are correct (reading guests' info)
I checked for lock bits, none were set.
But still no luck.

If I find out how bascom works, I give it another go.
How do you mean using avrstudio? not with a usbasp I suppose?

This is driving me nuts.. how can something so simple be so hard :(

Thanks for the help

User avatar
altitude
 
Posts: 995
Joined: Wed May 11, 2005 5:17 pm

Re: New CPU Project

Post by altitude »

no, you need an Atmel programmer for avr studio. I use an AVRisp MKII. It seems that these cheapo clones are OK for simple AVR chips but dont work well with the bigger chips. For $8 the USBasp thing was probably worth trying but I'd say just get the AVRisp one and be done with it. I ended up spending more on "cheap" solutions than the AVRisp cost ($35)

User avatar
antto
 
Posts: 1636
Joined: Thu Apr 15, 2010 3:21 pm

Re: New CPU Project

Post by antto »

Altitude: got anything in the mail yet? :?

now, with darffader's cpu, while verification fails, when we did a memory dump, it *looks* like the data is there
the first part of the data is all 0xFF (empty) and then there is a small chunk at the very end which looks similar to the bootloader hex contents

User avatar
rv0
 
Posts: 395
Joined: Tue Jul 14, 2009 4:50 pm

Re: New CPU Project

Post by rv0 »

IT WORKS :D :D :D :D :D

So, AVRDUDE verification fails, but the data of the bootloader is there
managed to write the flash afterwards with x0xb0x2.hex
and its working fine, finally

Thanks for all the help guys!

User avatar
altitude
 
Posts: 995
Joined: Wed May 11, 2005 5:17 pm

Re: New CPU Project

Post by altitude »

Finally arrived. Must have been a shortage of rowers for the mail ships. :P

User avatar
antto
 
Posts: 1636
Joined: Thu Apr 15, 2010 3:21 pm

Re: New CPU Project

Post by antto »

finally some good news, it's hard to believe

so i guess, it was flashing the bootloader on my cpu too, but we just blindly believed "verification fail" from avrdude
and then my impatience bricked it

at least now we know the "adapter" i posted above works
and if avrdude says "verification failed" - don't trust it, do a memory dump and inspect the data, it might have just worked ;]
also a bit of advice was to add -B 100 to the commandline when flashing the bootloader in case of "dodgy data line" whatever that might mean

Altitude: i hope i haven't totally killed the thing, will cross my fingaz ;]

Pish
 
Posts: 85
Joined: Sun Jul 29, 2012 8:54 am

Re: New CPU Project

Post by Pish »

Antto: Looking good on youtube!
Is the repitch funchtion off the real 303 going to happen?

User avatar
antto
 
Posts: 1636
Joined: Thu Apr 15, 2010 3:21 pm

Re: New CPU Project

Post by antto »

what do you mean with "repitch" function?
n0nx0x2 currently has more or less everything that the TB-303 can do, plus some more
here's the progress so far: click

last week, i tried to recompile the bootloader, just to see if i can
it worked, of course
however, i noticed that the resulting code is huge

the atmega2561 has 4 options for the bootloader size:
1024 / 2048 / 4096 / 8192 bytes

so the bootloader was about more than 7000 bytes, i thought this must be wrong or something
i looked thru the code and i saw a bunch of "fancy" functions which are probably part of the "stk500" thing, but i seriously don't think are needed.. one of these functions had #include <math.h> :lol:
removed that stuff, recompiled, now the bootloader is about 2kB big

when i tried to flash it - my USBASP basically f*cked up
it did manage to erase the chip, but didn't manage to flash the hex
afterwards i tried to fix the usbasp, trying on different usb ports, windows/linux, tried even on my old PC
nothing worked, that thing simply was acting like semi-broken

then, i was advised to use my old PC's 25-pin parallel port, according to this picture:
Image
i skipped adding the resistors, because my cables were kinda long anyway
the downside of this "programmer" is that it doesn't supply 5V, but i took 5V from the (otherwise useless) USBASP
and.. it worked like a charm!
avrdude -c stk200 ....

so my recompiled ~2kB bootloader works as well
i will try to make the bootloader have some special LED pattern or something, so that you can tell whether you're really in the bootloader mode or not
8kB for a bootloader is not bad, not bad at all :mrgreen:

Locked
Please be positive and constructive with your questions and comments.

Return to “x0xm0dz”