This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

RS485 with 89c51

Hi everybody,

I want to receive data from a Loadcell Indicator throughout RS485. The LoadCell Indicator only send data to Micro chip. I also want my Micro chip communicate with the computer in both ways (transfer and receive) by RS232.

Can I do like that?

This is the first time I code for micro chip. I already try to use RS232, but with RS485 I do not have enough material to do. Please help me with any idea, useful links, papers or example codes.

I'm using T89C51AC2 micro chip and C in coding.

Thank you so much,
Huy

Parents
  • Thank you Sirs,

    But I am student, I bought this chip so I have to use this one. I think may be I can use another small chip to receive data from LoadCell and pass it to main chip by P0 and P2. (Actually, the loadcell has 19 bits, but I will cut 3 LSBs to get 16 bits)

    (P1.3 is used to generate PWM, and P3.0 P3.1 are used for RS232 so P0 and P2 are free)

    May I do like that?

Reply
  • Thank you Sirs,

    But I am student, I bought this chip so I have to use this one. I think may be I can use another small chip to receive data from LoadCell and pass it to main chip by P0 and P2. (Actually, the loadcell has 19 bits, but I will cut 3 LSBs to get 16 bits)

    (P1.3 is used to generate PWM, and P3.0 P3.1 are used for RS232 so P0 and P2 are free)

    May I do like that?

Children
  • "But I am student, I bought this chip so I have to use this one."

    So, Hopefully, this is your first lesson learned: don't buy the chip until after you have determined which chip you need!

    As Erik said, this is a classic example of "putting the cart before the horse".

    Anyhow, if you're really stuck with it...

    "I think may be I can use another small chip to receive data from LoadCell and pass it to main chip"

    Yes, although that's an extra cost - check carefully that it won't work out cheaper to just go and buy a 2-UART 8051!
    And also consider your timescales to design it in - what is your deadline?

    You can get external UART chips with parallel interfaces and also with SPI or I2C connections to the main processor.
    You could even use a 2nd, small, cheap, microcontroller...

    Again, there's the soft-UART option...

  • Thank you all for your comments.

    Huy