I'm working on a project for my car which involves a OLED-display, CAN-controller and an ATMega-chip. Everything was programmed and tested on an Arduino MEGA2560, so the next step was to design a custom circuit board to fit all the components. Having done that, and received all components a couple of days ago, i assembled my first board, but can't get the microcontroller to wake up at all.
The microcontroller is a ATMega328PB (datasheet)
On the board i have connected a 16MHz crystal to XTAL1 & XTAL2 and the correct 22pF capacitors to GND:
I first got random device signatures when trying to burn bootloader, and it of course failed because of that. But maybe two-three tries and i started getting only 0x000000 as signature so the chip seemed dead to me. I then measured the crystal with an oscilloscope, and the only place where i could find a waveform signal was on the GND-side of both 22pF capacitors:
After that i soldered another ATMega328PB-chip on the board, but it constantly replies with 0xffffff.
I also have a TQFP32-programming socket/breakout board, so i mounted my last ATMega328PB-chip on it, and made the SPI-connections. I didn't have any spare 16MHz oscillators (well, i do but only SMD) so i didn't hook up any to it, yet. But it doesn't give any response either (0xffffff), although the processor should have built-in crystal?
I'm a little lost here now, because my goal is to use the ATMega328PB (whole circuit board is designed for it) and for some reason my project stalled here now.
I'm using Arduino MEGA2560 as ISP, and have been programming some 328p:s with it in the past, but it's been around for a while and through all kind of molesting, so i ordered a USBASP programmer now.
The circuit board itself has only a SPI-connection so i really don't need a bootloader, because i will be uploading the sketches straight through the SPI (no UART).
I'm pretty sure i have to buy more ATMega328PB:s, but i wouldn't want to break them also...