Breadboard compatbile ATmega1284P board with V-USB

Hi guys,

I've been working on a car project, starting with an Atmega328P Arduino and quickly realizing that the 32KB of flash and 2KB of SRAM were not going to cut it, and so I decided to use an Atmega1284P.
I decided to design my own board which would suit my needs. Now that I have received the first batch of PCBs, put one together and tested it, I wanted to see if there's any interest for such a board in the Arduino and DIY community, since support for the Atmega1284P can be added to the Arduino IDE quite easily.

Key features of this board are:

  1. Breadboard compatible. It fits into a standard breadboard leaving 1 column on one side and 2 columns on the other side. It has 2x19 pin headers. All 32 IO pins of the Atmega1284P are exposed.
  2. V-USB circuitry is integrated. Pins PB0 and PB1 were chosen for this purpose.
  3. Powered from USB. 5V can also be supplied by connecting it to the VCC pin. I'm also considering making a daughter board with a DC jack and a 5V regulator to provide external power, if there's a demand for it.
  4. Onboard 0.8 - 1A 3.3v LDO voltage regulator. Since the only heatsink is a small area of copper on the PCB itself, the continuous current draw limit will be much lower than 1A.
  5. A ferrite bead for extra filtering of the voltage going to the analog power supply pin.
  6. A 3.3v bi-directional level-shifter for the I2C (with built in pullups), uni-directional SPI (MOSI, SCK, SS) and UART (PD3/TXD1, PD4/XCK1) buses, pin PB3 is also level shifted to 3.3v as outputs only, this way up to 4 3.3v SPI slave devices can be used.
  7. USBASP bootloader so that sketches can be flashed without an external programmer, right from Arduino IDE.
    8 ) An extra tactile switch to activate the above mentioned bootloader.
  8. A 16MHz or 20MHz crystal can be used (tested with 12MHz, as that the only xtals I have at the moment).
  9. A 500mA polyfuse. A Schottky diode is used to protect the USB power supply against external power supplies.
  10. The ISP header can also be used as an SPI header. This is controlled by a jumper.
  11. Power and USB activity LEDs.
  12. A pin with a 1Kohm pulldown resistor.
  • The above specifications are for the next board revision.

Here are a few pictures of the assembled board: (click to enlarge)
The front

The back

since theres no like button, i have to make a post :smiley:

its a cool thingy!
as you know i also use the 1284p a lot, and i like breadboards :smiley:

good job!

Is the 1284P being run at 3.3vdc? It sounds like it is. If so running the chip at it's higher clock ranges is outside the AVR specifications. It would seem to me to be more useful if the board could run at either 5vdc or 3.3vdc selected with a simple jumper clip or small slide switch.

My plan was to keep the board/Atmega running at 5v but also have 3.3V IO (I2C and SPI), so here's how it works:
The Atmega is running of 5V, or more accurately, the VCC. It expects regulated 5V input.
The 3.3v LDO regulator is connected to the 3.3V pin and 2 voltage level shifters:
I've added a 4050 hex buffer, it has 6 ports, for 6 outputs: MOSI, SCK, SS, PB3, PC2, PC3.
There is also a 3.3v I2C bi-directional shifter based on two FETs. This level shifter already has pullups for the 3.3v side. So basically you can use this board with any combination of 5v or 3.3v I2C/SPI slaves.

And it's even pretty...

Nice project Sir. Hey, are you going to give Crossroads a bit of competition :smiley: :smiley:

Not so - mine will take shields :slight_smile:
And if you smoke the chip, it can be replaced. Also runs at 16 MHz, not 12.

Is more like this one tho.

I know that yours is really "the coolest" Crossroads :smiley: I was just trying to give the guy a bit of confidence. Yes, SMD really sucks when it comes to ease of replacement

Thanks Pedro147.
I've seen CrossRoads's boards, but I just needed something different. I also want to learn so designing and building my own boards seemed like a good idea. It was also cheaper this way for me.
My board has a 12MHz XTAL simply because it's the only one I had on hand when I was putting it together. Since the MCU is running off of 5v USB it should not have any issues with running at 20MHz, and that's the plan.
Arduino compatibility was not a very big priority for me either, but it should work just fine with Arduino. Also the integrated USB port makes external programmers unnecessary.

Pedro147: I agree on the suckiness of SMD, today I really wished I had a hot air rework station as I think I fried an ATmega328P on another board I'm working on, and there's no easy way to remove it without damaging the chip. I'm not 100% sure it's dead so I want to test it, but I need to find a way to remove it safely first.

Despite my jovial patter with Crossroads re the respective merits of both your boards - they're both great :smiley: I just recently started using Eagle with Crossroads assistance but SMD is something that I will hopefully tackle in the new year. Off topic but was that you I saw on #arduino IRC earlier on today? If so, gee you guys can type fast :open_mouth:

