My first ATMega128 design usign KiCAD

Go To Last Post
8 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello,

Now the code is OK, tested using a stamp128 board I'm starting to work on the first prototype. I'm new to using CAD tools and electronics/AVR is also very new to me. So here is my very first schematic, based on pieces I found/was given.
Do you see anything stupid, possible improvements, bad choices or values ?

Thanks !

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

A quick look shows you seem to be missing 2 important pins on your Max232, power and ground.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Library parts in some packages often omit the supply pins, to avoid clutter. They should appear in the PCB, of course. It should have a decoupling capacitor, which seems to have been omitted. It should be a MAX202, if it is using 100n capacitors.

The CA3140 is a very old op-amp, there are much better ones available.

The relays should have diodes across the coils.

Leon

Leon Heller G1HSM

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Thanks. I'll investigate the power pins. As you mention, they are invisible.
Regarding the relay, isn't the diode embedded in the ULN2003 enough ?
Regarding the opamp, any replacement you know ?

Anything else (I expected more design errors from my first attempt, but I think routing all this will probably more challenging....)

Thanks.

Vincent

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

After 3 month of coding/debugging, I'm back on the design. I have even routed manually the schematic. I enclose the result. I adressed the max232 VCC/VDD by changind the library. Any hints for opamp replacement of the old CA3140) ?
Any comments (I must change the capacitor value also...) ?
The board is a simple 2 layer, with only 3 via.

Do you see something that would prevent it from working ?

Thanks.
Vincent

Attachment(s): 

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi Vincent,

It looks like a fun project you are working on.

I took a quick look at the schematic and thought I'd mention a thing or two, for your consideration:

I'm sure you know the reset switch is Normally Open, (NO), type, push to reset. Some schematics draw the button away from the pins to indicate this.

Your op-amp U3 is powered by +/- 5V. Therefore your output voltage can swing to a MINUS 5 Volts. The AVR's I've used do not permit a negative input voltage on the ADC, they are 0-5V. Check your data sheet for the M128.

Does your LCD have a contrast control? Does it have pins for the contrast voltage and for its supply and ground? I did not view your board layout, but consider, if you did not already, adding V+, Gnd, and a contrast voltage pin to your LCD header.

You may want a 10K pcb mounted pot for the contrast for the LCD. Set it and forget it operation.

If your LCD has an LED backlight then you may want pins for it, as well. Also add a pad for a 1/2 or 1 Watt resistor to feed +5 to resistor to LED backlight, if desired. (Other lead to ground).

You have a fair number of unused pins available. Be sure to bring them out to a spare pad or two, per pin. Then you can solder a wire there to connect something later on, while tinkering.

Run a spare pad to a resistor and LED, then to ground. You can use if for debugging later.

How attached are you to a 16MHz Xtal? A 14.7456 MHz Xtal will give you better accuracy for most common baud rates. I haven't done the calculations, but I suspect you will be fine with 16 MHz, but 14.7456 MHz would be "better".

I'm certainly no expert in board design, but again I'll share a few thoughts:

How are you going to mount the board? I hate the ATMEL boards that don't have any mounting holes..., (Don't get me wroing, I like the boards, BUT...).

Be sure to put your name or initials, the date, and V1 (Version one), somewhere, IN COPPER, on the board. Be sure to include a marker, ">", or 1, next to pin one for the uC and other chips. Also be sure all of your headers have a Pin 1 marker on them, and ideally an identifier for them. It is easy to put a chip in backwards at 2:00 in the morning, working against a deadline. The square pads for pin 1 may be obscured by a header or socket or solder...

If you make several of the boards, or revise the design down the road, you will appreciate having the version number on the board itself.

I also like putting a name for the board on the board, in copper. If I am looking for a board a year from now, rummaging through a stack of empty boards, it makes it easier to identify the desired board.

I usually put a spare ground pad for a little wire for subsequently attaching my voltmeter, or scope probe. Not needed if you make your boards perfect the first time :)

Have fun with the project!

JC

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Quote:
Regarding the relay, isn't the diode embedded in the ULN2003 enough ?

Take it from me. They are NOT enough. I learned this lesson the hard way in 1979 or so. :)

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

DocJC wrote:
Hi Vincent,
....
Have fun with the project!

JC

Many thanks for this long answer, and the fun ahead !

The project is an automation application to manage completely an aquarium from temperature,pH (this is why I have opamps), CO2, water renewal, feeding, lighting (PWM), etc etc. Goal is 0 maintenance... this requires also some design of the aquarium itself, this this is another story/forum :)

I knew for the reset button. I'll find a more relevant picture, so there is no mistake.

Normally, for the pH probe, I based my schematic on this http://damien.douxchamps.net/ele... so I should end up with 4V. Any comments on this ? I contacted the author who gave me some tips.

For LCD and contrast control / backlight, in fact I have another PCB with LCD, contrast and keypad. I'll just add backlight, in case I change my LCD model someday. Good point. I'll also add +5V and GND as you mention even if I originally planned to take all power directly from the +12,+5/-5 supply

My crystal is a 16Mhz, as it is what I have on the AVRStamp from futurlec. There should be no issue changing for a more standard value as I don't need a lot of processing power. Never had a problem with 16Mhz so far, but if it allows better stability why not.

For the unused pins, I should be able to use them directly from the board I use for turning the mega128 to DIP: http://robokits.co.in/shop/index...

For mounting, I have some holes ready. Mo tracks around it.

On the design tips, I'll take all of them ! Great !

Thanks agin for this long and interesting comment. I have already updated the layout to have >0,3mm distance between pads and tracks as it is a requirement from my PCB manufacturer. It will also make things more easy later, as this will be my first prototype ever.I'll keep you informed !

V.