ziad
03-24-2009, 12:40 AM
I have been trying to implement a simple interrupt _ delay program using the propeller starter kit. However, there are few issues with the timing.
I am feeding the propeller with a TTL pulse on pin0, then I output a hight on pin1 and bring it back to zero. Running the propller at 80 MhZ(clock cycle of 12.5 ns) , I expect that the propeller would respond withing a clock cycle for the transition on pin1 to happen.
I am getting about 6.8 microsecond delay between the transition on pin0 and pin1 (that is 6800/12.5= 544 clock cycles). also I noticed that its taking the same amount of time (about 6.8 micro sec) for pin1 to go from high to low, although it should take one instruction.
Could someone please take a look at the code below and tell me if there is something wrong.
I would appreciate if someone can provide me with an alternative way.
Thanks
CON
_CLKMODE = XTAL1 + PLL16X
_XINFREQ = 5_000_000
PUB ButtonBlinkSpeed ' Main method
dira~~
outa := 0
repeat ' Endless loop
waitpeq(%0001,%0001,0)
outa := 1
outa := 0
I am feeding the propeller with a TTL pulse on pin0, then I output a hight on pin1 and bring it back to zero. Running the propller at 80 MhZ(clock cycle of 12.5 ns) , I expect that the propeller would respond withing a clock cycle for the transition on pin1 to happen.
I am getting about 6.8 microsecond delay between the transition on pin0 and pin1 (that is 6800/12.5= 544 clock cycles). also I noticed that its taking the same amount of time (about 6.8 micro sec) for pin1 to go from high to low, although it should take one instruction.
Could someone please take a look at the code below and tell me if there is something wrong.
I would appreciate if someone can provide me with an alternative way.
Thanks
CON
_CLKMODE = XTAL1 + PLL16X
_XINFREQ = 5_000_000
PUB ButtonBlinkSpeed ' Main method
dira~~
outa := 0
repeat ' Endless loop
waitpeq(%0001,%0001,0)
outa := 1
outa := 0