Society of Robots - Robot Forum
Electronics => Electronics => Topic started 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
-
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?
-
Why do you need 2? I'm betting there is a better solution than using two microcontrollers.
-
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
-
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.
-
Also, if you were doing this because of the lack of servo ports, why not get an I2c/UART servo controller?
-
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
-
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.
-
so connecting them by tx and rx will work.
Thanks For that
Joker94