Problem with SW UART Rx...

Go To Last Post
3 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hi,
I have written a software UART with Rx pin on INT0... (mega128).
It works fine when INT0 interrupt is set to detect 0 logic level (the START bit), but when I set the INT0 interrupt to detect the falling edge... my SW-UART got stuck ! :-(
Any idea why?

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

groenhen wrote:
Hi,
I have written a software UART with Rx pin on INT0... (mega128).
It works fine when INT0 interrupt is set to detect 0 logic level (the START bit), but when I set the INT0 interrupt to detect the falling edge... my SW-UART got stuck ! :-(
Any idea why?

Without seeing your code, we can only guess. You'd have to use a combination of INT0 and timer interrupts I would think. You'll only see a falling edge at the beginning of the start bit and the beginning of the transmission of a zero bit that was preceded by a one bit. For example, for a transmission of a zero byte with no parity, you'll only going to see a single falling edge (the start bit).

Don

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Well, the original is here (PID = 133):
https://www.avrfreaks.net/index.php?module=FreaksAcademy&func=viewItem&item_id=133&item_type=project
... and I tried to enhance/adapt it in order to detect the start bit using the "falling edge".

Real men don't use backups, they post their stuff on a public ftp server and let the rest of the world make copies.