I have a problem with interfacing two serial port with 8051 microcontroller. I have to use bar code reader and RF reciver and transmitter which both of them interfaced serially. I am thinking to add an ic to controller these to serial ports, but I don't know which type of IC I should used!! could any one help me, please?
Thanks,
As i under stand urs problem u want to connect the serial port of 8051 withtwo peripherals. The solution is Multiplexer IC.With its select lines u can select the peripheral with which the controller will communicate at particular instance.
The solution is Multiplexer IC NO, absolutely not! The solution might be a Multiplexer IC, but based on a statement above VERY unlikely.
if you can fully and totally GUARANTEE that the two serials never transmit at the same time, you may try multiplexing (and then find out that they DO send concurrently sometimes :( ). Based on previous posts in this thread: how do you control that nobody swipes a card when the other trasmission is active????
but which type of IC muliplexing I should used if you can not figure that out yourself, the go to NXP and click on 'logic'
you will need one multiplexer and two transcievers.
but again how do you control that nobody swipes a card when the other trasmission is active????
The solution you need is a derivative with 2 UARTS, and if that is not possible, you need to verify that one of the serials is a very low baudrate which I asked and you did not bother to answer.
Erik
One not so nice solution is to have a mux, but let the serial data from the two serial ports be sent to interrupt pin of the processor. If you listen to the RF receiver when someone uses the bar code reader, then you will know that you just lost data, so you can give proper feedback - an error sound or similar to request that they read the bar code again.
With a little bit of luck, the RF link will send all data multiple times (if it is one-way, it can never know if there are radio interference blocking one transmission) and then you may have time to switch back from the bar code reader to the RF receiver and still pick up one or more of the transmissions.
Yes, it is a kludge. I would definitely have selected a processor with more than one UART.
Can hardware flow control be used to ensure that one device doesn't transmit while the processor is listening to the other...?
But two UARTs would still be better
... why not just add an external UART?!
If you're short of pins, UARTs are available with I2C and SPI connections...
Why not choose a device with two UARTS.
Job jobbed.
View all questions in Keil forum