Go Down

Topic: Breadboard compatbile ATmega1284P board with V-USB (Read 5878 times) previous topic - next topic

TheCoolest

Dec 18, 2013, 02:39 am Last Edit: Mar 18, 2014, 09:31 pm by TheCoolest Reason: 1
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.
9) A 16MHz or 20MHz crystal can be used (tested with 12MHz, as that the only xtals I have at the moment).
10) A 500mA polyfuse. A Schottky diode is used to protect the USB power supply against external power supplies.
11) The ISP header can also be used as an SPI header. This is controlled by a jumper.
12) Power and USB activity LEDs.
13) 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

NooMNooM

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

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

good job!

retrolefty

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.

TheCoolest

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.

pwillard


Pedro147

Nice project Sir.  Hey, are you going to give Crossroads a bit of competition  :D  :D
http://www.pedroduino.com

CrossRoads

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

Is more like this one tho.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Pedro147

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

TheCoolest

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.

Pedro147

Despite my jovial patter with Crossroads re the respective merits of both your boards - they're both great  :D 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  :smiley-surprise:
http://www.pedroduino.com

pito

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?
Thanks.

TheCoolest

@ 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

TheCoolest

#12
Jan 05, 2014, 05:11 pm Last Edit: Jan 05, 2014, 05:17 pm by TheCoolest Reason: 1
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.

ralphd


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.
Unthinking respect for authority is the greatest enemy of truth - Einstein.

TheCoolest

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.

Go Up