Pages: 1 2 [3] 4 5 6   Go Down
Author Topic: Building a dual MCU project with two ATmega328 chips  (Read 8309 times)
0 Members and 1 Guest are viewing this topic.
Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

ICSP. The serial interface is only for the bootloader.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, I made a file called install_clock.bat with 1 line:

avrdude -c stk500v1 -p atmega328p -P com6 -b 19200 -u -U lfuse:w:0xe0:m -U hfuse:w:0xde:m -U efuse:w:0xfd:m

I moved it into the same directory with avrdude.exe

I went into Command Prompt mode - and I still can't get it to run.  I get the same error as noted before about the config file.

Device Manager shows this for the AVR ISP MKii:
Port_#0001.Hub_#0006

It doesn't show up under the COM ports - so now I'm wondering what COM# should be in the command line.

Pain in the butt ....
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Switzerland
Offline Offline
Sr. Member
****
Karma: 6
Posts: 375
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I don't have an AVR ISP mkII to try, but I think the right configuration is this:

Code:
avrdude -c avrisp2 -p atmega328p -P usb -u -U lfuse:w:0xe0:m -U hfuse:w:0xde:m -U efuse:w:0xfd:m

Be aware that the -U commands may trigger an automatic erase of the flash memory.  You can try adding the -D option to disable this, although I'm not sure whether it's actually possible to change the fuses without a flash-erase.  The normal procedure for loading Optiboot and setting the fuses (adapted for external clock and AVR ISP mkII) goes like this:

Code:
avrdude -c avrisp2 -p atmega328p -P usb -e -u -U lock:w:0x3f:m -U lfuse:w:0xe0:m -U hfuse:w:0xde:m -U efuse:w:0xfd:m
avrdude -c avrisp2 -p atmega328p -P usb -U flash:w:optiboot_atmega328.hex -U lock:w:0x2f:m

BTW, I found it convenient to have WinAVR installed for this kind of thing.  Amongst other things this installs a bunch of handy utilities and sets the windows path to find them.  The upshot is that you can run avrdude from whichever directory is convenient, without worrying about setting the full path.  It's a minor thing, but one I found handy.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, the design is gonna add 30 cents and go with 2 crystals.
Getting the fuses set for anything other than what the IDE does while installing a bootloader is to complex.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, I am calling it done.
Dual '328s, dual crystals, pins to connect Serial, I2C or SPI using D10 as Slave Select.

Unless some one sees some glaring omission or mistake, I'll order boards tomorrow.


* DualAtmega328Sch_Rev1.png (40.65 KB, 1482x748 - viewed 45 times.)

* DualAtmega328Rev1.png (49.95 KB, 883x465 - viewed 47 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Peoples Republic of Cantabrigia
Offline Offline
God Member
*****
Karma: 6
Posts: 719
Arduino happiness
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

No BAT54 diode on the reset lines?

I would also consider going for a single set of pull-ups for the I2C bus @ 2.2K or two sets of 4.7k units instead of 10K. Better chance of square waveforms in high speed mode.

HTH...
« Last Edit: August 04, 2012, 06:33:59 am by Constantin » Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ah, reset diodes. Good catch.  When I started this way back, those hadn't been in use.
10Ks on I2c were arbitrary, I'll change to 4.7K.
User can install one or the other, or both if each uC will have its own I2C devices.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Ok, reset diodes have been added, artwork cleaned up, passes all design rule checks.
Boards are ordered.
Bare boards will be $5 mailed to US locations.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Belgium
Offline Offline
Sr. Member
****
Karma: 1
Posts: 281
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Am I right that all the components are through the hole? What is the function of the max232 chip? I have an FTDI cable that I use to upload sketches to my self made boards.
Logged


Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Yes, all thru hole for straightforward assembly.
MAX232 is for RS232 comm's if you want. There is a set of jumpers to disconnect it from RX pin for interference free FTDI downloading.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Dual 328 processor boards are in! $5 mailed to your US location.
Other boards: 12 digit driver board 2 with '328 and TCIP6B595s, $5 mailed to your US location.
4 digit driver board with '328, TCIP6B595s, MAX232, and SD socket,$5 mailed to your US location.
Mega2560 Screw shield - attach passthru headers and 86 3.5mm screw terminals to securely attach wires to your Mega. $13.60 bare board, $41.25 for kit with headers & screw terminals. Only 4 more available.


* batch_of_boards.jpg (140.93 KB, 1011x701 - viewed 32 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

First card built up - dual '328s, MAX3232. Bootloaded both as Unos.
Blink installed on both uCs right now via File:Upload Using Programmer.
Doesn't seem to want a download via FTDI Basic. Think I need to check my jumpers, maybe something in the wrong place.
Hmm - 3.3V FTDI Basic, maybe overloading the 3.3V supply  from the FT232RL with a dual board. Need to find my 5V FTDI Basic, or change the jumper on this one.
Got a CP2102 module around, will give that a try too.
Uninstalled resistors are for I2C pullups. Not needed yet.


* dual_328s.jpg (110.3 KB, 829x539 - viewed 39 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Virginia
Offline Offline
Newbie
*
Karma: 0
Posts: 2
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Great project, CrossRoads!  I've started a project using the BoardX motherboard since it is designed to easily add multiple 328's.  I'm just familiarizing myself with it right now with one processor, but am looking forward to adding more to it!
Logged

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

hy!i have dificults for creating an aatmega 328 board...coul you share egale files?i want to start with arduino...
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 515
Posts: 26264
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Sure, here you go.

Make sure both the .brd and .sch are open when you save, otherwise the files get out of sync and you have to start over.

* arduino_2009.brd (56.79 KB - downloaded 7 times.)
* arduino_2009.sch (337.42 KB - downloaded 18 times.)
* arduino_Uno_Rev3-02-TH.brd (180.6 KB - downloaded 34 times.)
* arduino_Uno_Rev3-02-TH.sch (1182.22 KB - downloaded 19 times.)
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: 1 2 [3] 4 5 6   Go Up
Jump to: