644P flashing

I’m having a go at flashing the Shruthi-1 hex to a fresh 644P so that I can test things are working with my setup (the plan being to flash all the Ambika chips). I’ve built the Shruthi hex as described in the recent tutorial thread.
I’m on Win7 32-bit. I’ve got a generic USBasp from Ebay and have wired it up to a veroboard layout with sockets for the 328 and the 644. This layout just matches the USBasp pins to the relevant socket pins. It doesn’t include a crystal as I’ve read a few bits about the internal oscillators being good enough for flashing.

I’m doing…
avrdude -c usbasp -p m644p -U flash:w:shruthi-1.hex

… and all seems to go well. It erases, takes about 20 seconds to write, and the same to verify. Apart from a ‘cannot set sck period’ warning, no errors are reported and the verification says 64728 bytes of flash verified and that the fuses are OK.

However when I put this 644P in one of my Shruthis I just get a blank display (the top line characters are slightly darker) with most of the LEDs lit, and none of the controls do anything. I’m going to give it a go on a Mac tomorrow but wondered if there was anything I’m missing…

Have you set up the fuses too?

Also, I’m curious about the 64728 number… Where did you get the .hex you are flashing?

I hadn’t set the fuses.
I’ve set up the build environment on my Mac, compiled shruthi1.hex all fine, hooked up the usbasp, and ran ‘make bake’. It did the first three fuses okay, the last one did this:

avrdude: reading input file "0x2f"
avrdude: writing lock (1 bytes):

Writing | | 0% 0.00s ***failed;
Writing | ################################################## | 100% 0.06s

then the writing of the hex failed because the target couldn’t be found (same error when no chip is present). Now no avrdude commands can communicate with the 644. I presume I’ve just trashed it?

On the 64728 size: the shruthi1.hex was compiled last weekend on Windows. I downloaded the packages manually rather than using git.

  • Have you checked what was the total firmware size? Because if it’s trying to write 64728 bytes there’s a good chance the firmware is overweight and won’t run.
  • Setting the fuses tells the chip it will run with an external high speed crystal. So you need to put a 20 MHz crystal on veroboard flashing board.

Is it possible to flash a 644p through a Shruthi ISP interface without the Shruthi being powered on?

I think that’s something I did already.

Depends on the programmer - some of them are providing power to the Vcc pin, some don’t.

My AVR ISP mkII doesn’t provide power, so I need to connect the control board to a power source for flashing.

Ooh - forgot to follow up on this thread. I added a 20MHz crystal and 22pF caps to the veroboard and was able to flash okay from Windows or OSX. I took the 0.96 hex from this site and flashed it - that worked in the Shruthi. I can post a diagram/photo of my flashing setup if anyone wants, it’s nothing amazing but it does work and was pretty cheap.

However I’ve had a bit of a journey getting to a successful build of 0.97. I kept getting the 64728 size from both Windows and OSX environments which flashed but didn’t work, and I think I’ve pinpointed this to use of the avr binaries in the Arduino bundle on both platforms.

Anyway, in Windows, I switched the avrlib tool paths to the binaries from WinAVR, and ended up with a smaller size hex that flashed okay and worked once in the Shruthi. I might experiment more with the OSX setup, however my 644 is getting a bit gnarled up. I know why people bother with zif sockets now :slight_smile: