Home > other >  C51 serial port interrupt signal
C51 serial port interrupt signal

Time:09-22

I find code is basically a query to send, send the interruption of rare, in a sense the query is about sending and interrupt signal overhead, but the priority should be differentiated, sbuf queries are directly send data, and then query flags, determine whether to send complete, the disruption to send?

CodePudding user response:

Interrupt way to send, usually need a buffer, such as 32 bytes of buffer buf, let's put one or more need to send data in buf, and open to send interrupt, interrupt program interrupt when sbuf empty, will be sent out in one of data in buf wrote sbuf, until buf is empty, closed again send interrupt,

CodePudding user response:

reference 1st floor qq_708907433 response:
send interrupt way, generally speaking, there is a buffer, such as 32 bytes of buffer buf, let's put one or more need to send data in buf, and open to send interrupt, interrupt program interrupt when sbuf empty, will be sent out in one of data in buf wrote sbuf, until buf is empty, closed again send interrupt,

Can make directly? Sbuf is empty? Not have data to trigger directly?

CodePudding user response:

See the baud rate and MCU clock frequency, if need to send interrupt into a stack of consumption, significantly higher than the block to send, then send a blocking, some MCU have a serial port to send the DMA, another matter
  • Related