Two Atmega8

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

Hi,
This is just a thought. With my Atmega8 i always run out of GPIOs or EXT-INTs or TIMERS. Can I combine two MCUs on the same CRYSTAL to be in sync.

1. What is Daisy Chain?
2. What mechanism is used to communicate between the two?
3. Do the work in Master-Master mode or Master slave?

What you think, are people doing such things already?

PS: I searched the forum but didn't find answers to my questions above, thus a post.

Thanks,
K

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

Yes, you can drive a second AVR's XTAL1 pin from the XTAL2 pin of the 'master crystal' AVR.

However it is always simpler to use a single AVR with more legs. It will be cheaper too.

You can often run a whole application on one Timer.
The Atmega88 has PCINT on every pin.
You can often share GPIO pins with multiplexing or charlieplexing.

Explain your project requirements.
Readers may be able to offer a few tips.

Believe me. Using multiple AVRs as Master-Slave is a pain. If your project needs a separate AVR in several remote places, SPI, I2C etc become 'too long'. You need RS485 or radio.

David.

Last Edited: Wed. Mar 20, 2013 - 09:31 PM
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

https://www.avrfreaks.net/index.p...
In particular:
https://www.avrfreaks.net/index.p...
(Time coming out of reset will vary, so you start off way off. Any timed mechanism such as EEPROM write will not be exact.

https://www.avrfreaks.net/index.p...

You can put lipstick on a pig, but it is still a pig.

I've never met a pig I didn't like, as long as you have some salt and pepper.

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

david.prentice wrote:

Explain your project requirements.
Readers may be able to offer a few tips.

David.

I think I will have to think of a project. It will be interesting to learn the concept of master slave or 12c or spi . I will search for some tutorials.

I bought a tube of Atmega8 I have 15 of them only for a dollar each (i.e. INR 55) two years back, now the price is thrice. So wanna make use of them.

I am not from electronics background so i lack the terms to search for.

Thanks,
K

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

IMHO, your $15 would have been better spent on an ATmega328P and a ATmega1284P. With any change, you could buy a couple of brainless chips. e.g. ATmega8.

For development, it is easier to use the biggest and best of a family.

Having debugged the project, you may well be able to run it on a cheaper chip. For example, usbasp and many V-USB projects will run fine on a mega8. As will 'I2C Slave' or 'SPI Slave'. 'SPI Master' can have better performance if you use the USART_MSPI mode of modern AVRs.

David.

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

Have you though of expanders such as the PCF8574 (A) -needs two I2C pins : gives you 8 (but slower); can be cascaded)