Electronics > Projects, Designs, and Technical Stuff

Multiple UART on AVR controller

(1/2) > >>

slowe:
Hello everyone,

I am carrying out a communication project, with RS232 / RS485 and USB, we come to communicate with a micro controller to turn on relays. Programming level I have no problem, and the project works. I am going to print a PCB and I would like to check that everything is fine, secure, etc ...

Technical informations :
- The 3 interfaces (RS232 RS485 USB) are connected to the same TX and RX of the uC, because only one means of communication is used, the other 2 are not connected. It is only to be more flexible in terms of my equipment
- For RS232: only channel 1 is used, do I have to connect the pins of channel 2 of the chip to something or can I leave them floating?
- For the RS485, Is it well connected?
- For USB, an external power is used so I use the VUSB pin to force reset FT232RL


AVR side:
- I connected the TX pin of the uC to the RX pins of the interfaces via a resistor, I added a pull-up resistor, each interface will receive the info but as only one will be connected the others should not cause problems yes ?

- For the RX of the uC it is connected to an AND gate. On this AND gate I have 3 inputs, these are the TX pins of the interfaces, as soon as an interface has a low level it will be transmitted. I added a pull-up resistor on each TX of the interfaces, it is good ?


Precision :
- I absolutely must have everything on the same UART. So no "change uC ...." please !
- I am using an ATMega328pb

razvan784:
You seem to have Tx and Rx swapped in several places, such as the 232 and 485 chips - you have more than one logic output driving the same line.
Edit: also, you forgot to add a digital output to change the direction of the 485 bus.

slowe:
Exact you are right I have just reversed for the 232 and the 485, the usb is good I checked !

"you have more than one logic output driving the same line." What do you mean ? If it's for the RX / TX it's done on purpose, as I explained, only one cable will be connected at a time it will be RS232 OR RS485 OR USB, never more than one at the same time , and code level, I am obliged to keep only this line there.

And no, this is a MAX13487E with automatique direction bus, So normally there is no need for a pin to control this

voltsandjolts:
Hmm, Maxim. Yuk.
Hmm, autodetection. Yuk.
I would recommend you build in an option for a standard transciever with direction control.
Always nice to have a plan B, especially with Maxim.

slowe:
very well I put my first assembly, this one, is it good level protection etc ...? What is the best ?

Navigation

[0] Message Index

[#] Next page

There was an error while thanking
Thanking...
Go to full version