Go Down

Topic: Building a dual MCU project with two ATmega328 chips (Read 9 times) previous topic - next topic

Nick Gammon

ICSP. The serial interface is only for the bootloader.
http://www.gammon.com.au/electronics

CrossRoads

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

tim7

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

Code: [Select]
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: [Select]
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.

CrossRoads

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

CrossRoads

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

Constantin

#35
Aug 04, 2012, 01:29 pm Last Edit: Aug 04, 2012, 01:33 pm by Constantin Reason: 1
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...

CrossRoads

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.

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.

CrossRoads

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

Bajdi

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.
www.bajdi.com

CrossRoads

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

CrossRoads

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

CrossRoads

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

RaMansell

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!

mihun70

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

CrossRoads

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

Go Up