Hi all, I'm trying to build an arduino wristwatch using an atmega328p TQFP, using a 32.768 khz crystal and the internal 8mhz clock. My circuit, code and fuses all work fine on a breadboard, triggering an interrupt to flash a light every second and print the time on the serial port. (just a test) When i try running the same code with the same bootloader, crystal and fuses on a tqfp chip, my interrupt triggers just once. the code does not hang, it just doesn't interrupt again. i've checked my pcb for shorts and broken traces and i've tried a different chip (i still have 1 left), but all to no avail. TCNT2 seems to be stuck at 18 after the first interrupt. it did this on two separate chips.
Can anyone help me figure out what i need to do differently? i thought the tqfp package was the same, just with a couple extra analog pins available.
Thanks in advance!
I own an atmega328p TQFP mounted on my redboard https://cdn.sparkfun.com//assets/parts/9/5/1/8/12757-01.jpg and it's the same programming thing as an UNO with Atmega328P DIP, I guess it's a hardware problem.
How are you testing this tiny chip? Because it doesn't fit the breadboard so I'm curious.
Did you read the datasheet? I know it comes with 2 extra analogs but maybe some pins orientation are changed.
Is the interrupt driven by a timer or by an external action?
And what voltage are you using in both cases?
Decoupling caps?
On the breadboard i'm using a standard 28 pin dip, no decoupling capacitors. The tiny chip i solder directly to the pcb i etched for my watch. I checked thoroughly for shorts before and after populating. I have done this twice (i have a lot of pcb to cut from) with two separate tqfp chips, same fuses, same result. The interrupt (on the working breadboard) is a timer interrupt, independent from the cpu clock. the cpu is running on it's internal 8mhz source, the interrupt on a 32.768khz crystal. The target voltage is 3.7v, but during testing it's at 5v from usb. As i mentioned, the breadboard dip chip runs exactly as intended, from either power supply.
i'm not sure if it's hardware, as both tqfp chips did the same thing. they were purchased from sparkfun.com, so i'm fairly confident, though they have gotten bad batches before.
I'm close to giving up on the timer interrupt as i can just as easily wire in the pcb from an analog wall clock and use a pin change interrupt for the timer, it's just an inelegant solution.