Im relatively new to micros and have a conundrum. My senior project involves using a touch screen and xbee modules for wireless communication. My question is, since both of them require serial communication, should I find a micro that has 2 serial ports, or is it possible to have both of them connected to the same serial port and select which one to communicate with?
2 Answers
You can't, in general, connect them to a single serial port. You'll need a microcontroller with (at least) two serial ports.
Sometimes, if you're trying to really minimise the cost of the microcontroller, you can implement a seral port using GPIO pins and I/O instructions. This can be very effective for a transmit-only serial port. But I would not recommend it for a project like this.
Logic level serial communication doesn't normally support multiple devices. You need two UARTs.
The SPI bus supporters multiple devices which are each selected using a chip select (CS) line.
The I2C bus supports multiple devices which are selected using inband protocol addressing.