Electronic – How to communicate between 8051 microcontroller and PC

8051communicationmicrocontrollerparallel

I am working on a project of mine in which I am getting data from multiple sensors into an 8051 microcontroller.

I'm building a car simulator in which I have various car components such as a steering wheel, brake, accelerator and clutch paddles and some other components. I have some sensors attached to each of these components.

The data from each sensor won't exceed more than a byte. In total I have 8 sensors, which makes a total of 8 Bytes data and the data should be transmitted at least 100 times in one second.

Now, I have to continuously transmit the data coming from these sensors to the PC via micro-controller where it would be further processed. Is there any way I can communicate this data to the PC in parallel as I have data coming from a number of sensors?

Best Answer

It will be essential to know the size of the data read from each sensor, how many sensors and how fast of repetition rate that you need to get the data into the PC. Without that data it will be difficult to recommend an exact solution.

That said it may be reasonable to suggest that you configure your 8051 UART port's TXD and RXD lines to talk to a 1x6 header that can mate to one of these cables:

enter image description here

This can then plug into your PC's USB port. Using the appropriate virtual comm port driver from the FTDI web site the solution can easily transfer data in serial manner from your 8051 to the application in the PC. The PC app thinks it is simply talking to a COM port.

These serial adapter cables can easily transfer serial data at rates to 230.4 K baud. Using a standard 8N1 serial framing this baud rate translates to a just over 23000 bytes per second of raw transfer rate. If you had 12 sensors, each with two bytes of data and you wanted to update the data to the PC at 100 times per second this would equal an application data rate of 12*2*100 = 2400 bytes per second. As you can see there would be plenty of remaining bandwidth on the virtual comm port channel to wrap a protocol around your application data and send it to the PC.