Home arrow Support arrow Forums

Luminary Micro Forums

<< Start < Prev 1 2 Next > End >>

femtotech

Expert Boarder
Click here to see the profile of this user

2008/09/20 04:31

Re:UART Tx Interrupt

Ok guys, I solved.

I used an FSM to manage the whole transmission packet. From the main loop I call a function that update the FSM checking the BUSY flag of the UART.

Perhaps it's not the best solution... anyway, it works.

Marco

login or register to reply

dereksoftstuff

Expert Boarder
Click here to see the profile of this user

2008/09/20 04:57

Re:UART Tx Interrupt

It would be nice if UART generated a tx complete interrupt. The trigger level interrupt is no good since UART baud rate can be so variable.

I'm currently calculating predicted completion time - based on baudrate, wordsize and number of bytes tx'd. Then feeding this into an interrupt generater, that fires at this predicted time, and calls function to check busy flag. The interrupt can refire at user frequency until tx is complete, but should get it on first or second poll.

This is good for half-duplex mode since can trigger user callback function on tx complete to change tx -> rx modes in RF comms say, and is very accurate.

I'm incorporating this functionality into timerUtils module, and will post.

login or register to reply

cb1

Platinum Boarder
Click here to see the profile of this user

2008/09/20 08:44

Re:UART Tx Interrupt

derek-

Wow! - not only do you write/share really neat software - this "predicted completion time" function seems highly original.

Thank you - your work is most useful and highly appreciated...

login or register to reply
<< Start < Prev 1 2 Next > End >>