Author Topic: how do you connect to atmega's together so they can communicate with each other  (Read 5901 times)

0 Members and 1 Guest are viewing this topic.

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
once again it's me, interrupting your afternoon with QUESTIONS. Well i got a line follower setup with an atmega 168 but i want to do something cool. I have an attiny 2313 and i want to connect them together. the attiny 2313 runs a list of leds. so when the line follower is turning left it sends information to the attiny and the attiny does the corresponding 'led left flashing sequence' (or whatever with lights). I dont know how to start. I was thinking you could just connect their Tx Rx pins or you could use ADC....confused really. i just want to use one wire. The simple solution would be to have three outputs, left right and center from the line follower to three inputs of the attiny.
would appreciate any help
thanx in advance

paulstreats

  • Guest
You probably wont get away with 1 wire. It is possible but it will take too much coding to make your own comm system. You could use any such as serial, i2c etc.. or simply have 1 pin for each sequence. As for adc, you would need to invest in some DAC's to make it work

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
i see what you mean. So is it possible to connect the tx and rx of one atmega to that of the other? or do i have to convert to serial first or something

Offline Steel_monkey

  • Full Member
  • ***
  • Posts: 85
  • Helpful? 0
You can use  USART, in synchronous or asynchronous mode, for more info visit http://www.societyofrobots.com/microcontroller_uart.shtml#tx_rx. And also refer to datasheet http://www.datasheetcatalog.com/datasheets_pdf/A/T/T/I/ATTINY2313.shtml
P.S. If you need only blink LEDs, just use universal register- serial input from atmega 168 (from usart or bitbang), and parallel output data on atmega command. Refer to 74HC299 datasheet.

Offline Admin

  • Administrator
  • Supreme Robot
  • *****
  • Posts: 11,704
  • Helpful? 173
    • Society of Robots
When you say only one wire, why? What about the ground wire? :P

Offline rox2007Topic starter

  • Full Member
  • ***
  • Posts: 95
  • Helpful? 0
i was thinking about passing Digital/analog signal from one microcontroller then the other one will receive that signal and convert it using ADC. or maybe using i2c.

Offline Steel_monkey

  • Full Member
  • ***
  • Posts: 85
  • Helpful? 0
Keywords again: datasheet, USART. This is all you need to communicate 2 AVRs.
« Last Edit: February 19, 2008, 12:01:21 PM by Steel_monkey »

 

SMF spam blocked by CleanTalk