1. Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.
    Dismiss Notice

sending command through USART

Discussion in 'AVR' started by veerubiji, Jun 14, 2013.

  1. veerubiji

    veerubiji Member

    Joined:
    May 4, 2011
    Messages:
    32
    Likes:
    0
    I am new to this kind of communication. I am able to send command from PC to AT90USB1287 microcontroller as well as able to get response using USB communication. Now i have connected another microcontroller(ATmega32) to this board via USART communication. I am trying to send command from PC to this board. Both controllers have different commands. So i have created an array containing both controllers commands in AT90USB1287 controller. My concept is compare the incoming command from PC with all commands in array based on result i am trying to send commands to ATmega32 controller using USART.Can anyone help me how to fix this? Do I need any conversion here? If so, please help me with an example.
     
    Last edited: Jul 24, 2013
  2. pedroromanvr

    pedroromanvr New Member

    Joined:
    Dec 13, 2009
    Messages:
    23
    Likes:
    0
    Location:
    México
    Can you explain deeply your approach?
    Why not to connect the PC directly to the atmega 32?
     
  3. wkrug

    wkrug Active Member

    Joined:
    May 30, 2010
    Messages:
    280
    Likes:
    29
    Location:
    Germany
    To connect the PC to the USART of the MEGA32 you need a level shifter like the MAX232 or another type.
    That Part works with +/-12V levels at PC side and 5V at Microcontroller side.
    Additional the signal will be inverted.
    There can be found some cheap solutions with Transistors in the Internet,
    but there is no guaratee that they will work proper on every PC.

    The 2 Microcontrollers can be connected directly together via a crossover from TXD to RXD.
    At the USB Controller I'll suggest You to write a parser that desides if the command is for the USB Controller or the MEGA32.
    The MEGA32 command then be given out to the USART.
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. misterT

    misterT Well-Known Member Most Helpful Member

    Joined:
    Apr 19, 2010
    Messages:
    2,697
    Likes:
    368
    Location:
    Finland

Share This Page