Society of Robots - Robot Forum

Electronics => Electronics => Topic started by: Joker94 on December 27, 2009, 07:04:04 PM

Title: What does it take to connect 2 MCU's
Post by: Joker94 on December 27, 2009, 07:04:04 PM
Hi every one

i want to connect an atmega8 and an atmega 168 for a project i may end up doing and want to know what i need to do for this to happen.

I2c, Uart?

Thanks

Joker94
Title: Re: What does it take to connect 2 MCU's
Post by: SmAsH on December 27, 2009, 07:16:50 PM
Well, it depends on the project... What do they need to do...
I2c could be useful because it doesn't use up uart...
What are they going to be doing?
Title: Re: What does it take to connect 2 MCU's
Post by: Razor Concepts on December 27, 2009, 07:18:44 PM
Why do you need 2? I'm betting there is a better solution than using two microcontrollers.
Title: Re: What does it take to connect 2 MCU's
Post by: Joker94 on December 27, 2009, 07:25:01 PM
mostly i am just curious. But if i did end up doing it would it be possible to have upto 16 servos in a program?

And another quick question, what are  the possible uses for the left over ports on mcu's, eg. D ports are used for the servos, c ports are used for the sensors, what about the B ports and the other ports not being used. More servos, LEDs?

Thanks Again

Joker94
Title: Re: What does it take to connect 2 MCU's
Post by: Razor Concepts on December 27, 2009, 07:26:58 PM
You dont have to use each port for each things, there are 8 channels on each port and each channel can do different things. So D0 through D3 can drive servos, and then I can make D4 through D7 drive LEDs.
Title: Re: What does it take to connect 2 MCU's
Post by: SmAsH on December 27, 2009, 08:19:13 PM
Also, if you were doing this because of the lack of servo ports, why not get an I2c/UART servo controller?
Title: Re: What does it take to connect 2 MCU's
Post by: Joker94 on December 27, 2009, 08:38:40 PM
Well if i caan connect another mcu throught i2c or uart to my main mcu to get extra servo and sensor ports would be ok for now.

Would i be able to connect them via UART just be connecting then with 2 wires.  Atmega8 tx to 168 rx and 8rx to a 168 tx.

thanks very much

Joker94
Title: Re: What does it take to connect 2 MCU's
Post by: Soeren on December 27, 2009, 09:38:06 PM
Hi,

You can use 2 I/O lines for synchronous comms, one line for clock and the other for data and then you just have to write the routines for sending and receiving.
Title: Re: What does it take to connect 2 MCU's
Post by: Joker94 on December 27, 2009, 10:17:07 PM
so connecting them by tx and rx will work.

Thanks For that

Joker94