Got the A/D function working. I'm finding that the fastest I can make the Pro
Plus do a convert and report it is about 3 milliseconds. That seems slow, but I
don't see a spec to check. Here is my test program:
for i=1 to 100
print AD(2)
next i
It takes about 315 milliseconds to do 100 reads, no matter what baud rate I run
at. I have it smoking along at 921.6 Kilobaud, leading me to suspect the biggest
delay is A/D conversion.
Is 3 milliseconds about right or can it be sped up any?
George
AD speeds
-
YahooArchive
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD speeds
The product info page for the Pro Plus says the A/D speed is 200 KHz. That's 5
microseconds. I'm getting 3 milliseconds, not microseconds. Could the holdup be
in the host PC, not acknowledging the reads fast enough?
George
microseconds. I'm getting 3 milliseconds, not microseconds. Could the holdup be
in the host PC, not acknowledging the reads fast enough?
George
-
YahooArchive
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD speeds
I deleted the PRINT function and got A/D conversions in 14 microseconds. That's
fast. Here is the test program:
for i=1 to 1000
b=ad(2)
next i
So I make a read, do nothing with it, and make another read, up to 1000 of them.
Took 14 milliseconds to do 1000 reads. That's 14 microseconds for the read plus
the for/next looping. by adding the PRINT function, the 14 microseconds grew to
3 milliseconds, even at 921.6 kilobaud on the com port.
I'm hoping there is a way to speed up the printing. ??
George
fast. Here is the test program:
for i=1 to 1000
b=ad(2)
next i
So I make a read, do nothing with it, and make another read, up to 1000 of them.
Took 14 milliseconds to do 1000 reads. That's 14 microseconds for the read plus
the for/next looping. by adding the PRINT function, the 14 microseconds grew to
3 milliseconds, even at 921.6 kilobaud on the com port.
I'm hoping there is a way to speed up the printing. ??
George
-
YahooArchive
- Posts: 1462
- Joined: Fri Oct 19, 2012 5:11 am
Re: AD speeds
AD conversion rates on the LPC2103 are about 10 micro-seconds, so that checks
out.
I did not see in your program where you changed the baud rate, with a call to
BAUD0 or writing directly to the registers.
Setting baud rate with the Windows Device Manager has NO affect on the baud rate
in BASICtools or TclTerm/MakeItC.
out.
I did not see in your program where you changed the baud rate, with a call to
BAUD0 or writing directly to the registers.
Setting baud rate with the Windows Device Manager has NO affect on the baud rate
in BASICtools or TclTerm/MakeItC.