As programmer I use the Pololu USB AVR Programmer v2.1 which works with another board, so the programmer seems to be fine.
When trying to flash the bootloader or setting fuses, I always get the same error from AVRdude. Trying to burn the bootloader from Arduino IDE 2.2.1 with following settings:
checked all connections with a multimeter multiple times
checked if the connections are correct (MOSI - MOSI, MISO - MISO, ...) multiple times and compared it with the development board that does work
tried lowering bit clock frequency to all kinds of values (125kHz to as low as 10kHz) and checked with oscilloscope that changed value has an effect
checked for presence of signal at MISO and MOSI pins directly at the chip with an oscilloscope
checked voltages: 3.3V at VCC and VCCA
desoldered other components from PCB - radio module and oscillator are currently desoldered
thought about replacing the chip - but as two boards show the same behaviour, one of which was soldered at very low temperature (weird PCB printer), it seems unlikely the chip is fried
more desperate things I can not remember right now
Please let me know your ideas on how to get a bootloader on this chip or any steps to diagnose I might have missed. Any help is much appreciated.
A brand new, genuine ATmega328xx comes with the fuses set to internal RC, CKDIV for a 1 MHz clock, so check that the programmer frequency is set to 250 kHz or less. Edit: I see you have tried that.
There are lots of problems with that schematic, so I'm not surprised that the board doesn't work. What are all the 1K resistors to GND supposed to be doing? Especially the one on AREF, which should be a 10 to 100 nF capacitor.
If J2 is the ICSP header, then it looks to be wired incorrectly - assuming a standard ICSP pinout.
GND and VCC are on the same row/column as MOSI. What footprint did you assign to the pin header?
Off the top of my head, I don't think any of the standard Kicad 2x3 pinheader footprints will give you the correct pinout with the pin assignments you have.
There are lots of problems with that schematic, so I'm not surprised that the board doesn't work.
Any other problems apart from the pull down resistors? The 328pb's datasheet suggests using those on empty pins when optimizing for power consumption. I guess for first tests, we should have left them out.
I will desolder the one on AREF and try again. If that does not help, I will desolder the other pull down resistors as well. Will report back as soon as possible. Not sure if I have access to the lab on the weekend.
That's a good catch, but I am not using the 2x3 header I should be using yet. It's a 1x6 header and I had to butcher a cable and solder it to a different connector to use it. Will fix this on the next iteration. While it's not pretty, I'm 99% sure the connections are correct.
I think the normal approach / path to using a MCU is to first get an upload working on a breadboard, then move to a soldered prototype, and only then move to a custom PCB. Now do you know if the RFM module is not in active mode for instance. Probably not, but now there are so many variables that it will be really hard to troubleshoot.
I have now desoldered all the pull down resistors and swapped the chip for a new one with no result. The programmer still acts as if nothing was connected at all.
I think the normal approach / path to using a MCU is to first get an upload working on a breadboard, then move to a soldered prototype, and only then move to a custom PCB.
That's probably true, should have started out that way. The first batch of microcontrollers was from Aliexpress and we are getting suspicious they might be counterfeits. So I just ordered five more from a trusted german vendor plus a breakout adapter to test on a breadboard.
Now do you know if the RFM module is not in active mode for instance. Probably not, but now there are so many variables that it will be really hard to troubleshoot.
As stated in my original post, the radio module as well as the oscillator are currently desoldered.
Those little green squares would indicate that those pins are not connected.
True, that's weird. The connections are there, though. Tested them all from the pins of the programmer to the microcontroller legs with a multimieter. When moving the labels in kicad, they stay connected. Not sure why it shows those boxes.
Time to show us the gerber files i think.
Here's a screenshot of the PCB. Or would you like the actual Gerber Files?
Could be that there is another small section of wire that is left open somehow,
That is all that matters really.
that is possible, but not all that likely. A DP 28-pin version would be really practical for testing though.
The programmer could also be at fault of course. Do you have an Arduino you could use with the ArduinoISP sketch ? Again of course that means testing with something that you have not used before and therefore do not know if it actually works. Unless you have successfully programmed MCU's through the IDE using ISP, you will still be stuck with multiple possible causes.
I have successfully flashed a new bootloader onto a development board with a 328pb. It already had a bootloader and fuse settings on it though, so it's not exactly the same. But it should prove that the programmer itself works. I have also confirmed that a digital signal is present at the relevant pins with an oscilloscope while trying to flash. I am completely running out of ideas here and start to hope the chips are counterfeit and it just works with the new ones.
I've also tried using some device detection Sketch on a Pololu A-Star 328PB Micro before with no result. I guess I could try running the ArduinoISP sketch on the Pololu board as well, but for now I'll wait for the new chips.
Not completely sure what you mean. The external oscillator runs at 8 MHz but is currently desoldered. To my understanding, it should not make a difference with the factory fuse settings, though.
With factory fuse settings, it should run off the internal oscillator, which runs at 8 MHz and with the clock divider of 8 enabled, resulting in a CPU clock of 1 Mhz. Yes, I believe it should run on 3.3V.
I have had much the same issue getting a 328PB to work. I have found that unlike the 328P it MUST have a .1uf decoupling capacitor and a 10uf ON the +5 line. The programmer I use has them built in and I can easily program them and have it run, but as soon as I try to get them to work on their own......NO. It took a LOT of testing to finally discover the issue and verify it takes care of the issue.
Thank you, but could you please explain more? Do you mean, that there should be a 10uf capacity before the microntroller VCC, or on the line to the voltage regulator from the battery?