Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
Andy Neil
11/05/11 04:45
  11/05/11 06:14

Read: 454 times

#184554 - Duplicate or Generalise
Responding to: ???'s previous message
Alex Volk said:
I saw that example. But it not uses both serial at time.

Assuming the 2 UARTs are the same, Once you know how to use one UART, using another is just a matter of doing the same stuff again!

You have 2 choices:

1. Simply duplicate the code for the 2nd UART;

2. Adapt your code so that it takes some kind of "parameter" to enable it to work with either UART - ie, generalise it.

In your case, as a beginner, where you have only 2 UARTs and a very simple processor (8051), I would recommend that you go for the 1st option.

If you were writing code for, say, a PC to handle a dozen COM ports - then the 2nd option might become more appropriate...

Just have problem to write setup code for 2-nd uart.

What particular problem(s), exactly, do you have?

List of 12 messages in thread
Both UARTs simultaneous works      Alex Volk      11/04/11 08:16      
   yes      Erik Malund      11/04/11 09:49      
      Both with Queues      Michael Karas      11/04/11 12:50      
         C code      Alex Volk      11/04/11 15:11      
         Or C      Neil Kurzman      11/04/11 16:54      
            No simultaneous work      Alex Volk      11/04/11 21:09      
               The Example is for one UART      Neil Kurzman      11/04/11 22:03      
               Duplicate or Generalise      Andy Neil      11/05/11 04:45      
   at89c51RE2      Alex Volk      11/08/11 23:48      
      Start a new thread      Andy Neil      11/09/11 00:08      
         The same      Alex Volk      11/09/11 05:19      
            but not same problem      Erik Malund      11/09/11 06:30      

Back to Subject List