Continue to Site

Welcome to

Welcome to our site! is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

ATMEGA8-16PI Strange Problem

Not open for further replies.


Junior Member level 1
May 23, 2007
Reaction score
Trophy points
Activity points

Hi friend,
I am in to strange problem could not understand yet. I have been working with ATMEL MCU ATMEGA8 with many projects using UART, SPI, i had no problem, but now recently, i bought few ATMEGA8 and using Internal Osc. 4Mhz but it is not working and ihave connected another device at SPI it is also not working. the MCU TX / RX not working. But when i connect my old M8 it does work fine with same codes and schematic. I checked with the BASCOM using STK-300 programmer it shows different .Calbration Chip :

Calibration0 = B0
Calibration1 = B1
Calibration2 = AD
Calibration3 = AD

What are these calibration and the new MEGA8 are different calibration which are not working but older are working fine. My project is at the final stage and now i bught 10 Mega8 and they make same problem :(

I am looking forward your support soon.


atmega8 problme

try to use external crystal and verify the chip works with your old program. the internal OSC is not reliable for serial comm. they could have +-10% variations, and you need to calibrate it first.

Some Chinese avr web saying that the new M8 chip has larger variations now, (comparing to the old one). may be this is your problem. You can try to calibrate the chip first, or just use the external crystal.

problem working with atmega8


Thanks for your reply and i think it is the problem. But would you please tell me how to calibrate the chip.

I have used the External Crystal 4MHz at Buad = 19200, it does communicate with mobile phone but:

1. Only receive does not Send data to the Mobile phone.
2. Device connected at SPI does not work. SPI clockrate = 64

What do you suggest me? Try to get another new ATEMGA8. Because my program is working fine with my Old Mega8. Actually the problem is that i will use ATEMGA16 for my further project and i need to prepare atleast 20 units so i am worry if they will have the same problem then it will problem for me.

Kindly help me.


Added after 1 hours 13 minutes:

Hi friend,

Thanks for your reply. One thing i want to tell you that i have used the Timer1 in my codes and timer1 setting is:

const Timer1Reload = 15625
config timer1=timer,prescale = 256
load timer1 , Timer1Reload
on ovf1 Timer1_isr
enable timer1
start timer1

and SPI clockrate = 64.

Do you think that Timer is making problem to control the SPI or i change the Timer1 setting.


atmega8-16pi schematic

this is due to fuse bits. By default the clock of avr is 1mhz internal clock. You have to do fuse bits to change it. See how i changed it
**broken link removed**

Bibin John

problem connect avr stk to atmega8

I had the same problem when I used internal osc. Not only with instability or should I say temperature dependance of the osc. frequency but also with the range of osc. frequencies from the same batch. Each uC had to be calibrated (the procedure is described at atmel site) and the change in temperature which was higher than 10 deegrees and I was facing the problems again ( have to recalibtrate) so I decided to use external osc.

Not open for further replies.

Similar threads

Part and Inventory Search

Welcome to