Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

uart interrupt tx rx in Dos32 bit open watcom (Developers)

posted by tom Homepage, Germany (West), 12.11.2013, 12:24
(edited by tom on 12.11.2013, 12:36)

I did that something like 20 years ago.
I remember that I needed several iterations until it worked reliable, it's MUCH easier to only use *receive* interrupts.
that said,

> When I try to send the first byte in the main, I receive the
> interrupt call, but when I send another byte there(in the interrupt), I
> don't receive the next interrupt call for the next byte to transmit.

most likely you don't read the status register (often enough)

pseudocode


void interrupt interrupt_service_routine()
  {

  for (;;){
    status = input(status_port);

    if (status & (tx_ready | rx_ready | overflow) == 0)
        break;

    if (status & tx_ready)
      if (more_characters_to_send)
        outport(dataport, next_character);

     if (status & rx_ready)
        buffer[next++] = inport(dataport);

     if (status & rx_overflow)
        transmission_errors++;
     }

    outport(0x20, EOI);   // only NOW acknowledge interrupt

   }


note: this was it AFAIR; no guarantees of any kind;)

 

Complete thread:

Back to the forum
Board view  Mix view
22762 Postings in 2122 Threads, 402 registered users (1 online)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum