Two-Legged Self-Balancing System

 

 

 

Insert your page code here.

 

Serial Communication

 

Serial communication was used to transmit the value of the tilt sensor from the PIC microcontroller to the host computer (com port 1) and again to return the resultant motor duty cycle computed by the host computer to the PIC microcontroller.

The default transmission rate for the com port used was 9600 baud, or 9600 bits per second. Testing at this data rate proved to be sufficient and so it was maintained through the course of this project.

As the PIC microcontroller uses only TTL levels and the serial port of the host computer uses RS232 levels, a converter would be required. Recalling from a previous data communications lab at BCIT where the ICs MC1488 and MC1489 were used for this purpose, they were then selected to be implemented in this project as well. The MC1488 line driver converts TTL levels into corresponding RS232 levels, while the MC1489 receiver does the opposite.

 

 

 

 

 

 

Back