Pages: 1 [2] 3   Go Down
Author Topic: Small server/logger/gateway based on ATMEGA1284  (Read 9943 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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  smiley
« Last Edit: July 11, 2013, 12:42:13 am by Stewie » Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley-cry 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.

Quote
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  smiley-lol. That these breadboard designs do work so nicely is a bit of a surprise (to me), as I'm not a hardware designer smiley-red

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  smiley-money

Quote
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  smiley

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!
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
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.


Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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...).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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?

Quote
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 smiley-cool
You did made changes compared to the original boards you posted in the OP?

Quote
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-twist
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?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley

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




* Bigboard V2.pdf (122.21 KB - downloaded 26 times.)
« Last Edit: July 31, 2013, 03:37:59 am by Stewie » Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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

Quote
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!

Quote
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 smiley

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 ;-)
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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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!

Quote
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  smiley-cool

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  smiley-red, or 150 vias are needed to get the board routed  smiley-red
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 33
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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 smiley
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.
Logged

Offline Offline
Jr. Member
**
Karma: 2
Posts: 59
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great  smiley-cool

I hope the second version works as good as the first one!
Did you take specific measurements for the WIZ820 module, because you mention it works well ?
Logged

Pages: 1 [2] 3   Go Up
Jump to: