Small server/logger/gateway based on ATMEGA1284

Did you handsolder both sides?
If yes, I always wonder how ppl do that with QF44 packages...

I do the 'big' sm parts 1st. First, I go over the pads with a flux-pen, I hold the PCB in place with Blu-Tack so its raised and does not rock when trying to solder, then just flip it over and do the other side. I got lucky and found a cheap stereo microscope in a second-hand shop so that has been a great help. If no microscope then I use a pair of cheap magnifying reading glasses that you can get in the supermarket or chemists (+3.5), they work surprisingly well.

As for the Sparkfun RF24 breakout board: I understand your choises to create a standard, easy to get breakout, but the tenfold price of a normal RF24 board is ridicolous.

I understand, I thought the same. I have wondered about an adaptor for the cheap ebay boards, or just using its footprint.
I figured that this would not be the only version of this I produced. So far I have not found any actual mistakes in the build but there is things I would change after making the 1st one.
There is too much ground plane around the edges of the RTC battery holder, the RTC xtal footprint is not quite right, or perhaps a different package would be better and the drill size for the edge holes was a bit big so not much land left on the pads. more may come to light in time.
This 1st PCB is a 'tester' so I can see how (if) it all works.
When I do the changes I mentioned, I'll try the ebay version footprint.
I want to keep the board length under 50mm so it fits in the cheapest 5cm x 5cm PCB service from seedstudio (currently 49.5mm)
I'll test for few weeks and then make the files available (this version). The PCB's are done in Kicad, not eagle.

So far, so good :slight_smile: Everything has now been tested and works.

Thanx sofar for the info.

Nice that you want to limit boardsize, but what is the current size?

Furthermore, I see you are using 5V on the radio breakout board. All radios are 3.3V, so are the sparkfun boards using a 3.3V regulator by any chance?

Last but not least: is it possible to use (switchable maybe?) 3.3V for the complete board? About all the sensors I use require 3.3V or less! Board should still be able to run on 16MHz, as JeeNodes also run on 16MHz without any problems on a 3.3V power supply.

Happy testing!

current board size is 49.5 x 32mm. No particular reason at the start, it just had to be wide enough for the ethernet module, the pins on the outside edge and a little bit more.
Initially I did not expect it to all fit but after a few iterations it did. I was struggling a bit towards the end.
If I do another version, I'll make it an extra 0.1" wider to maintain the breadboard pluggability and just give me a bit more room to play with.
The Sparkfun radio has a 3.3V reg on board, as do my RF breakout boards so 5V was fine for that. I needed 5V at that end of the PCB for the RS485 and the RTC so it was just convenient.
I get what your saying about running it all on 3.3V, even at 16Mhz, but I want it to be able to run at 20Mhz, or 22.1184MHz (as per the soon to arrive Goldilocks board). I dont think I'd get that at 3.3V.
I could fit more on in the way of power options if I use more of the whole 17.5mm I still have available :slight_smile: as I'd like to keep within the 50mm x 50mm size. I'll see how things work out with this one first.

If you want the 20MHz or more, you have no choice than to run it at 5V. I was to late for the Goldilocks board, any idea when you will receive it?

But for a max of 16MHz there is hardly any reason not to use 3.3V. Running it on batteries makes it even more important to use 3.3V or even 3.0V.

Your board is small and still easy to extend with the SD, LAN and radio 'shields'. I hope testing is going strong and that we can welcome the final design soon :cold_sweat:

Testing is going well :slight_smile:
I'm currently running a test sketch that is a server, client, logs to SD card with time/date from RTC. I'll let it run for a couple of weeks and just see how it goes.
The radio system was tested with Maniacbug's RF24 library and after assigning the pins it worked straight-away, reading the key-presses from a Nordic keyfob.
Running from just 3.3V is a good idea. I thought about it early on and figured that I could just feed it with 3.3V externally and link out the 3.3V reg.
It makes more sense to keep the reg and put some kind of link/jumper on the PCB so that the on-board regulator is always used.
Its a linear reg so pulling too much current will make it hot quick, and the one I used (MCP1826) has a absolute max input voltage of 6.5V. While running my test sketch, it is slightly warm to the touch, no heatsink and a 5V i/p.
Running everything from a 5V plugpack through the reg should be fine, but only testing will tell.
The regulator has a very low quiescent current and pretty low dropout so its reasonable for battery use if the micro is in power-down mode to conserve energy. The Wiz820 power-down is connected so it can be shut down in power critical situations that require ethernet.
There is a drop-in replacement RTC that runs on 3.3v (DS1338) and also RS485 chips for 3.3V so the whole board functionality will still be available, which is a requirement for my intended uses.
So far I'm happy with the results.
I need to make up another couple, one at 22.11Mhz and one running at 3.3V, 16Mhz so I can try things.
And, where does all the time go.... ?

