Well, I was eager to try the suggested code and the results:
Some FYI:
- In the code I only write to one single led solely for dataframe checking purposes, this is what you see in the analyser shot.
- A normal dataframe takes about 24 uS (1, Mhz see above analyser shots) and up to 30 uS dataframe time (800 Khz) is readable by the LED.
Above that time and there is no response
Mark's code produces an OK pattern/waveform but the complete dataframe takes 82 uS to complete (waitus=1).
I then removed the waitus statements and replaced them with NOP this reduced dataframe time to about 58 uS.
I also tried if the virtual port vs direct port setup made any difference, none noticeable.
I knew assembler was faster/fastest but not by this much, so my conclusion is that it is not possible in Basic and probably the reason for the assembler approach.
Thanks for code anyway Mark!
Jim
↧