Posted: Mon Jun 25, 2018 7:51 pm Post subject: Total time for PRINT STATEMENT
Hello
I am trying to minimize the time required by PRINT statement to print 1 byte of data
Considering a baudrate of 38400, time required to send 10bits of data (1 start bit +8 bit data + 1 stop bit)= 10/38400= 260usec
When I use the Print Command to print 1 byte of data it takes around 785usec/byte
Is there a way where I can reduce this amount of time required to Print a byte and get it close to Ideal scenario (i.e 260usec)
I tried the PUT command but it did not work (if anyone could provide an example that would be great)
Thank you
'use OPEN/CLOSE for using the second UART Config Serialin1 =Buffered , Size=32 Open"COM2:"ForBinaryAs #1 ConfigPrint1=Portd.4 , Mode=Set ConfigPortd.4=Output
Dim C3 AsByte
C3 =81
Do
Print #1 , Chr(c3)
Loop
[/code]
(BASCOM-AVR version : 2.0.7.5 , Latest : 2.0.8.1 )
at some stage it is a good idea to read the manual.
or to search the forum.
what you are missing is that you you send 3 bytes : your data byte, and a CR + LF
To suppress the CR and LF, end the line with ; (semi colon) _________________ Mark
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum You cannot attach files in this forum You cannot download files in this forum