Stewie:
Testing is going well :slight_smile:
I'm currently running a test sketch that is a server, client, logs to SD card with time/date from RTC. I'll let it run for a couple of weeks and just see how it goes.
The radio system was tested with Maniacbug's RF24 library and after assigning the pins it worked straight-away, reading the key-presses from a Nordic keyfob.

That is very nice to hear... 8)

Running from just 3.3V is a good idea.
[...]

That is even better!
It seems this board is applicable for the full range of my applications with the standard RTC, and optional SD, LAN en RF cards. Even more than the Goldilocks board (shipping in August??) now that I compare the two :astonished:
Most of the apps will only need the RF card (RFM12B or NRF24), and only a few the SD/LAN/RF combination. And because of this flexibility, I for instance don't need the Arduino shield compatibility and really like these kind of boards!

I need to make up another couple, one at 22.11Mhz and one running at 3.3V, 16Mhz so I can try things.
And, where does all the time go.... ?

A well, so many possibilities and options to make the ultimate and easy to extend Arduino compatible board!

BTW: Could the RS485 chip be left out if not needed?

If you get your own PCB's made when the design files are available, you can just fit the components you want, bridging out the RS485 driver will let you still use the serial channel, but at logic-levels.

When I release the files, the PCB artwork will be in a zipfile, just email it to seedstudio, pay the low fee and a few weeks later your very own batch of 10 boards will arrive.

There are refinements I want to make for a next version, perhaps a LED on the board and a reset button. I really want to keep to 1206 resistor/cap packages as for home assembly they are quite manageable, and to keep away from the tiny sm footprints as I just cant work with them. I did have to resort to three 0803 components, the xtal caps and a ferrite bead.
Perhaps some solder bridges for power and 2nd serial options. I'm trying things to see what I can fit.
At this point, I dont have any way to sell these, or even have an idea if people would want them. I made these with my requirements in mind, ie the RS485 port is not a common requirement. I can probably make it optional (bypass the chip) so in that regard its more generally useable.
So I'll just keep on with the testing and trying to fit any modifications I can think of (or are suggested)

I was lucky enough to be one of the Goldilocks backers, I cant wait to get mine.
Its in a completely different class from my effort. It is a very well engineered board and a huge amount of effort and thought has gone into it to make it one of the most 'serious' Arduino's I have come across, suitable for complex and diverse applications, even using the two CPU's for independent programs and communicating between them.

I just thought of the bits I wanted, crammed them into a small space and figured its worth a try... If its a dud then its not the end of the world. If it all works then happy me.
I just like making stuff :slight_smile:

Stewie:
If you get your own PCB's made when the design files are available, you can just fit the components you want, bridging out the RS485 driver will let you still use the serial channel, but at logic-levels.

When I release the files, the PCB artwork will be in a zipfile, just email it to seedstudio, pay the low fee and a few weeks later your very own batch of 10 boards will arrive.

There are refinements I want to make for a next version, perhaps a LED on the board and a reset button. I really want to keep to 1206 resistor/cap packages as for home assembly they are quite manageable, and to keep away from the tiny sm footprints as I just cant work with them. I did have to resort to three 0803 components, the xtal caps and a ferrite bead.
Perhaps some solder bridges for power and 2nd serial options. I'm trying things to see what I can fit.
At this point, I dont have any way to sell these, or even have an idea if people would want them. I made these with my requirements in mind, ie the RS485 port is not a common requirement. I can probably make it optional (bypass the chip) so in that regard its more generally useable.
So I'll just keep on with the testing and trying to fit any modifications I can think of (or are suggested)

