Usart_Write_Buf
Posted: 31 Oct 2007 13:21
I think this will help and improve the USART library.
Something like
procedure Usart_Write_Buf(var Buf : array [20] of byte)
or something that sends an array of bytes, and not just one byte. It will be better than using a cycle and in its body to call Usart_Write N times.
The reason I'm posting this is that if you have an array of char or a string and fill it with some bytes and after that use Usart_Write_Text if there's a $00 byte somewhere in the string the text is sent up to the $00 byte. The procedure Usart_Write_Text stops sending when it meets a $00 byte. Other ideas are welcome to solve this problem
Also - what I saw (as a problem maybe) was on a 18F4620 with a 10MHz, using PLL, i.e. 40MHz, using the UART on 115200 calling 10 times Usart_Write sends incorrect bytes. Putting a delay of 1ms between each call solved the problem, but that's not the idea.
Something like
procedure Usart_Write_Buf(var Buf : array [20] of byte)
or something that sends an array of bytes, and not just one byte. It will be better than using a cycle and in its body to call Usart_Write N times.
The reason I'm posting this is that if you have an array of char or a string and fill it with some bytes and after that use Usart_Write_Text if there's a $00 byte somewhere in the string the text is sent up to the $00 byte. The procedure Usart_Write_Text stops sending when it meets a $00 byte. Other ideas are welcome to solve this problem
Also - what I saw (as a problem maybe) was on a 18F4620 with a 10MHz, using PLL, i.e. 40MHz, using the UART on 115200 calling 10 times Usart_Write sends incorrect bytes. Putting a delay of 1ms between each call solved the problem, but that's not the idea.