Author Topic: No UART? No Problem! Timer Interrupt Based Serial Port  (Read 4140 times)

0 Members and 1 Guest are viewing this topic.

Offline frank26080115Topic starter

  • Supreme Robot
  • *****
  • Posts: 322
  • Helpful? 2
No UART? No Problem! Timer Interrupt Based Serial Port
« on: February 26, 2008, 11:45:07 PM »
I wrote it in the member tutorial page, it doesn't support Rx right now, but it's useful as a debug port.

Can somebody tell me why it works flawlessly for 4800 baud but not 9600?

Time per bit for 9600 baud should be 104.166667 microseconds, counting the timer to 26 should take exactly 104 microseconds.

The error rate should be 0.1%, and I should have about 1664 clock cycles between each bit, shouldn't be that busy... maybe it's only hyperterminal's fault, or my FTDI chip is being a skank...

I just got 9600 baud working, but timer needed to be 24 not 26 like calculated, and at the front of interrupt A I had to add a tiny tiny delay. But now 4800 baud is messed up...
« Last Edit: February 27, 2008, 01:03:00 AM by frank26080115 »


Get Your Ad Here