Embedded Problem....

Discussion in 'Embedded Systems and Microcontrollers' started by himanshu1990, Aug 2, 2010.

  1. himanshu1990

    Thread Starter New Member

    Jun 23, 2010
    16
    0
    Hi there guys...

    I have 1 problem that was asked in some sort of an interwiew....
    and i cudnt answer it coz m a beginner in this field...

    heres that questn:-

    We have two microcontrollers, each connected to a PC through UART. (uC 1 with PC1 and uC 2 with PC 2)
    Data is to be sent from PC1 to uC 2 through uC 1 using I2C. Whatever data is sent from PC1 to uC 1 serially (can be of arbitrary length, not greater than 20), uC1 should store that internally, flushing out any previous data.
    PC2 is used to command uC2 to get the data from uC1 over I2C and the data received is to be sent to PC2 through the serial port.

    how do I do that..?
    what all things do i need..?
    And m a little slow with programming so cant make out with the full fledged progam...

    plz do reply...

    Thanks...:)
     
  2. maxpower097

    Well-Known Member

    Feb 20, 2009
    795
    388
    I beleive the data flow would be PC1 > UC1 by serial UC1 > UC2 by i2c, UC2 > PC2 by serial again and vice versa.
     
  3. himanshu1990

    Thread Starter New Member

    Jun 23, 2010
    16
    0
    yes sir exactly....
     
  4. sage.radachowsky

    Member

    May 11, 2010
    241
    38
    Well, for each of the microcontroller units, you need:

    * a microcontroller
    * a power supply for it
    * an RS232 level translator chip, like the MAX232 family of chips, if you want to use read RS232 levels to communicate with the PC, and any capacitors required by that chip
    * a crystal or ceramic oscillator would be good, but it is not necessary if you're using a slower baud rate because most internal oscillators on uC are good enough to do up to 9600 baud
    * the programming header for the microcontroller and the capacitors or resistors for the control of the reset pin
    * bypass capacitor for the microcontroller
    * connectors for each side, the RS232 to PC and the I2C to the other microcontroller board.
    * the PCB or breadboard to connect everything together.

    That should do it.
     
  5. himanshu1990

    Thread Starter New Member

    Jun 23, 2010
    16
    0

    hey thanx sir..

    well when I am using the Uart do I need to use the RS232...??

    I searched the net and found that RS232 is outdated and all...

    cud you plz Explain a bit...???

    Thanx a lot...
     
  6. Markd77

    Senior Member

    Sep 7, 2009
    2,803
    594
    The serial port uses RS232 so, outdated or not, that's what the question was asking for.
     
  7. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    UART, RS232, PC Serial Port, are all the same thing...
     
  8. sage.radachowsky

    Member

    May 11, 2010
    241
    38
    Well, here's how I see the terms:

    The RS232 standard means that the signals are positive and negative. There is a valid range according to the standard of 3 to 15 Volts, both positive and negative. But some computers will understand and output 0V as the "1" voltage and +5V as the "0" voltage. That is the cheap way that it is sometimes implemented.

    Then again, some people use RS232 to mean UART communications even if it is TTL level (like 0 and 3.3V). But I think this is incorrect.

    Then there is UART, which means serial data communications where the "1" is high (typically 3.3V or 5V) and "0" is 0V. It may also refer to RS232 levels but I think this is not really correct.

    RS232 is becoming outdated but it is still commonly used because it's so common. It works well for lower data rates and over distances. If the voltages are implemented correctly as positive and negative, then it is rather impervious to noise and interference, and it is pretty simple.

    There are also RS422 and CANbus and other bus standards when there is a need to transmit data in a noisy environment, but they are more complicated to implement.
     
  9. BMorse

    Senior Member

    Sep 26, 2009
    2,675
    234
    Well, if people want to get technical, lets see what WiKi says:

    RS232:
    UART:
    Serial:
    All have to do with the same thing.....

    B. Morse
     
Loading...