Go Down

Topic: Made a breadboard adapter for ATMega328PB TQFP (Read 347 times) previous topic - next topic

wilykat

Jul 15, 2018, 03:01 pm Last Edit: Jul 15, 2018, 03:12 pm by wilykat
I know of Pro Mini and Nano but they all are generally based around older versions of ATMega328.  The B version was released a few years ago and it has 2 major changes.  A6 and A7 are fully functioning GPIO and not a lame analog input only pins. Also the chip added D23 and D24.  Since this chip isn't supported by stock Arduino IDE, one will need to download and install Minicore to add a few useful features along with ATMegaxx8PB support.

However this chip does not come in DIP form at all.  Only in TQFP and VFQFD, neither that will work in a breadboard.  Now I could have simply taken an easy way and used an existing TQFP to DIP PCB that are almost dime a dozen but I wanted to have:
*built in decoupling capacitors
*built in pullup resistors for I2C (optional)
*built in ISP headers
*built in pullup resistor for reset (required with ISP)
*built in D13 LED
*built in crystal (optional)
*and built in power LED so I don't accidentally do stuff while it's on!

Built in crystal oscillator is more of necessity because of parasitic capatence on breadboard + longer length from the chip to the crystal and 2 capacitors. By having the pads on the PCB, the length is kept very short.

Also there's jumper pads to isolate these 2 pins (chip pin 7 and 8.) from breadboard connectors.  If you use external crystal, leave the pads unpopulated, no connection to breadboard means less parasitic capacitance and other noise to screw the clock signal. If you choose to have the chip run with internal oscillator only, populate the jumper pads to connect the 2 pins to 2 breadboard connectors and gain D20 and D21!

Built in I2C pullup resistor means no more having to remember to add resistors when wiring up something and wondering why it doesn't work.

Built in decoupling capacitors to get those out of the way, free up little space on the breadboard.

Lastly, while the PCB was originally designed to work with ATMegaxx8PB, it can have any other TQFP-32 xx8 variants. Pin 3 and pin 6 has pad to connect to GND and VCC plus spot for another decoupling capacitor. Doesn't cost anything to add 3 pads.

Size comparison with a 40-pin Z80 CPU:

I wanted to keep the PCB close to a typical 32 pin DIP IC, and this is as small as I can get without breaking design rules.


1 fully assembled, one partial, and both sides of unpopulated PCBs. I have not cleaned the assembled boards yet so it's covered in rosin residue. I finished assembling the 8MHz internal version and partially finished the 16MHz external version. I am still waiting for SMD crystal to show up.

I do need to make one tiny change. 1k resistor for amber LED (D13) is fine but 1k resistor for green LED (power) is too frickin' bright. Both LEDs had the same spec but I didn't check in mcd rating and green is much brighter than amber.

Programmed the 8MHz internal clock version via USB ISP programmer (I used USBTinyISP) and it responded correctly. Wired them with all D pins to LED arrays and uploaded a sketch that lit one LED at a time:
https://www.youtube.com/watch?v=mtXAMXK3br0

All D pins excluding D22 worked as expected, togging high and low. (D22 is reset, I am not changing it) The internal clock design gives me a total of 26 usable GPIO with reset enabled. I have not checked for analog or PWM yet but they should be working if Digikey didn't send me defective chip.

FYI D20 and D21 is available only when using internal clock, D22 is reset pin and should not be changed if you intent to reprogram them. Otherwise you will need a HV programmer to reset and reprogram!  D23 and D24 is exclusive to xx8PB version, it is GND and VCC on other versions.

As far as I can tell, the board design is fine for internal clock programming. When the crystal arrives, I'll update this post with the result.

I used PCBWay for the fab ($12 for 10 plus epacket shipping to USA) , the silkscreen is a bit fuzzy so one star minus for this. It's likely they used rather thin and runny paint for silkscreen which allowed edge bleeding before it dried.  OSHPark is $7.00 for 3 and they are of much better quality.

The files and BOM will be released when I can verify there's no issue running 16MHz oscillator.  The version I made uses 0805 SMD resistors, capacitors, and LED. I have files that uses 0603 parts instead for people who may have them and prefers to use smaller SMD components.

spycatcher2k

Just a small side note, D13 LED should be driven through an OPAMP, to reduce the current consumption from the D13 pin. This would allow you the full 40mA from the pin if required.
Mrs Drew
-=-
http://www.uk-pcb.co.uk - UK PCB Fab Company
I will design & code for you, but I will also charge you (PM me)
If you don't like my answers, realize : I'm not being cheeky, I'm Just trying to prompt you to use your own brain/google etc.

wilykat

Just a small side note, D13 LED should be driven through an OPAMP, to reduce the current consumption from the D13 pin. This would allow you the full 40mA from the pin if required.
Yeah, this was added in Uno R3. Earlier Arduino boards had the LED directly connected to pin.  There isn't much room on the board for an op amp that I can hand solder in, but would a single transistor do? Currently with 1k resistor amber LED is getting around 1.8mA to light up. (green LED is directly between VCC and GND with an inline resistor so not drawing from the pin)

larryd

No technical PMs.
The last thing you did is where you should start looking.

westfw

#4
Jul 17, 2018, 09:07 am Last Edit: Jul 17, 2018, 09:07 am by westfw
Very nice.

If you change the "elongation" of the oval-shaped pads, you'll get a bit extra space without sacrificing much at all; those fully-elongated pads are a throwback to a different era, although I do like the pads for connectors to be a bit larger than normal.

Here's a board with "35% elongation" (for EAGLE, available in the "shapes" part of the DRC menu.)
(You can also change everything to "round", if you prefer.)

wilykat

Is there a math equation I can use to compute optimal pad size? Those pads are high stress area as the pin headers are going to get inserted and removed a number of time. Cheaper PCB may fail with small pads and separate, tearing traces or breaking connection.

larryd

#6
Jul 17, 2018, 11:51 pm Last Edit: Jul 17, 2018, 11:54 pm by larryd
If pads are on both sides connected with a plated through hole, a soldered pin is extremely resilient.



No technical PMs.
The last thing you did is where you should start looking.

Go Up