2

Author Topic: What does it take to connect 2 MCU's  (Read 1689 times)

0 Members and 1 Guest are viewing this topic.

Offline Joker94Topic starter

  • Supreme Robot
  • *****
  • Posts: 1,119
  • Helpful? 26
What does it take to connect 2 MCU's
« 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

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: What does it take to connect 2 MCU's
« Reply #1 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?
Howdy

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: What does it take to connect 2 MCU's
« Reply #2 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.

Offline Joker94Topic starter

  • Supreme Robot
  • *****
  • Posts: 1,119
  • Helpful? 26
Re: What does it take to connect 2 MCU's
« Reply #3 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

Offline Razor Concepts

  • Supreme Robot
  • *****
  • Posts: 1,856
  • Helpful? 53
Re: What does it take to connect 2 MCU's
« Reply #4 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.

Offline SmAsH

  • Supreme Robot
  • *****
  • Posts: 3,959
  • Helpful? 75
  • SoR's Locale Electronics Nut.
Re: What does it take to connect 2 MCU's
« Reply #5 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?
Howdy

Offline Joker94Topic starter

  • Supreme Robot
  • *****
  • Posts: 1,119
  • Helpful? 26
Re: What does it take to connect 2 MCU's
« Reply #6 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

Offline Soeren

  • Supreme Robot
  • *****
  • Posts: 4,672
  • Helpful? 227
  • Mind Reading: 0.0
Re: What does it take to connect 2 MCU's
« Reply #7 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.
Regards,
Søren

A rather fast and fairly heavy robot with quite large wheels needs what? A lot of power?
Please remember...
Engineering is based on numbers - not adjectives

Offline Joker94Topic starter

  • Supreme Robot
  • *****
  • Posts: 1,119
  • Helpful? 26
Re: What does it take to connect 2 MCU's
« Reply #8 on: December 27, 2009, 10:17:07 PM »
so connecting them by tx and rx will work.

Thanks For that

Joker94

 


Get Your Ad Here