Auto-Calibrating RS-232 (12C508) Just wondering if the 'wildly' varying (chip to chip) operating frequency of the 12C508 can be overcome for asynchronous communications. Maybe someone out there was wondering the same thing ?:-)) Assume: 1. Data sent is 7 bits or 8 bits 2. First bit sent (bit0) is a 'one' which is used to allow us to time the start bit pulse width 3. Transmitters and receivers may vary over time/temperature so we do synchronization on every byte 4. Clock frequency on 12c508 may be +/- 10% 5. Calculated timer is averaged each time This should allow any chip to act as a receiver from a host 'PC' or even another 12C5x chip. It seems to pass the simulation tests at 19200 baud nominal rate and 19200 with +/-10 cycle error (40uS per bit simulates a 12c508 running at 3.600 MHz). Dang near got 38400 to work...hmmmm...maybe some more bit tricks... Since the simulator is in lock step with the clock cycles, I changed the bits to be 'received' at different clock cycles. Changing the clock in the simulator does nothing to adjust the rate at which the data is "received" from the stimulus files. An excel spreadsheet file is included which generates the stimulus files - this might be handy for some other projects as well. Also, I included a neat macro LOCALx, to overlay temporary variables used within functions within a file (similar ot overlaid variables between files, careful..read the notes!). Lots of bit twiddling tricks just for funzies too. Any suggestions on a better way to do this ? Any one want to try this on real chips ? (Note: In '8' bit mode, (8 data bits with 1 sync bit) I'm assuming the host is sending a parity bit as data, can we do that from a standard PC?) I'll probably get brave and test it when my samples arrive, when I get a programmer, etc.etc... <;-) Thanks for any advice, enjoy... Ralph P.S. I uploaded the code to http://www.iversoft.com The receive function is about 35 bytes of code. The explanation of the receive function is about twice that! The stimulus files and spreadsheet files explode to a couple'o 100K. *Of all the things I've lost, I miss my mind the most*