Atmega 1284 - What works and what don't?

Right. I became quite enthusiastic with the Atmega 328 chip and basically use all it can offer for my first little major project.

I demonstrated the capabilities of the controller yesterday to my clients and they were very impressed, but they also absolutely needs the use of a second serial port as we need RS-485 and a nice touch screen.

As a result, it is back to the drawing board for me and I frantically looked for something in between the Atmega 328 and Atmega 2560 as the Atmega 2560 will be just a way overkill for 95% of our applications.

So it seems that many power users have the same problem and that many on this forum then implemented use of the Atmega 1284.

I quickly had a look at the specs, and it is indeed a very ideal chip to use. Memory is for a change enough, it has two UART ports which I desperately needs and for a change and I would not need to compromise on DIO pins. This chip will fill an enormous gap before one really needs a Atmega 2560.

I need the following to work:

  1. Of course all the I/O Pins in standard Arduino fashion.

  2. UART on both ports. Which library is working best?

  3. Implementation of RS-485 on one of the UART ports.

Now of course the above is possible.

However, is there a kind of summary that currently list the status of things that works and things that does not under the Arduino IDE?

I am not a great coder yet, so from my point of reference I am talking about standard use of Arduino code.

The 1284 has 2 serial ports.

.

Atmega1284P works just like a '328P, with the addition of Serial1, and the extra IO ports that are available.
Read here about adding the 1284P core to the IDE for programming

I have '1284P boards in different form factors, including this one with SD card, battery backed RTC, and RS232 buffer for the 2nd serial port. Using RS485 would be very similar. You could add a RS485 chip in the prototype area for initial testing.

These are all 8-pin variants: MAX481 MAX483 MAX485 MAX487 MAX1487 MAX488 MAX490
http://www.crossroadsfencing.com/BobuinoRev17/

I'm working with 1284P some time and have no problem up to now. It is similar like 328P. Pin numbering is different of course. In addition it has features that 328P has not, e.g. separate input for Timer2 clk to run clock from 32kRTC signal.

My Arduino clone with 1284P

1. Of course all the I/O Pins in standard Arduino fashion.
Different functionality of pins caused that several HW variants exists.

2. UART on both ports. Which library is working best?
It is basic functionality included in Arduino SW. It works just fine. I think, no other libraries are needed.

3. Implementation of RS-485 on one of the UART ports.
Already answered.

As a result, it is back to the drawing board for me and I frantically looked for something in between the Atmega 328 and Atmega 2560 as the Atmega 2560 will be just a way overkill for 95% of our applications.

Inexpensive overkill is a good thing - protects you from client scope-creep.

Also, I have no hesitation using thd 1284 for my own projects; but, for a paid-job, I would only use officially supported uC’s and not 3rd party cores. This has nothing to do with quality of the 3rd party core; it has everything to do with my personal ethics of not deviating from a first-tier product unless my client signs a statement accepting full liability for the one-off approach.

Ray

Budvar10,

I must say, I am pretty green of jealousy to see your board. It looks great.

That said, I prefer bread-board compatible versions (Like the Arduino Nano) as they make great starts for lower production PC-boards as you can eliminate a lot of PCB design with that.

So, have you perhaps got a Bread-board friendly version with USB port?

Budvar10:
I'm working with 1284P some time and have no problem up to now. It is similar like 328P. Pin numbering is different of course. In addition it has features that 328P has not, e.g. separate input for Timer2 clk to run clock from 32kRTC signal.

My Arduino clone with 1284P

1. Of course all the I/O Pins in standard Arduino fashion.
Different functionality of pins caused that several HW variants exists.

2. UART on both ports. Which library is working best?
It is basic functionality included in Arduino SW. It works just fine. I think, no other libraries are needed.

3. Implementation of RS-485 on one of the UART ports.
Already answered.

Ray,

In this case, I am not worried about scope creep.

An Atmega1284 is a monster compared to what we are used to in the industry.

We are used to work with controllers (that probably has an Atmega1284 anyway) but with only 1/2 that pinned to I/O's. In fact, my client - and he pretty much knows what he wants - simply could not think how to use up the pins of a 1284 for any single unit application in our industry.

