I am developing a board and looking to use a atmega16-16 due to its increase in I/O.
I have got a bootloader work for the atmega16 via an ICSP, but I am having trouble
using the atmega8u2 to program my atmega16.
I used the flip program to load the uno hex file onto the atmega8u2
Arduino IDE sees the chip as an uno and has assigned it a port
I upload my sketch and get the error
avrdude: stk500_getsync(): not in sync: resp=0x25 when I connect the TX and RX without a 1k resistor inbetween
and
avrdude: stk500_getsync(): not in sync: resp=0x30 when I connect the TX and RX lines with a 1k resistor inbetween
I guess my concern and lack of understanding is about the how the 8u2 functions. Will it
blindly send data via the UART or do I need to specify my model of the atmega in some way.
I have done some trail and error. I have proven that I can upload a sketch with a serial.print command through icsp and see it outputted through an arduino I use as a COM bridge, but when I hook up my onboard usb-uart I just get nonsense in my serial monitor. I can see something which is a start, which makes me think its the baud rate, but why would the arduino 8u2 bootloader I flashed onto my 8u2 be a different baud rate then the 16u2 bootloader I have on my arduino?
A separate problem I am having is neither my onboard usb-uart 8u2 or the 16u2 on my arduino can program my chip via uart.
99% of USB-UART converters can use different baud rates, so don't think of that as a problem. If the 8u2 on the Uno is working and the other one isn't, then maybe it is configured as something else. Try reflashing the firmware with FLIP.
I discovered my error was with my baud rates. I am not sure if its the bootloader for the UART to serial mirco or on the main mirco's side, but there was a 8X difference in my baud rates. I have read this to be a common problem in serial communication situations, it took my this long to figure it out....
Sounds like the fuses were not burned to change the system clock divide by 8 fuse to not have the divide by 8 used ( divide by 8 is factory default). I've done that to myself lots of times.
Thanks for that comment, I forget exactly what was driving that divide by 8 deal. After doing some quick digging I figured out the typical FUSE setting to address the divide by 8 phenomenon is called the "CKDIV8" bit. I am confused I see for the atmega48 and the attiny this is bit no. 7 of the lower fuse.
Attached are the tables describing the fuses for the ATMEGA16 and I don't see this bit labeled on either table.
That guy's walkthrough doesn't make a bootloader. It guides you through using the Burn Bootloader function of the IDE to upload a do-nothing sketch while setting the fuses. So you have no bootloader, basically a blank chip with the fuses set.