SX newbie questions
Robert Schwartz
Posts: 141
Hey, I am trying to make a really low power consumption robot using the SX's. I was wondering how I would configure a 32khz resonator. The SX manual gives the diagram, and capacitor/resistor settings for most resonators, but not 32khz. Also, I am not sure what additional settings I shoul use. I am not using turbo, for slightly less power consumption, but I don't know about settings like STACKX and OPTIONX. What are they used for and will they have any affect on power consumption? I'm using the SX18 (probably).
Comments
I never tried to hook up a 32 kHz resonator to an SX, but it should work. If you have one on hand, just give it a try without adding additional components, like a parallel resistor, or any caps to ground, and see if it works. If you have a scope available, check if there is a clock signal on the OSC pins, or run a simple program, like blinking an LED to verify that the SX operates at that clock rate.
STACKX and/or OPTIONX (including one in your code automatically activates the other one, so there is no need to include both - but it does not cause trouble if you do so), activate the SXes 8-level subroutine stack (there are only two levels w/o this directive), and also allows to make use of the eXtra bits in the option register (this is what the X stands for) that you will need to activate the RTCC overflow controlled interrupt. IMO, this is one of the greatest features of the SX.
Besides this, I suggest to activate the TURBO mode as this effectively allows the SX to execute programs four times faster compared to non-TURBO without dramatically increasing power consumption.
You are right, the SX "eats" less power, when clocked at low frequencies. On the other hand, dealing with robot applications usually means that you will have to control some servos, or motors, and with a clock frequency as low as 32 kHz, it might be impossible to generate the required RWM signals to control the servos with sufficient resolution.
I prepared some servo-controlling code for my SX book, and I found that even the 4 MHz clock I used did not allow for a good resolution.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
http://www.sxlist.com/techref/ubicom/power.htm
http://www.sxlist.com/techref/ubicom/turbopower.htm
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
---
James Newton, Host of SXList.com
james@sxlist.com 1-619-652-0593 fax:1-208-279-8767
SX FAQ / Code / Tutorials / Documentation:
http://www.sxlist.com Pick faster!
Post Edited (Robert Schwartz) : 2/24/2005 11:32:19 PM GMT
You have internal option of 4MHz, 1MHz, 128KHz and 32KHz. They are about +/- 8% so don't use the internal osc if you need to do serial comm or anything.
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out· the "SX-Video Display Module"
www.sxvm.com
·
just leave'em open. As Bean said, this internal clock is not very accurate. Although the SX-Key IDE allows for "IRC" calibration (internal RC Clock), chip temperature, supply voltage, etc. still have an impact on the frequency.
When running the SX with an unregulated power supply, make sure that the supply voltage does not drop below the minimum, which is 2.7 V @ 32 kHz clock, according to the SX data sheet, and also make sure that brownout detection is turned off (add DEVICE BOROFF to your code, just to be sure).
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Greetings from Germany,
G
I have found that if you are using the SX key, I cannot use the debug feature.
I think that is 'normal'
ken
Bean.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Check out· the "SX-Video Display Module"
www.sxvm.com
·