View Full Version : cmps01 module with IsoPod
robot_user
04-02-04, 08:16 PM
I want to interface cmps01 compass module with IsoPod & use the PWM output. I have your cmps03 PWM code given in your appnotes section. Plz could you explain how does it work & what does it do as I'm just learning the IsoMax language.
Also to which pin of IsoPod is the pin 4 (pwm output) be connected. pins 2 & 3 should be connected to the +5V supply right? & what about pin 6 (calibrate). should it be grounded?
Thanks & regards,
RMDumse
04-03-04, 05:46 AM
I went to competition robotics site and looked for a CMPS01 and didn't find anything about it. I did see there was such a product using a Google search. Do you have any details about interfacing to it? How does it use PWM?
Again, as far as pin outs and connections on the CMPS01, we really don't know much about that product, having never seen it ourselves.
Oh! does it have two modes like the CMPS03? One I2C and the other just pulse width? I thought you were asking about the I2C at first. Now I understand you are interested in measuring the pulse width.
On the Calibrate Pin you should see their documentation, as I would have to, but do not have it at hand. They have a method of calibrating where you ground that pin when it is aligned one way, then you rotate it and ground the pin again, etc. It's been too long since this was done to remember off the top of my head. In operation I believe it is just left open.
As I recall, we put pull ups on pin 2 SCL & pin 3 SDA.
The PWM output of the CMPS03 module, pin 4, goes to the IsoPod(TM) TC0 pin.
The code for PLS in our timed example is pretty simple.
It looks at the status register of the timer to see if the pin is high or low. If it is low, that means there is no pulse happening right now, so it sets up the timer to capture a count of how long the pin is high. If the pin is high it leaves it alone. This routine is installed in the backgroud scheduler, so it runs often.
As soon as a pulse comes in, the counter begins running and when the pulse finishes, the count in the counter is captured, and can then be read. That value is in location D42.
The hardware of the timer has more to do with this interface working than the software. The software sets up the timer when there is no pulse, and leaves the result alone where there is.
The foreground words BEARING and Z are just there to take the captured data and translate it into a human readable for.
robot_user
04-03-04, 07:56 PM
Dear Mr. Dumse,
thanks a lot for the reply. i guess that cmps01 & cmps03 are same as far as functions & pin outs is concerned.
yes i am interested in using the PWM o/p from pin 4 of cmps01. yes, cmps01 also has 2 modes i2c & pwm. i am not using an display in the project. so wanted to know how will be the o/p from pin 4.
i'll now go ahead & do the wiring & programming & will let u know the results , how it comes up.
thanks & regards,
vBulletin v3.0.7, Copyright ©2000-2012, Jelsoft Enterprises Ltd.