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.
Hi... I need to have 2 serial ports on my 2051. First to communicate with PC (at 9600) and second to communicate to another device (at 1200). As I think I need to write something like bit-bang function with some time delays to reach a wanted baudrate. I think it would be like: unsigned char port_read (void) { unsigned char i,a; for (i=0;i<8;i++) { a = a | P1_7; a = _cror_(a,1); delay (?); } return a; } Data comes from lowest bit(bit 0,1,2..7) and 2 bytes in one session. Baudrate=1200. (I can stop transmition after 2 bytes received until I want to read another 2 bytes). I read data from P1_7. How to calculate delays for stabile work ? XTAL=11059200 For delay function is it enough to make like (for i=0;i<300;i++) nop; or I need to use an interrupt driven time generating ? Thanks
May be C code, please ?
You might try here: http://www.programmersheaven.com/zone5/cat27/2369.htm