External clock/xtal not worked in atmega328p-au 32 pin MLF package

hi everyone, i am new on this platform and in this filed. i am still learning. I design a circuit for control relay switching and drive motors. i used atmega328 as reference of Arduino nano. i just copy the nano circuit on the other board and using it, but the issue is, it not work like a Arduino nano, there is difference in clock pulse and timing, first i was think i made some circuit problem but i found that the external clock or oscillator are not working in it. I changed the capacitor of different values(12pf, 18pf, 22pf) and replace crystal(16Mhz) again and again but not success. please help me and suggest me what should i do?
I am sharing the design board image for check the hardware, tell me if i made mistake in it.

I moved your topic to an appropriate forum category @pradeepetce .

In the future, please take some time to pick the forum category that best suits the subject of your topic. There is an "About the _____ category" topic at the top of each category that explains its purpose.

This is an important part of responsible forum usage, as explained in the "How to get the best out of this forum" guide. The guide contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.

The Nano does not use a crystal, it uses a resonator.
The circuit you copied was probably wrong.
Post your schematics and parts list

Thanks for help

1 Like

i can't upload right now because i am new user in this platform. I am sharing a drive link for schematic. please follow link : Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.
for part list : Microsoft OneDrive - Access files anywhere. Create docs with free Office Online.

Please have look on it and suggest me what should i do? I already spend lots of money on this circuit. Is any solution to make them work properly?

You need to look at the data sheet for the crystal and see what load capacitors the manufacturer recommends, then make them 5pF smaller

1 Like

I checked and found 16Mhz and 22pf capacitors are best suitable as per my circuit. but when i put that in circuit there is no any change, it still uses internal clock frequency and i checked by oscilloscope, and didn't found any fixed frequency or oscillations, its shows like garbage value( 50Khz, 1Mhz, 50Hz, 4Mhz, 12Mhz, etc.). can you suggest me best solution for that problem ?

'5pf lesser' As you suggest I will work on it and update you soon, thanks.

Have you programmed the clock fuse bits correctly?
If the part is UN-programmed, it will run on the 8Mhz internal clock

Then the CPU clock selection fuses are not set correctly.

Do you know how to program it using the ICSP connection?

Is it necessary to set the CPU clock fuses for using the external oscillators, because before that I didn't do this. I had just write normal code and made a circuit as per datasheet and then it worked properly. But in this case its totally different.

Yes, I know ICSP connections, I learn it from datasheet and by Arduino platform.

Yesterday, I found that the chip I am using is: "Atmel mega328pu-th 35473d 2226pbr"

Some says this is fake ic. Its in datasheet but i shaw in 2012 datasheet there is '-pu' version available and may be th for Thailand fab.

I am not sure if my circuit is okey and same code run properly in nano board and other boards, then what is the problem? Is the microcontroller ic is issue?

The PU version is a 28 pin DIP so it's a fake
The ATMEGA328PU-TH is not a Valid Microchip catalog part number.
See post 5 here:
https://www.avrfreaks.net/s/topic/a5C3l000000Ucr6EAC/t163152

2 Likes

You can learn about how to set the fuses from the data sheet, too.

Thanks for help. Today i purchase a new ic and test it in same circuit it work properlly on same components. Thanks again.

If you have the time and it's not too much trouble, could you take a good close up picture of the fake IC, so everyone here can see what the markings look like?

Yes sure, I tried but can't able to capture complete ic part number.


Could a standalone AVR DIP chip do the job? There are many how-to make breadboard 'duino web pages that you can test quickly with parts, move directly to protoboard and only make pcb with tested circuits.

You get to try different AVR DIP chips with 6 to 40 pins and 256 bytes to 16KB RAM all with the same core CPU and ADC. Code for the 328 will run on any AVR with the same or more as the code uses, only pin numbers may change.
The AVR family that fits Uno socket is 328/168/88/48. They are all pin-compatible, just 328 has twice all memory as the 168 which is twice the 88, twice the 48. Flash 32/16/8/4K, RAM 2K/1K/512B/256B, EEPROM 1K/512B/256B/128B. All have 1 serial, SPI/I2C, ADC and PWM.

Your code may run on a cheaper AVR!

AVR chip needs power, ground, reset, 2 bypass caps and a clock source to rub. And IO of course! They're very boring without IO. AVR has an internal 8Mz clock, external source not required.

Minimal Arduino plugs into breadboard or perfboard.

1 Like

Thank You!