Hi All, I am trying to write software UART in C51. I manage to receive some thing but not the right character I sent. I think I have sync problem but it is hard to debug it. I will be glad if someone can send me such a code (I try to look for it in the net but I didnt found any C code). Thanks KH
A little harsh I found code for the 51' (some where) And wrote it for a PIC in C (and the PIC interupts are slow) google "bit bang uart 8052" or "bit bang uart 8051" It is quite posible for low baud rates. TX is easy. it is RX that is hard.
I should read the Post. send the bits back out another port pin. Then look at both on a scope. That worked for me. I assume you are using and interupt to pick up the start bit. You must unless you have a very fast sample rate. After the start wait 1 and half a bit times then start reading bits. (The PIC loses 1/2 a bit time in the int)