BS2_Functions.spin Timing question
Sariel
Posts: 182
Hey guys!
I am new to this whole propeller thing, and I found this nifty object that is designed for folks like me that know the BS2 inside and out, and need a jumpstart in the propeller. I have a pretty time sensitive project going, and I was wondering if I have the time to learn all about the .spin language, or if I should just cut the corner and use the object.
My question is about a little comment in the object file itself that reads:
" Note: SHIFTIN/OUT, DEBUG/IN and SERIN/OUT are only recommended at 80MHz
Maximum Baud Rate is 9600.
For more options, use the"FullDuplexSerial" Library."
That being said, does that mean that I am going to be restrained to how fast SHIFTIN/SHIFTOUT works on the BS2? I completed the same project on the BS2, and while it worked, the amount of time it took to shift everything out then back in again, and get the needed results was unacceptable. I switched over to the Prop hoping that I could get things done faster. If I am limited by the speed this object can muster up, then I am going to have to bite the bullet and figure out how to use the 74HC595 and the 74HC165 without the object.
Any help, as soon as possible would be greatly appriciated. Thanks folks!
I am new to this whole propeller thing, and I found this nifty object that is designed for folks like me that know the BS2 inside and out, and need a jumpstart in the propeller. I have a pretty time sensitive project going, and I was wondering if I have the time to learn all about the .spin language, or if I should just cut the corner and use the object.
My question is about a little comment in the object file itself that reads:
" Note: SHIFTIN/OUT, DEBUG/IN and SERIN/OUT are only recommended at 80MHz
Maximum Baud Rate is 9600.
For more options, use the"FullDuplexSerial" Library."
That being said, does that mean that I am going to be restrained to how fast SHIFTIN/SHIFTOUT works on the BS2? I completed the same project on the BS2, and while it worked, the amount of time it took to shift everything out then back in again, and get the needed results was unacceptable. I switched over to the Prop hoping that I could get things done faster. If I am limited by the speed this object can muster up, then I am going to have to bite the bullet and figure out how to use the 74HC595 and the 74HC165 without the object.
Any help, as soon as possible would be greatly appriciated. Thanks folks!
Comments
And a bit of background on my project, just to make things easier....
I want to build a cable tester. The basic idea I have is to have a mating connector on the parallel end of a 74HC595, and another on the parralel end of the 74HC165. Then, have the prop shift out 0000 0001 to the 595, and scan the 165 for the same pattern. If, for example, it finds 0000 0011, it will know that pins 1 and 2 are shorted together, and it will report a failure to the operator.
Regarding your problem... Have you thought about just using the props I/O pins. You could use 2 8bit ports (pins) with 8 as output and 8 as input. Just put a code on the 8 output pins and read in on the 8 input pins. This is simple and quite fast in spin, and no shifting required.
Thanks guys... as I was warned, Mr. Green and company are really helpful.
Can anyone give me a quick answer to this?
pub main | pattern
leds.init(2, 1, 0) ' initialize 595 driver
pattern1 := %0000_0001
pattern2 := %0000_0000
repeat
repeat
leds.out2(pattern1, pattern2)
waitcnt((MS_001 * 75) + cnt)
pattern1 <<= 1
until pattern1 == %1000_0000
pattern1 := %0000_0000
pattern2 := %0000_0001
repeat
leds.out2(pattern1, pattern2)
waitcnt((MS_001 * 75) + cnt)
pattern2 <<= 1
until pattern2 == %1000_0000
Hey, cut me some slack. I am a noob to this language ;o)