Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   Timing Codes (http://www.chiefdelphi.com/forums/showthread.php?t=24513)

Ryan Cumings 29-01-2004 17:54

Timing Codes
 
Does anyone know where to find the timing codes for the PIC?

Astronouth7303 29-01-2004 17:56

Re: Timing Codes
 
How so? you can have one of the timer interupts increment a variable, or count iterations throught the main loop.

Ryan Cumings 29-01-2004 18:02

Re: Timing Codes
 
Well I'm not looking to see how fast an algorithm would run. I'm looking to see how many cycles different instructions would take. Like an opcode reference.

Astronouth7303 29-01-2004 18:22

Re: Timing Codes
 
I'm not sure I understand entirely, but by the sound of it, I'd suggest using a timer interupt.

Rickertsen2 29-01-2004 18:47

Re: Timing Codes
 
Well there are 2 ways to do this.
1.) View the disassmebly code output from the compiler and trace the program flow.
2.)Set up a timer that rums in the background and times different operations.
Btw.. although the processor is 40mhz, one operation takes 4 clock cycles. Hence 10mips.

SeanCassidy 29-01-2004 20:53

Re: Timing Codes
 
This helped me a lot, it allows you two write two different but very acurate timers.

http://www.innovationfirst.com/FIRST...004-Jan-14.pdf

Ryan Cumings 29-01-2004 21:02

Re: Timing Codes
 
Not quite what I was looking for. There are some x86 opcode references that have an estimate for the number of cycles it takes to execute an instruction (This would be dependant on the maker of your cpu). I was wondering if anyone has seen something like this for the PIC18F8520?

Rickertsen2 29-01-2004 21:04

Re: Timing Codes
 
Quote:

Originally Posted by Ryan Cumings
Not quite what I was looking for. There are some x86 opcode references that have an estimate for the number of cycles it takes to execute an instruction (This would be dependant on the maker of your cpu). I was wondering if anyone has seen something like this for the PIC18F8520?

they all take 4 cycles except i think retfie(i think i'ts retfie. you better double check this). See the datasheet.

deltacoder1020 29-01-2004 21:33

Re: Timing Codes
 
It's not for the same model of PIC, but here is one document that lists the cycle times for various instructions - many of them may be the same (there's other stuff in the file too, scroll down):
http://www.microchip.com/download/li...och/40170b.pdf

Rickertsen2 29-01-2004 21:43

Re: Timing Codes
 
Quote:

Originally Posted by deltacoder1020
It's not for the same model of PIC, but here is one document that lists the cycle times for various instructions - many of them may be the same (there's other stuff in the file too, scroll down):
http://www.microchip.com/download/li...och/40170b.pdf

the cycles listed there should be the same. the 18x series has some additional instructions though. What they call 1 cycle refers to 1 instruction cycle not one clock cycle.

Ryan Cumings 29-01-2004 21:44

Re: Timing Codes
 
Thank you deltacoder, this was exactly what I was looking for (or pretty close). Finally tommorow I'll be off academic probation and back doing my passion =D

deltacoder1020 29-01-2004 22:26

Re: Timing Codes
 
amazing what Google can find ;) good luck on your programming - we just finished our drive base today, so now I get to start having some fun. (My team leader would probably shudder if he heard me saying that.)


All times are GMT -5. The time now is 08:45.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi