Nick can you help?
I have been trying to use yout sketch.
I was having problems with my hardware so to easy things and speed up diagnostics, i mounted your setup: an arduino UNO, SDCARD and arduino MEGA.
Untill the moment i´m able to run the sketch on the UNO and see the files in the SDcard. When i tried to program it, it gave me a lot of verification errors, i think that that might be because of the fuses setup or something like that.
So after that i tried to Read the memory to the card. I was expecting that the 2 files (Blink.exe and BREAD.HEX (file read) ) would be equal, but instead they were very different. I´m posting the files so ppl can compare:
Do you have any ideas for the verification errors and the files comparation?
I´m posting the results i get on the serial monitor when running the program first time:
Atmega hex file uploader.
Written by Nick Gammon.
Version 1.9
Reading SD card ...
step1
HEX files in root directory:
BLINK.HEX : 4542 bytes. Created: 2012-08-03 17:44:42. Modified: 2012-08-03 16:14:42
BREAD.HEX : 622639 bytes. Created: 2012-08-03 17:44:42. Modified: 2000-01-01 01:00:00
step2
--------- Starting ---------
Attempting to enter programming mode ...
Entered programming mode OK.
Signature = 0x1E 0x98 0x01
Processor = ATmega2560
Flash memory size = 262144 bytes.
LFuse = 0xFF
HFuse = 0xD8
EFuse = 0xFD
Lock byte = 0xFF
Clock calibration = 0xA8
Actions:
[E] erase flash
[F] modify fuses
[L] list directory
[R] read from flash (save to disk)
[V] verify flash (compare to disk)
[W] write to flash (read from disk)
Enter action:
and the verification errors when writting:
Choose disk file [ ] ...
BLINK.HEX
Processing file: BLINK.HEX
Checking file ...
Lowest address = 0x0
Highest address = 0x647
Bytes to write = 1608
No bootloader.
Suggest making high fuse = 0xD9
Attempting to enter programming mode ...
Entered programming mode OK.
Processing file: BLINK.HEX
Erasing chip ...
Writing flash ...
#######
Written.
Processing file: BLINK.HEX
Verifying flash ...
Verification error at address 0. Got: 0x00 Expected: 0x0C
Verification error at address 1. Got: 0x00 Expected: 0x94
Verification error at address 2. Got: 0x01 Expected: 0x0C
Verification error at address 4. Got: 0x02 Expected: 0x0C
Verification error at address 5. Got: 0x02 Expected: 0x94
Verification error at address 6. Got: 0x03 Expected: 0x2E
Verification error at address 7. Got: 0x03 Expected: 0x01
Verification error at address 8. Got: 0x04 Expected: 0x0C
Verification error at address 9. Got: 0x04 Expected: 0x94
Verification error at address A. Got: 0x05 Expected: 0x2E
Verification error at address B. Got: 0x05 Expected: 0x01
Verification error at address C. Got: 0x06 Expected: 0x0C
Verification error at address D. Got: 0x06 Expected: 0x94
Verification error at address E. Got: 0x07 Expected: 0x2E
Verification error at address F. Got: 0x07 Expected: 0x01
Verification error at address 10. Got: 0x08 Expected: 0x0C
Verification error at address 11. Got: 0x08 Expected: 0x94
Verification error at address 12. Got: 0x09 Expected: 0x2E
Verification error at address 13. Got: 0x09 Expected: 0x01
Verification error at address 14. Got: 0x0A Expected: 0x0C
Verification error at address 15. Got: 0x0A Expected: 0x94
Verification error at address 16. Got: 0x0B Expected: 0x2E
Verification error at address 17. Got: 0x0B Expected: 0x01
Verification error at address 19. Got: 0x0C Expected: 0x94
Verification error at address 1A. Got: 0x0D Expected: 0x2E
Verification error at address 1B. Got: 0x0D Expected: 0x01
Verification error at address 1C. Got: 0x0E Expected: 0x0C
Verification error at address 1D. Got: 0x0E Expected: 0x94
Verification error at address 1E. Got: 0x0F Expected: 0x2E
Verification error at address 1F. Got: 0x0F Expected: 0x01
Verification error at address 20. Got: 0x10 Expected: 0x0C
Verification error at address 21. Got: 0x10 Expected: 0x94
Verification error at address 22. Got: 0x11 Expected: 0x2E
Verification error at address 23. Got: 0x11 Expected: 0x01
Verification error at address 24. Got: 0x12 Expected: 0x0C
Verification error at address 25. Got: 0x12 Expected: 0x94
Verification error at address 26. Got: 0x13 Expected: 0x2E
Verification error at address 27. Got: 0x13 Expected: 0x01
Verification error at address 28. Got: 0x14 Expected: 0x0C
Verification error at address 29. Got: 0x14 Expected: 0x94
Verification error at address 2A. Got: 0x15 Expected: 0x2E
Verification error at address 2B. Got: 0x15 Expected: 0x01
Verification error at address 2C. Got: 0x16 Expected: 0x0C
Verification error at address 2D. Got: 0x16 Expected: 0x94
Verification error at address 2E. Got: 0x17 Expected: 0x2E
Verification error at address 2F. Got: 0x17 Expected: 0x01
Verification error at address 30. Got: 0x18 Expected: 0x0C
Verification error at address 31. Got: 0x18 Expected: 0x94
Verification error at address 32. Got: 0x19 Expected: 0x2E
Verification error at address 33. Got: 0x19 Expected: 0x01
Verification error at address 34. Got: 0x1A Expected: 0x0C
Verification error at address 35. Got: 0x1A Expected: 0x94
Verification error at address 36. Got: 0x1B Expected: 0x2E
Verification error at address 37. Got: 0x1B Expected: 0x01
Verification error at address 38. Got: 0x1C Expected: 0x0C
Verification error at address 39. Got: 0x1C Expected: 0x94
Verification error at address 3A. Got: 0x1D Expected: 0x2E
Verification error at address 3B. Got: 0x1D Expected: 0x01
Verification error at address 3C. Got: 0x1E Expected: 0x0C
Verification error at address 3D. Got: 0x1E Expected: 0x94
Verification error at address 3E. Got: 0x1F Expected: 0x2E
Verification error at address 3F. Got: 0x1F Expected: 0x01
Verification error at address 40. Got: 0x20 Expected: 0x0C
Verification error at address 41. Got: 0x20 Expected: 0x94
Verification error at address 42. Got: 0x21 Expected: 0x2E
Verification error at address 43. Got: 0x21 Expected: 0x01
Verification error at address 44. Got: 0x22 Expected: 0x0C
Verification error at address 45. Got: 0x22 Expected: 0x94
Verification error at address 46. Got: 0x23 Expected: 0x2E
Verification error at address 47. Got: 0x23 Expected: 0x01
Verification error at address 48. Got: 0x24 Expected: 0x0C
Verification error at address 49. Got: 0x24 Expected: 0x94
Verification error at address 4A. Got: 0x25 Expected: 0x2E
Verification error at address 4B. Got: 0x25 Expected: 0x01
Verification error at address 4C. Got: 0x26 Expected: 0x0C
Verification error at address 4D. Got: 0x26 Expected: 0x94
Verification error at address 4E. Got: 0x27 Expected: 0x2E
Verification error at address 4F. Got: 0x27 Expected: 0x01
Verification error at address 50. Got: 0x28 Expected: 0x0C
Verification error at address 51. Got: 0x28 Expected: 0x94
Verification error at address 52. Got: 0x29 Expected: 0x2E
Verification error at address 53. Got: 0x29 Expected: 0x01
Verification error at address 54. Got: 0x2A Expected: 0x0C
Verification error at address 55. Got: 0x2A Expected: 0x94
Verification error at address 56. Got: 0x2B Expected: 0x2E
Verification error at address 57. Got: 0x2B Expected: 0x01
Verification error at address 58. Got: 0x2C Expected: 0x0C
Verification error at address 59. Got: 0x2C Expected: 0x94
Verification error at address 5A. Got: 0x2D Expected: 0x2E
Verification error at address 5B. Got: 0x2D Expected: 0x01
Verification error at address 5C. Got: 0x2E Expected: 0x0C
Verification error at address 5D. Got: 0x2E Expected: 0x94
Verification error at address 5E. Got: 0x2F Expected: 0x4A
Verification error at address 5F. Got: 0x2F Expected: 0x01
Verification error at address 60. Got: 0x30 Expected: 0x0C
Verification error at address 61. Got: 0x30 Expected: 0x94
Verification error at address 62. Got: 0x31 Expected: 0x2E
Verification error at address 63. Got: 0x31 Expected: 0x01
Verification error at address 64. Got: 0x32 Expected: 0x0C
Verification error at address 65. Got: 0x32 Expected: 0x94
Verification error at address 66. Got: 0x33 Expected: 0x2E
1604 verification error(s).
First 100 shown.
No bootloader.
Setting high fuse = 0xD9
Done.