The first example would execute much quicker.
Unfortunately, it does so by not sending all 4 bytes like you might anticipate.
When putting bytes in TXREG, you have to make sure that the USART is finished sending the last byte you put in it.
Typically, you would check the TXIF bit to make sure it's safe to send, which the first example doesn't do, and the HSEROUT does automatically.
Most likely, the HSEROUT will be faster.Next question, which is faster.
Number = 0
While Number < 3
'Code in here converst all three array variables so that they will be display properly
'whereas the HSEROUT statement bellow does it for you.
wend
Number = 0
WHILE Number < 3
TXREG = Data[Number]
Number = Number + 1
WEND
''''''''''''or''''''''''''''
HSEROUT [Hex2 Data[0],Hex2 Data[1],Hex2 Data[2]]
But there's no way of knowing, without the actual ..."Code in here converst all three array variables so that they will be display".
Because of the first answer.Final question, could someone give an example of when or why you would need to poll the TXIF: USART Transmit Interrupt Flag bit.
hth,






Bookmarks