We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
i have problem how to set parity bit and stop bit in C language while sending data on serial port
On a C51: 1) You always get one stop bit. 2) To do parity set up the UART for 9 bit data.
#include <reg51.h> void SendCharWithParity( char Data ) { ACC = Data; TB8 = P; //PSW.P = even parity of ACC //TB8 = ~P; //odd parity SBUF = ACC; }