Shiftout loop time
Newzed
Posts: 2,503
Tracy, I have some Nichia RGB chips hooked up to my Stamp piggyback and they are working very well.· However, I'm having a bit of trouble with the timing so all 9 colors stay on for the same amount of time.· Can you please tell me how lomg the Stamp takes to execute this:
shiftout red, clock, msbfirst,[noparse][[/noparse]18,18]
pulsout latch 5
low latch
shiftout red, clock, msbfirst,[noparse][[/noparse]0,0]
pulsout latch 5
low latch
Thanks
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
shiftout red, clock, msbfirst,[noparse][[/noparse]18,18]
pulsout latch 5
low latch
shiftout red, clock, msbfirst,[noparse][[/noparse]0,0]
pulsout latch 5
low latch
Thanks
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
It is actually 4.7mS
The blue line that is 5mS long has a high and low command that takes 300uS so 5mS minus 300us= 4.7mS
So by adding a HIGH and LOW command to toggle a port pin I can see the time on the scope.
In the first one I read #7 upper left 2.584mS not sure what that is as i am not a seasoned scope reader
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think Inside the box first and if that doesn't work..
Re-arrange what's inside the box then...
Think outside the BOX!
You already got a good answer, and that is the sort of thing you can do yourself. Put the sequence inside a DO:LOOP if you have an analog scope and need it to repeat.
Alternatively, if you have a second stamp around there, or a Propeller (I know you do!), you can use its PULSIN function (or equiv) to measure the time that metron9 used to frame your time interval on pin p6. Subtract 120 microseconds for the time taken by the HIGH or LOW instruction.
Alternatively yet again, if you have neither 'scope nor additional Stamp, put the snippet in a FOR:NEXT loop and let it run through 10000 iterations, while you time it on a stopwatch or wall clock. Have it beep when finished. Subtract the time taken by the FOR:NEXT and divide the total by 10000.
By the way, is this an original BASIC Stamp, or a multislot? The times might be faster.
Why the "LOW latch" after the PULSOUT? The PULSOUT will leave the pin low anyway.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·
I have four different shiftout loops -
One for red, green, blue and yellow.
One for orange
One for magenta
One for cyan
I inserted a "high 3" at the beginning of each loop and a "low 3" at the end.
Here are the "high" times as measured with my HP 275MHz scope.· Please note that per Tracy, all the "low latch" commands have been deleted.
red:···· '·· 5ms············· also applies to green,blue,yellow
high 3
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]18,18]
PULSOUT latch,5
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]0,0]
PULSOUT latch, 5
low 3
org:·········· ·'· 23ms
high 3
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]18,18]
PULSOUT latch,5
PAUSE 6
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]0,0]
PULSOUT latch, 5
PAUSE 2
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]36,36]
PULSOUT latch,5
PAUSE 1
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]0,0]
PULSOUT latch, 5
PAUSE 4
low 3
mag:········ · '·· 23ms
high 3
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]72,72]
PULSOUT latch,5
PAUSE 1
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]0,0]
PULSOUT latch, 5
PAUSE 1
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]18,18]
PULSOUT latch,5
PAUSE 5
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]0,0]
PULSOUT latch, 5
PAUSE 5
low 3
cyan:······ ·'·· 20ms
high 3
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]36,36]
PULSOUT latch,5
PAUSE 3
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]0,0]
PULSOUT latch, 5
PAUSE 2
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]72,72]
PULSOUT latch,5
PAUSE 3
SHIFTOUT dat, clk, msbfirst, [noparse][[/noparse]0,0]
PULSOUT latch, 5
PAUSE 2
low 3
I may be off by a few tenths of a millisecond because I had to interpolate the reading at the end of the high trace.· Time/Div was set to give me a good visual reading.· Would you agree that these figures are about right?
Sid
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Yesterday is history, tomorrow is a mystery, and today is a gift.
That is why they call it the present.
Don't have VGA?
Newzed@aol.com
·