SX48BD Multi-Function Timer
With the SX48BD, I want to clock the multi-function timer with an external clock and capture the counter with the capture input. Can I use the external clock input with the capture 1 input?
-Matt
-Matt
Comments
What you need to to is setup the timer to as "external counter", then when you want to get the current count, you need to change the timer mode to "capture" and toggle the capture pin.
You have to do it this way because you cannot get the current count without capturing it first.
What I do is connect one of the SX pins to the capture pin, then toggle that pin to capture the count.
P.S. Are you using assembly or SX/B ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
·
I either need to use the external 75MHz clock input to the counter or be able to change the OSC1 input frequency to 75MHz for that 1us time period and then back to 4MHz after the capture is complete.
The datasheet does not describe the external counter mode much besides saying it work like PWM mode. Does this mean the capture inputs cannot be used in the "external event" mode (since this is the only mode that appears to have the external clock capability and there does not seem to be any clock source configuration bit)?
Thanks for the reply (P.S. I think I have answered my own question already but in need of reassurance that the capability is not there),
Matt
In my experience, the SX must run at 3x the frequency being counted.
So running at 75Mhz would allow you to count a 25MHz frequency.
Your right, you cannot use the capture inputs while in external event mode, that's why you need to change modes to get the count.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
·
BTW, I am using the CCS SX C Compiler.
-Matt
What frequency are you trying to count ???
If I remember correctly, the SX must be clocked a 3x the frequency being counted.
Perhaps an external frequency divider could be used.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
·
"If I remember correctly, the SX must be clocked a 3x the frequency being counted."
I am not trying to determine a frequency if that is what you mean? Or are you talking about the external clock, in which I wouldn't this that were true unless you had the sync fuse enabled.
I wish the SX chip could come out of Power Down Mode faster. Then I could just goto sleep when I am done taking the time measurement. Then I could run at 75MHz then goto sleep to save power. The fastest I can get the SX48BD to wake up is about 400us though.
-Matt
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
·
Yes, "The time between capture pulses ?" (well edges since it captures on rising or falling edges).
I don't see any reason why the counter cannot be clocked at 75MHz as long as the sync fuse is disabled.
From the SX datasheet:
The reason I want to do this is because I do not need the whole chip to run at 75MHz while it is sitting in loops waiting for the captured time interval. Waste of power. I want to run the rest of the SX48 off of the internal 4MHz.
I guess this doesn't matter anymore anyway since my original question:
"With the SX48BD, I want to clock the multi-function timer with an external clock and capture the counter with the capture input. Can I use the external clock input with the capture 1 input?" (maybe I should have added "at the same time" to word it better.)
doesn't seem possible.
Another question to anyone familiar with the propeller - Is what I am trying to do possible with the propeller?
1) Idle the chip at a slower system clock.
2) Jump quickly (on the fly) to a faster system clock to capture the time between 2 edges (counter counting at 75-80Mhz - about 13ns per clock).
3) Jump quickly back down to the slower system clock.
4) Bonus would be to have different power management capabilities which would allow you to enter and escape from them quickly (<100us).
My understanding is that the Propeller has a PLL. Do you know how fast the PLL will change from 1 freq. to the next?
-Matt
-Matt
What power usage can you stand while counting and while idle ?
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
·
not that picky about during counting since that will only take a few us. We assumed it would be around 150-200ma.
I was running some experiments for someone else here to see if we could get the SX to run off of 2 separate clocks (4MHz and 50-75MHz). The idea was to dominate a crystal @ 4MHz with a 75MHz clock only while counting. So far, the tests fail (as I would expect). This hack was to be temporary until we could come up with a better solution.
The other idea was to get an external clock management chip, but the chips we looked at (Cypress with PLL) don't change frequency quickly enough. We need the frequency to change in less than 100us (if not ns). This has to be done with the least amount of circuitry possible. Talk about optimizing
If you have any suggestion or know of any solutions for changing a clock source frequency quickly, let me know.
-Matt
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Cheap used 4-digit LED display with driver IC·www.hc4led.com
Low power SD Data Logger www.sddatalogger.com
SX-Video Display Modules www.sxvm.com
·