ar8051@yahoo.com
Newbie level 2
atmel 485
Hi all,
I am a newbie in microcontroller. Thank goodness I have found this forum.
I want to build a master and 2 slaves network with AT89C52.
What I have in mind is the following:
Master
--------
- I have 1 master with AT89C52 with 4x4 hex keypad attached plus
4 LEDs (first pair is for slave #1 - transmit and receive indicator, second pair
is for slave #2 - transmit and receive indicator)
- This master is connected to 2 slaves through RS-485 (so there
will be 2 RS-485 connectors on the master board)
Slaves
--------
- There will be 2 slaves (#1 and #2)
- Each slave is controlled by AT89C52
- Each slave has a RS-485 connector and 1 LED
What I want is:
- press keypad on master, let's say button #1 for slave #1, button #2 for slave
#2, then this press will send a bit 1/0 (toggle) to turn on/off the LEDs on the
slaves.
- when the master sends an input for a particular slave, the transmit LED will
light up.
- the bit will be sent through RS-485 to the corresponding slave (either #1 or
#2), the slave AT89C52 will receive the bit through RS-485, then the slave's
LED will light up (like saying "hey, I receive your command")
- after that, the corresponding slave will send an acknowledgement that
it has received the bit. It will send the ack via RS-485 back to master and
finally light up the receive indicator on master.
In short, master "talks" to slaves through RS-485 and slaves can "talk" back
to master through RS-485 as well. The LEDs are for indicators that bits are passed
around through RS-485 connectors.
With all the set up in my mind, I have questions:
- how to establish 2 RS-485 connectors on the master? schematic plus
the components please or even tutorial or hyperlinks.
I know that AT89C52 has only 1 UART (serial connection) -> do I need to
make 2?
- how to write the code so the RS-485 on the master can talk to RS-485 on
the slaves?
- do you think what I have in my mind is possible to implement or there might
be a problem?
Please give me some suggestions. I need help for this. Thank you for any
reply.
Hi all,
I am a newbie in microcontroller. Thank goodness I have found this forum.
I want to build a master and 2 slaves network with AT89C52.
What I have in mind is the following:
Master
--------
- I have 1 master with AT89C52 with 4x4 hex keypad attached plus
4 LEDs (first pair is for slave #1 - transmit and receive indicator, second pair
is for slave #2 - transmit and receive indicator)
- This master is connected to 2 slaves through RS-485 (so there
will be 2 RS-485 connectors on the master board)
Slaves
--------
- There will be 2 slaves (#1 and #2)
- Each slave is controlled by AT89C52
- Each slave has a RS-485 connector and 1 LED
What I want is:
- press keypad on master, let's say button #1 for slave #1, button #2 for slave
#2, then this press will send a bit 1/0 (toggle) to turn on/off the LEDs on the
slaves.
- when the master sends an input for a particular slave, the transmit LED will
light up.
- the bit will be sent through RS-485 to the corresponding slave (either #1 or
#2), the slave AT89C52 will receive the bit through RS-485, then the slave's
LED will light up (like saying "hey, I receive your command")
- after that, the corresponding slave will send an acknowledgement that
it has received the bit. It will send the ack via RS-485 back to master and
finally light up the receive indicator on master.
In short, master "talks" to slaves through RS-485 and slaves can "talk" back
to master through RS-485 as well. The LEDs are for indicators that bits are passed
around through RS-485 connectors.
With all the set up in my mind, I have questions:
- how to establish 2 RS-485 connectors on the master? schematic plus
the components please or even tutorial or hyperlinks.
I know that AT89C52 has only 1 UART (serial connection) -> do I need to
make 2?
- how to write the code so the RS-485 on the master can talk to RS-485 on
the slaves?
- do you think what I have in my mind is possible to implement or there might
be a problem?
Please give me some suggestions. I need help for this. Thank you for any
reply.