Nice board! A remark if I may: Why do you need 5V? For what?
Atmega1284p works fine @16MHz and 3V3. I think 4050 is slow for SPI (8MHZ clock), so get rid of it. The same for I2C translator..
And you will have no problems connecting 3V3 devices straight (sdcards, i2c stuff, etc).
The idea with usbasp V-usb: does it work already with arduino stuff?

@ Pedro147:

Yeah I'm in #Arduino IRC, so it's quite possible that you saw me there.
I also thought the SMD is hard, but it really isn't. As long as you stick to 0805 passives (0603 aren't that much more difficult), TQFP, SOIC and SOT23 packages or larger, there's really nothing to it. You do need a decent soldering iron, and a hot air rework station can be a very good idea if you ever need to take an IC off a board safely and easily.

@ pito:

You have a point, I thought about it as well. But I'm working on a project which uses both 3v3 and 5V components. According to the datasheet, the 4050 should be fast enough for SPI data transfers. I haven't tried 8MHz yet, as all of the SPI peripherals I have here are rated for up to 4MHz and it works fine at that speed.
The project I'm working on isn't anywhere near being close to final so I may still change my mind further down the road.
Either way, even though the ATmega will probably do fine at 3v3, it's still being run out of spec. In the PC overclocking world it's called undervolting, which is usually done to reduce power consumption and heat dissipation of a processor without sacrificing performance. For the most part it's a good thing, but without running the chip through vigorous testing, you can't say for sure that it is 100% stable. This means that, in theory, it can crash any time. If you intend to integrate your design into an actual product this really isn't a good way to go.

If you look up 'USBASP loader' you will see what I'm talking about. When you enter the bootloader, the computer recognizes the device as a USBASP programmer, so you can simply select USBASP programmer in the Arduino IDE and program the chip directly. The downside of this implementation is that It requires you to manually reboot the device to enter into this bootloader mode, so it isn't completely seamless like an actual Arduino where you just click Upload

I finally figured out what was wrong with my attempts to get the USBasp bootloader to work correctly on this board, fixed it and now sketches can be easily uploaded to the board directly via USB. It's also much much quicker than what we're used to with Arduinos. A 32.8KB sketch takes less than 8 seconds to upload and verify. It's considerably quicker than using a standard USBasp programmer.

A this point, the bootloader takes up 2186 bytes. So I'm using the 4kb bootloader section option. I've got to see if there's any chance of getting the size down to or below 2048 bytes so that the 2kb bootloader section could be used to leave 126KB of flash for sketches.

And if you smoke the chip, it can be replaced. Also runs at 16 MHz, not 12.

A definite plus with an expensive MCU like the 1284p. I smoked the first pro mini I bought in the first day by connecting 12v to vbus instead of vin. I've thought about trying to remove the 328p-au and solder another on, but I can get 10 pro minis shipped from China for $25.70, so it's not really worth it.
If it were the 1284p-pu, which goes for $6.79 + shipping in qty 10 from mouser, I'd be replacing the chip.

There is no doubt that a DIP package is easier to replace, but sometimes form factor or layout takes precedence.
Also, if you have the right tools (hot air) replacing an SMD package is not that big of a deal.

Also, if you have the right tools (hot air) replacing an SMD package is not that big of a deal.

I guess it's worth a try. Any tips for avoiding solder bridges when dealing with 0.8mm pitch QFPs?
My other problem is the pro mini is a bit more cramped than your board layout, so removing the QFP will be difficult without bumping an adjacent resistor or cap.

Do you have a pic\link to the Pro boards? Either way I really don't think it's worth replacing the ATmega on these, as it's cheaper to just replace the board itself than mess with replacing the MCU.
With a hot air smd rework station you can remove chips pretty easily. And if you get some solder paste, soldering one back in place should be just as easy. I don't have one yet, so I'm using a 936 soldering station, with the right tip and 0.5mm (or thinner) solder it's not too hard. Removing a chip is very difficult with just a soldering iron, but there are kits for that like QuickChip.
DIY boards are tougher to solder to as they don't have a solder mask, but the boards I've got do, so soldering to them is piece of cake. Good flux and solder wick are also good things to have.

Do you have a pic\link to the Pro boards?
Removing a chip is very difficult with just a soldering iron, but there are kits for that like QuickChip.

Here's the pro mini I smoked:

I've since ordered another from a different supplier for $3.65 shipped, and if it works well I'll be getting a batch of 10 for $2.57 ea. I may still try replacing the chip just to see if I can do it.
As for removing the chip, one guy told me he cut a SOIC-8 Tiny85 off a board with a utility knife. The leads on that are bigger than the qfp32, so I've been meaning to try it on the pro mini.

That's right, you can cut off the pins, and then remove them with a soldering iron.
I forgot to mentioned that because I really wanted to remove my 328p without damaging it to test it on another board.

I think that PRO board should be doable using a soldering iron, just may need a thinner tip on some of the pins.

That's right, you can cut off the pins, and then remove them with a soldering iron.

Turns out to be pretty easy with a cheap utility knife aka box cutter (photo attached).
I am a bit concerned I may have accidentally cut one of the traces that runs underneath the chip though...