Hi friends,
I updating sketch from UNO to Atmega8 and I found another problem.
This my sketch is running on 8MHz crystal oscillator. I use HW serial port in my sketch. On 328P everything run OK.
I found on internet boards.txt file modification for ATmega8 with 8MHz internal CLOCK. I added to boards.txt my own definition for ATMega8 with crystal on 8MHz (I changed oscillator fuse bytes for external Xtal).
Now I compiled sketch and run program. I have 19200 bps serial speed definition in sketch, but real speed is only 2400 bps.
Why?
My custom boards definitions :
##############################################################
atmega8noxtal.name=MY ATmega8-noxtal @8MHz
atmega8noxtal.upload.protocol=stk500
atmega8noxtal.upload.maximum_size=7168
atmega8noxtal.upload.speed=38400
atmega8noxtal.bootloader.low_fuses=0xe4
atmega8noxtal.bootloader.high_fuses=0xc4
atmega8noxtal.bootloader.path=atmega8_noxtal
atmega8noxtal.bootloader.file=ATmegaBOOT.hex
atmega8noxtal.bootloader.unlock_bits=0x3F
atmega8noxtal.bootloader.lock_bits=0x0F
atmega8noxtal.build.mcu=atmega8
atmega8noxtal.build.f_cpu=8000000L
atmega8noxtal.build.core=arduino
atmega8noxtal.build.variant=standard
##############################################################
atmega8xtal.name=MY ATmega8-xtal @8MHz
atmega8xtal.upload.protocol=stk500
atmega8xtal.upload.maximum_size=7168
atmega8xtal.upload.speed=38400
atmega8xtal.bootloader.low_fuses=0xff
atmega8xtal.bootloader.high_fuses=0xc4
atmega8xtal.bootloader.path=atmega8_noxtal
atmega8xtal.bootloader.file=ATmegaBOOT.hex
atmega8xtal.bootloader.unlock_bits=0x3F
atmega8xtal.bootloader.lock_bits=0x0F
atmega8xtal.build.mcu=atmega8
atmega8xtal.build.f_cpu=8000000L
atmega8xtal.build.core=arduino
atmega8xtal.build.variant=standard
OK, I accept some transmit errors with use of internal RC oscillator. But why communication speed is only 2400 bps? Is some difference in configuration bits in UNO 328 atmel and Atmega 8 ?
BTW : I use HW ISP programator, I don´t need and use bootloader function.
Many thanks for some help,
Petr