Changing Propeller clock
I have a feeling the Prop clock is too fast for my TLC2543.· How can I change the Prop clock from 80mHz to, say 20mHz?
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
·
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
It would be very unusual for the Prop's clock to affect the peripherals since the Prop program controls the speed of everything sent out. It's more likely that your program where it produces whatever clock it's using for the TLC2543 is the culprit. I know you've had other threads where you've talked about this TLC2543, but you didn't mention here what kind of driver you're using.
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 found several posts to other forums, which were very interesting, but not the original. Could you point me to the thread that contains your program and circuit diagram?
You are reporting an issue that sounds like my experience using the RC example from the counters lab in the Propeller Education Kit, where there is what a biologist would call "hysteresis..." in which there is a "range" error in both RC time measurement and the and the settling time to reach a stable RC time, both of which are inversely related to a resistance threshold for a fixed capacitance.
("Hysteresis" is also an engineering term and I'm not sure I'm using the term correctly in this context:,] )
Since the TLC2543 uses an RC technique with switched capacitance... if your error is of the same nature, then I would expect that there is some mismatch between resistance and capacitance somewhere...
What happens when you vary the external voltage?
You mention a pattern of errors... are they generally underestimates? What are you using for your gold standard? How much accuracy are you looking for?
Rich
It sounds to me like perhaps you have a temperature sensor attached to channel X but your program is reading channel X+1, which is floating. The floating channel will gradually approach the reading on the neighboring channel due to gate leakage.
Other points. When the TLC2543 first wakes up from its sleep state or first powers up, take and discard one reading from any channel. That first reading may be bogus. Remember that SHIFTOUT and SHIFTIN are always concurrent with the TLC2543, so when you shift in the result of the previous conversion, whatever is on the shift out pin is setting up a new conversion.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
I have found what Tracey says above: the first reading is usually junk. Other than that, the TLC2543 works great with the Prop for me. I have used both the BS2_functions and SPIengine with success.
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
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
·
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
·
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 would be typical for all of the floating channels to gravitate toward the one that has a stiff voltage applied from the temperature sensor. Internal capacitors are sampling the inputs and moving the charge around, and if nothing is attached to an input, the input capacitance would become charged to a level determined by the internal sampline process. There may be resistive leakage between the channels too. I'm not sure why your channel 0 is acting differently and reading zero, but I doubt the "dead" theory. Maybe it is hooked to ground or there is a leakage path to ground? Have you tried it with the temperature sensor attached to channel 0? Change the order that your channels are scanned and see if that changes the result.
Also, recall that when you read the data with the BS2 shiftin method, the value shifted out to the TLC2543 at the same time is probably a %000000000000, which effectively starts a conversion on channel zero when ychip select goes high. That happens any time you read any channel, 0 to 13, so channel zero gets a lot more conversions than the other channels. It is possible to write a method specifically for the TLC2543 that streamlines the data acquisition so that every shiftin is accompanied by a meaningful shiftout to start the next conversion.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
bs.shiftout(din,clk, bs#MSBFIRST,0<<8,12)
and Channel 0 read 0.· Then......I wrote:
bs.shiftout(din,clk, bs#MSBFIRST,1-1<<8,12)
and Channel 0 read just like the other channels.· Then I wrote:
bs.shiftout(din,clk, bs#MSBFIRST,(1-1)<<8,12)
and Channel 0 read 0 again.· Can you tell me what is going on?· What is the difference between 1-1 and (1-1)?· I wrote:
bs.shiftout(din,clk, bs#MSBFIRST,(1)<<8,12)
and the readings were normal.· Maybe 1-1 doesn't = 0 but (1-1) does.
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
·
The shift operator << has priority over subtraction, so {1-1<<8} is equivalent to {1 - (1<<8)} not {(1-1) << 8}.
What happens if you attach the temperature sensor to channel 0 and read it there?
What reading do you get from channel 11? That is the internal Vref/2 reference signal.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Channel 11 is not connected so I can't read that.
Maybe the BS2.shiftout won't accept 0<<8 - I sent Marting Hebel an e-mail asking him about that.
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
·
Other things to do with channel 0:
- measure the voltage there with a voltmeter, to be sure it is not shorted to ground on the protoboard (but okay with the Stamp)
- connect channel 0 to +5 or to +3.3 volts and see what it says.
- connect the temperature sensor to both channel 1 and to channel 0 with a jumper and see if they are still different.
Pretty mysterious all right!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Problem solved!!· It was the BS.shiftout structure.· I had written:
bs.shiftout(din,clk,bs#MSBFIRST,adch<<8,12)
and it should have been:
bs.shiftout(din,clk,adch<<8, bs#MSBFIRST,12)
Martin caught the error - my thanks to him.· All channels are working normally now·- when I reload or boot up the first ADC reading is junk, but after that all readings are right on.· Also, the unmodified ouput of the ADC is about what I get with the Stamp.
One of my problems is that I may write in SPIN but I think in PBasic.· The incorrect structure would be correct for the Stamp, but it doesn't work that way with the bs.shiftout.· Oh, well....live and learn.
Now to clean up the program and press on.· Thanks for all your help, Tracy.
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
·
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
StampPlot - GUI and Plotting Software
Southern Illinois University Carbondale, Electronic Systems Technologies
Just got home to the computer with the BS2_Functions/TLC2543 snip, but I see you have it working. Guess I'm a day laye and a dollar short [noparse]:)[/noparse]
Glad you got it working!
Jonathan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
www.madlabs.info - Home of the Hydrogen Fuel Cell Robot
Previously then, from examination of Martin's bs.shiftout code, your call to channel 0 became LSBFIRST with value 1 (1=mode MSBFIRST but in the value position) The TLC2543 took that in as MSBFIRST and would read channel 8 (because the 1 would be interpreted by the TLC2543 as channel %1000) A bs/shiftout call to any other channel was interpreted as an MSBFIRST call to channel 0. I think? I don't know if that explains the character of the strange results. But congratulations on getting it working!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Tracy Allen
www.emesystems.com
Today I ran across your 'sign-off' via an email. URL is:
www.members.shaw.ca/grandmafaiths2/boogie.htm
Sorry all for going off topic. I like the play on words.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Harley Shanko
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
·
bs.shiftin(io, sclk, bs#lsbpre,24)
This would be in accordance with Stamp protocol where seconds, minutes and hours are read at one time.· This won't work with the Prop because there is no way to break out the three parameters from the 24 bits.· So after spending a couple of hours trying to figure out how to get around it, I wrote:
seconds := bs.shiftin(io, sclk, bs#lsbpre,8)
minutes := bs.shiftin(io, sclk, bs#lsbpre,8)
and so on.· Shifting the data in 8 bits at a time solved the problem.
Now I can replace my Proto Board and the companion Stamp with its ADC AppMod and all the wires with my little board and its two plug-in modules.
So.........I'll have to think of something new and exciting for my Proto Board.· Tomorrow, that is.
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
·