I'm trying to setup a serial of AtMega8's but I've run into some trouble.
I've successfully programmed the minimal Arduino bootloader from TodBott . I managed to setup the fuses and everything is working correctly with the exception of programming through UART. I can happily use my STK500 clone through WinAVR (doesn't work through the Arduino IDE for some reason), I've even uploaded a blink hex to make sure it's working correctly - no problems.
...but I can't set the lock & unlock bits per the boards.txt file:
The "unlock" bits are just the value that's written to the lock bits before burning the bootloader. Then the "lock" bits are written after burning the bootloader.
That's what I presumed also. AVR Studio let's me specify the lock bits but as there are seperate bits to unlock and lock the bootloader I assumed I would need to add these seperately?
It's very strange, I can write compiled programs via the ISP. Even use Serial.write to dump to UART but I cannot upload to the AtMega8.
It could have been an oversight but I did notice that I actually had to connect at a faster rate than I specified on the AtMega8 "Serial.begin(9200)", infact I had to connect at 19200 on the host.
Could that be related or is that just an oversight. I'm wondering whether the MCU is running at a higher clock rate than it should.
I've successfully programmed the minimal Arduino bootloader from TodBott. I managed to setup the fuses and everything is working correctly with the exception of programming through UART.
As long as upload through UART is not working, you don't really know if the bootloader is ok or not. Some issues to check:
The bootloader must be compiled for the crystal/osscillator used (the F_CPU define). If you only have a precompiled ".hex" file you must use the crystal/osscillator specified for the bootloader.
The upload speed will be hardcoded within the bootloader (you need to know what this speed is). Also this will only be ok if you get item "1" right.
You need to program the fuses to match your required crystal/osscillator (otherwise "1" and "2" will be wrong).
You need to know how to invoke the bootloader (auto-reset or manual-reset).
When the above is ok you should look at the output from an Arduino/avrdude upload session for errors/hints on other issues.
I am actually simple reusing the guide from Todbotts site.
The AtMega 8 (and bootloader above) is supposed to use the internal 8mhz oscillator. I believe he changed the UART to transfer at 384xxx rather than the slower 19200.
As far as the fuses go, I've litrally copied that from the "boards.txt" file which Toddbott provided.
#4, that's an interesting though. I believe he's set it up for manual programming. I've tried hitting reset prior to uploading (many times) but no joy.
Does anyone know of any vanilla AtMega8 bootloaders which use the internal Oscillator?