PDA

View Full Version : Timming



ruijc
- 6th January 2008, 12:23
Hi guys,

i'm trying to calibrate a set of instructions in order to get 1 second total time.

the code is as follows :

FOR ADDR=0 TO $706

adcin gpio.0,va

temp =(va */ 50 ) >> 2
temp=temp/10

pause 800 ' calibration to ge 1 value per second
debug " Valor Gravado: ", dec temp," Na posição ", dec ADDR, 13,10

I2CWRITE SDA,SCL,CTW,ADDR,[temp.highbyte]
pause 10
ADDR=ADDR+1
I2CWRITE SDA,SCL,CTW,ADDR,[temp.lowbyte]
pause 10
ADDR=ADDR+1
if but1=1 then 'stop recording
goto start
endif
NEXT

The "pause 800" is the line where i'm currently fine tuning the timming.

My method is trial and error ( not to efficient i'm affraid ) :(

How do you guys do this ? Is there a tool to make this easier ?

Acetronics2
- 6th January 2008, 12:35
Hi,

MPLAB Simulator ( MPSIM ) seems the best tool ...

Alain

Darrel Taylor
- 6th January 2008, 16:37
instruction execution time
http://www.picbasic.co.uk/forum/showthread.php?t=365
<br>