In fact, I have identified it as the general workhorse chip that will fill just about 95% of our our single application needs - especially if you use a 4-wire touch screen as standard as buttons are then no problem. I am really not going to waste my time programming a chip to use buttons and LCD's.

But don't fear. We have plenty of ideas to fill up an Atmega2560 for other work. That really is no problem application depending.

mrburnette:
Inexpensive overkill is a good thing - protects you from client scope-creep.

Also, I have no hesitation using thd 1284 for my own projects; but, for a paid-job, I would only use officially supported uC's and not 3rd party cores. This has nothing to do with quality of the 3rd party core; it has everything to do with my personal ethics of not deviating from a first-tier product unless my client signs a statement accepting full liability for the one-off approach.

Ray

Breadboard 1284P system:
http://www.crossroadsfencing.com/BobuinoRev17/



Or mount the FTDI module header vertically

I get what you did here, although I cannot figure out why you would place a reset button below the chip.

My ideal would be a surface mount 1284 - like the NANO - with a CH340 and a mini USB port, but the same straight pin configuration as you did.

In effect then, a sort of hybrid modified Jack Christensen board / Crossroads board with CH340 and mini USB port but no gaps in pins spacing - a 2.54mm straight like the Croassroads board.

I have not seen a US source for CH340, until it becomes available from a reputable distributor I will not be designing it into any boards.
The board size will end up comparable to the DIP board for all the pins, so why go to the hassle of a hard to replace SMD part? Not very hobbyist friendly.
I do have an SMD variant, no USB or voltage regulator. I could consider adding a USB module to the board as shown in Reply #2

I have not seen a US source for CH340, until it becomes available from a reputable distributor I will not be designing it into any boards.

Why not? It's the easiest solderable USB to serial chip on the market with a SOIC-16 package. It's designed and manufactured by a company called WCH. You can buy them for about 0.30$ a piece. If you're using Alibaba you can buy thousands on a reel directly from a Chinese supplier. They will probably never be available at a US supplier, but that doesn't mean that they're useless or counterfeit.

This one is much better for implementing in projects. Only thing I would do is to use SIP pins and at the bottom of the board, but of course that is not a problem to do.

Reason I like a USB port onboard, is that for the applications I have in mind, I can then send the code over to someone in the field and he can upload it there and then via his Android phone.

And I kind of like it coming without a regulator. On these bigger chips one often needs to beef up the 5V supply in any way and I also prefer to use a single unit powering all.

CrossRoads:
I have not seen a US source for CH340, until it becomes available from a reputable distributor I will not be designing it into any boards.
The board size will end up comparable to the DIP board for all the pins, so why go to the hassle of a hard to replace SMD part? Not very hobbyist friendly.
I do have an SMD variant, no USB or voltage regulator. I could consider adding a USB module to the board as shown in Reply #2

All you have to do is add a sip connector, such as ‘DuPont cabling’ soldered to the correct pins.
the SIP header can be attached to your case.

.

Well I must admit, I was also sceptical about these chips but I am now through a bunch of Arduino Nano's and they all worked perfectly.

I did not experience the slightest difference between that and my FTDI boards.

hansibull:
Why not? It's the easiest solderable USB to serial chip on the market with a SOIC-16 package. It's designed and manufactured by a company called WCH. You can buy them for about 0.30$ a piece. If you're using Alibaba you can buy thousands on a reel directly from a Chinese supplier. They will probably never be available at a US supplier, but that doesn't mean that they're useless or counterfeit.

Why not?

Aside from not being able to read the datasheet or talk to the manufacturer (OR distributor)?
A problem with chips without a vetted supply line is that you don't know when they might go away. (ok, this is always a problem (ask me about our design full of "PA Semiconductor" MIPS chips.) But it's less of a problem with "established" vendors that are publicly traded in world markets with published financials and etc...

Woohooo!!!!

I got my two Atmega1284's working today.

After quite some smoke bubbled form my brain, I could finally burn the bootloaders and uploaded Blink!

Like always, it is nice to get something working after some grafting.

Now to get the Modbus running.

And I am doing a touch screen as well.