You should be putting your own requirements on top of course. I guess you could make modifications for the rest of this year by implementing wishes from other ppl. On the other hand, I don't see so many other ppl showing interest =( It seems not many run out of the 328P RAM/ROM space, and thus requiering something like a 1284P.

Looking at my own personal wishes: running the board on 3.3V is currently the most important one. A better RTC like the DS323x would be nice (but more expensive, and much larger size, ie probably difficult to fit) and some extra I2C and SPI headers for easily connecting sensors also.

I was lucky enough to be one of the Goldilocks backers, I cant wait to get mine.
Its in a completely different class from my effort. It is a very well engineered board and a huge amount of effort and thought has gone into it to make it one of the most 'serious' Arduino's I have come across, suitable for complex and diverse applications, even using the two CPU's for independent programs and communicating between them.

The Goldilocks board is indeed a well thought, high quality 4-layer board, but no pluggable LAN and only a 6-pin extension header for RF cards (couldn't get 8-pins to fit due to the Arduino compatible holes). All the Freetronics boards have the prototyping area. I guess if that wasn't necessary the LAN/RF headers could have been added.

Because of this your board fits my needs much more... Next to that, I have some breadboard designs that are running for a few years without any problems, so I don't seem to be in need of high quality, factory grade stuff XD. That these breadboard designs do work so nicely is a bit of a surprise (to me), as I'm not a hardware designer :blush:

Pricing will probably also something different. 10 PCB boards for around €10-€15, ie €1.50 / board. Then €6 for the 1284P, €2 for the NRF24, so I guess the total board (without SD/LAN shields) won't be more than €15... Priceless $)

I just thought of the bits I wanted, crammed them into a small space and figured its worth a try... If its a dud then its not the end of the world. If it all works then happy me.
I just like making stuff :slight_smile:

The 1284P, as I'm always running out of RAM, certainly combined with LAN, is the key factor for me. I'm also looking for a board that could become my standard board to use for several prototypes (and thus re-use of software). Next, I like the formfactor. It fits a standard, cheap 1591M Hammond case nicely. Even if you would extend the board to the 49.5x49.5mm limit as Hammond has 85x56x21mm, 85x56x35mm small enclosures (inside is just over 51mm, so a perfect fit) and a bit bigger the 112x62x27mm and 120x65x36mm ones. The larger boxes can even fit two of these boards, giving you dual-core 1284P power!

for enclosure sizes, dont forget that the radio either sticks up, or behind.
I'm looking at both options, I'm tending towards a footprint that allows a right-angle connector on the rear of the PCB so the radio sticks-up. This allows a vertical radio, or if no Wiznet module fitted then a vertical connector so the radio is above and parallel to the main PCB.
Not sure if some kind of screening would be required between the micro and the transmitter but with such close proximity its certainly worth considering.
-The above is with the cheap ebay nRF module footprint (2x4 pin)
I'm experimenting with other PCB options. Solder bridges if no RS485 fitted seems OK, reset button is OK, LED should be fine but not done yet and still considering power options.

Martins Funky v2 (http://harizanov.com/wiki/wiki-home/funky-sensor-v2/) has the Atmega 32u4 and a Hope RFM12B sandwitched together, so I guess not much of a problem having them very close together.

It probably will be OK.
One of my boards is a ATtiny861 with a RFM12, at http://byremote.blogspot.com.au/2013/03/rfm12-mini-nodes-tiny861.html , is quite similar but slightly larger, its never been a problem for me. The RFM12 works at 433Mhz. I wondered if 2.4Ghz might be more of a problem. It comes down to try and see I suppose.
If your interested, the design files for the atTiny board are on AVRfreaks.. http://www.avrfreaks.net/index.php?module=Freaks%20Academy&func=viewItem&item_type=project&item_id=3848

Tested with an Arduino bootloader, seems OK. Not tested with a HUGE sketch yet, I'll have to embed a large table and try that so it is across the 64K boundary.
The bootloader is a slight tweak of the Goldilocks one, built for 16Mhz and a different LED pin.
I also tried 22.11Mhz but the oscillator was not rock stable. Waiting for some different XTAL cap values to turn up and also for different xtal manufacturer version.
On 22.11Mhz, delay() was out by up to 25% (running too slow), but the serial bootloader loaded at 115K with no errors.
I enabled CLK-OUT and checked it on my scope. It certainly seems like the right frequency (counted 10 cycles on the screen and did the sums) and if the bootloader is happy at 115K, it cant be too far out.
I wonder if something is overflowing in the timer chain that derives the delay. More investigation required.
At least the 16Mhz tryout seems all good. Its been serving/posting and logging for some time now and no issues. A goodie-bag from mouser arrives tomorrow so more building to do :slight_smile:
I just upgraded to AVRstudio-6.1 and the Arduino plugin from http://www.visualmicro.com/ . Its looking very promising! A real editor/IDE with debugging features, and all the Arduino functionality available.

Thanx for the update!
Good to know that the Arduino bootloader works, same for the 16Mhz build.

wrt the 22Mhz version: I assume you made a different board type with the 22.11Mhz as CPU speed?

And what does the goodie-bag bring? More CPU's & stuff??

I tested AVR Studio also with the Arduino plugin. Its nice, but I like CodeBlocks a bit better. Donno why, but it seems easier to use (and faster...).

I've built up a few boards now for testing purposes, The 22M version is one of them.
On digging into the Arduino code for the problem with the delay() times, from what I can see (and I'm not really a software person), it looks like the delay code is only going to produce valid results for 8 or 16Mhz. Anything else will give wrong results. This is a bit of a pain. Its probably fixable but this will involve modifying some core files and I'm not too keen to go down that path, and not really sure how to. 22.1184Mhz is good for accurate baud-rates and loading at 115K, but a non-friendly number for deriving a 1ms counter.
I'll live with it for now as its not a show-stopper and everything else seems to be good. 16Mhz is fine and Arduino delays work as expected.

I got a batch of 1284P's from Mouser, + assorted other support components. This will let me make up the basic boards without the extras and have some available if people want one.

I tried codeblocks but it seems to have issues running on my XP virtual machine. Took ages to load and each time I tried to do anything, there was a 20~30 sec delay before anything happened. I'll stick with AvrStudio for now.

Stewie:
I've built up a few boards now for testing purposes, The 22M version is one of them.
On digging into the Arduino code for the problem with the delay() times, from what I can see (and I'm not really a software person), it looks like the delay code is only going to produce valid results for 8 or 16Mhz. Anything else will give wrong results. This is a bit of a pain. Its probably fixable but this will involve modifying some core files and I'm not too keen to go down that path, and not really sure how to. 22.1184Mhz is good for accurate baud-rates and loading at 115K, but a non-friendly number for deriving a 1ms counter.
I'll live with it for now as its not a show-stopper and everything else seems to be good. 16Mhz is fine and Arduino delays work as expected.

If you didn't make a different board type for 22Mhz (AFAIK), then it defaults to 16Mhz. But I might be wrong..., as I never did that route.
Great that the testing is good for the default 16Mhz speed. And you can upload sketches using the standard Arduino serial?

I got a batch of 1284P's from Mouser, + assorted other support components. This will let me make up the basic boards without the extras and have some available if people want one.

You can count me in for at least 1 board, maybe 2 8)
You did made changes compared to the original boards you posted in the OP?

I tried codeblocks but it seems to have issues running on my XP virtual machine. Took ages to load and each time I tried to do anything, there was a 20~30 sec delay before anything happened. I'll stick with AvrStudio for now.

No problems with CodeBlocks here, but I have them with KiCad. I never used it, so I'm new to that program. Made, using some tutorials, some very basic pcb's with a few resistors, caps, switches and so on. And now when I want to use the autorouter, and thus must use the export to spectra dsn files, pcbnew simply crashes, it stops, without any error message. Very frustrating I must say as I have no idea why! Even if I - as a beginner - did something wrong, it shouldn't do this ]:smiley:
Not all pcbs I made suffer from this. It seems that if I change something after making a pcb, this happens, but I'm not sure yet!

Are you btw using the default KiCad libraries, or do you use other libraries?

I did change the 'board type' for the different frequency builds. I loaded a basic sketch into the different frequency boards and then looked at the disassembly in AVRstudio.
There are assumtions made about the clock frequency (either 8 or 16M), which is fair enough I suppose as thats what Arduino's run at. I'm not too bothered about it for now and if it gets to the stage where its a problem then I'll look at (trying) to do something about it.

I do use the basic libraries for Kicad, but each time I make a new component, I add it to my own library so it has grown over time.
I looked at going the Eagle way some years back but did not want to get locked into a system that was limited in the 'free' release. Kicad has no restrictions in that sense.
Its not as 'seamless' as Eagle, but its quirks are not such a handicap that I cant live with it.
I have not experienced the problem that you describe, but the releases are regular so whatever it was may not be there any more.

I think I have arrived at a 2nd build version now.
It has more flexible power options. Positions for two regulators on board, a 5V and a 3.3V.
With the two power rails on the board, the micro (and RS485 if fitted) can be run at 5V for full speed. The other items all run a 3.3V. The 5V rail can be connected to the 3.3V rail (with no 5V reg fitted) and the whole board run at 3.3V. Also now fitted,
A power LED
A LED on one of the I/O pins
A reset button
The radio connector is now the cheap nRF version as per ebay (and many other sources)
Ground-plane beneath the battery (for the RTC) is fixed and the 32Khz xtal footprint fixed.

The PCB is done, I just need to check it over for a few days and see if I spot anything wrong then I'll get a batch made.

Its 5mm wider so still well within the 50x50mm PCB area at Seedstudio (and others)

Since I'm ordering boards, I'll do a RFM12 adapter that fits onto the radio connector, I use both.

If it all works OK then I think that will do for me. I'll release the files and anyone can do what they will with it :slight_smile:

Schematic now attached (you need to log-in to see it)

Bigboard V2.pdf (122 KB)

Stewie:
I did change the 'board type' for the different frequency builds. I loaded a basic sketch into the different frequency boards and then looked at the disassembly in AVRstudio.
There are assumtions made about the clock frequency (either 8 or 16M), which is fair enough I suppose as thats what Arduino's run at. I'm not too bothered about it for now and if it gets to the stage where its a problem then I'll look at (trying) to do something about it.

Weird as others do use the 22.11Mhz crystals or even other values like 3 or 7Mhz. But I have no idea how to solve this. All my boards are the default 16Mhz...

I do use the basic libraries for Kicad, but each time I make a new component, I add it to my own library so it has grown over time.
I looked at going the Eagle way some years back but did not want to get locked into a system that was limited in the 'free' release. Kicad has no restrictions in that sense.
Its not as 'seamless' as Eagle, but its quirks are not such a handicap that I cant live with it.
I have not experienced the problem that you describe, but the releases are regular so whatever it was may not be there any more.

I did try Eagle a few times, but never understood that pre-Windows like program. This time I had a reason to learn KiCAD, and I must say, it has its quirks indeed, but I managed to use your schema (from the first post) together with some tuts on the internet as an example on how to create a schema, assign footprints, create & autoroute a PCB, and modify it!
This was a bit of a surpise to me as my first try resulted in crashes, but after an update (July 7th update) it worked like a charm!

I think I have arrived at a 2nd build version now.
It has more flexible power options. Positions for two regulators on board, a 5V and a 3.3V.
With the two power rails on the board, the micro (and RS485 if fitted) can be run at 5V for full speed. The other items all run a 3.3V. The 5V rail can be connected to the 3.3V rail (with no 5V reg fitted) and the whole board run at 3.3V. Also now fitted,
A power LED
A LED on one of the I/O pins
A reset button
The radio connector is now the cheap nRF version as per ebay (and many other sources)
Ground-plane beneath the battery (for the RTC) is fixed and the 32Khz xtal footprint fixed.

The PCB is done, I just need to check it over for a few days and see if I spot anything wrong then I'll get a batch made.

Its 5mm wider so still well within the 50x50mm PCB area at Seedstudio (and others)

Since I'm ordering boards, I'll do a RFM12 adapter that fits onto the radio connector, I use both.

If it all works OK then I think that will do for me. I'll release the files and anyone can do what they will with it :slight_smile:

Schematic now attached (you need to log-in to see it)

Great. Just saw you added the schematic. Thanx for that!!!!
Lots of goodies & configuration possibilities added I see., which brings on a few questions:

  • You are using a bead in the AVCC. Why?
  • The powerrail contains much more caps than I see in other examples. You use for example 3x10uF. Why not a single 22uF/47uF??
  • Are you using a special resonator (X1)? Can't find such a resonator with a third 'pin' connected to ground...
  • There is no pull-up on the CS1 (WIZ820) line (there are on the CSN and CS2 lines). I assume that the WIZ has a pull-up orso??

.
So now I will check your second schematic and see what I can add again to my schematic :wink:
As I did only have the foto's of your PCB, I'm very curious about the KiCAD files!

Thanx again as without knowing you did help me a lot with my own wishes & the possibilities.

After a bit more digging in the forums, there is quite a bit of chat about different clock frequencies and because of the way that the millis and micro delays are generated, its basically 8M or 16M for them to be meaningful. If you use different xtal frequencies, you still get a delay, but it wont be what you are expecting. This seems to be pretty much hard coded into the core files with other functions and libraries making the assumption of 8M or 16M xtal

I used a ferrite bead because of some comments on the Goldilocks Google design docs page. I thought I'd give it a go. I have always used basic inductors so far but I'm willing to try and see. In my layout it may not make any difference as its hardly set out for optimum analog performance. On the plus side, it uses linear regulators so that will probably help.

As for the crystal, here is an example of the package http://au.element14.com/abracon/abm8g-16-000mhz-b4-t/crystal-16mhz-18pf-smd/dp/2308711?Ntt=2308711
This is just to show the style. Its not the friendliest thing to hand solder. I'll have to get a toaster-oven reflow setup going.
Two pins are the xtal, the other 2 are Gnd.
I use the 10u caps because I have a stack of them. In the Wiznet forums, good decoupling on the wiznet module seems to be fairly critical. I also wanted to keep to a 1206 footprint and I did not want the package height to be too much, so multiple smaller devices.
The Wiznet module has a built-in pullup resistor. I put the others on because while using the ISP programming, the micro I/O pins float so the CS lines could become active and then random data may appear on the MISO line and cause the programming to fail. I'd just rather err on the safer side as I dont like having to tack bits on later.

Stewie:
I used a ferrite bead because of some comments on the Goldilocks Google design docs page. I thought I'd give it a go. I have always used basic inductors so far but I'm willing to try and see. In my layout it may not make any difference as its hardly set out for optimum analog performance. On the plus side, it uses linear regulators so that will probably help.

Oh yes, I did read that once in the design docs (can't seem to access those docs anymore) that a ferrite bead should enhance analogue performance. I also see them a lot in Freetronics designs (for instance the EtherTen), where a bead is also used in the 3.3/1.8V power lines for the W5100. So indeed it won't hurd but may improve things!

I use the 10u caps because I have a stack of them. In the Wiznet forums, good decoupling on the wiznet module seems to be fairly critical. I also wanted to keep to a 1206 footprint and I did not want the package height to be too much, so multiple smaller devices.

Aha! And these 10uF caps should fit under the SD Card breakout ? Then you should use them as the 47uF versions are much higher... I checked the Wiznet forums and indeed decoupling seems to be critical, so a few extra caps won't hurt.
And after some reading I also do understand your choice of an 1A LDO. I didn't realize the power the WIZ820 (110mA) and the SD Card (45-110mA) need when operating. And if you use the amplified version of the nRF24 another 120mA is needed, giving a total of about 350mA 8)

I still learn alot you know, and still playing with KiCAD. I like the 3D screen where you can watch your build. This is an experiment based on your design with a SD Card fitted directly on the board and some extra headers & chips (Not a working schema, but for learning like how much space an fixed SD connector takes on such a small board):

I find placing components in a logical manner the most difficult one (see in the upper left what I made of a bunch of caps...). Sometimes, when I change components, the autorouter comes into a loop :blush:, or 150 vias are needed to get the board routed :blush:

2nd build boards are on the way, should arrive in about a week so fingers crossed. Hopefully the tweaks are all OK so more soldering to do soon :slight_smile:
First build has been fine, no dramas with internet using the Wiz820 module, data logging to the SD card and everything else apparently OK.
2nd build has these few extras to make it a bit more versatile and user friendly.